void setNotifyAttached (DesignComponent component) { assert Debug.isFriend (ListenerManager.class, "addComponentDescriptorChanged") || Debug.isFriend (DynamicPresenter.class, "setNotifyAttached"); // NOI18N assert this.contentComponent == null && component != null; this.contentComponent = component; }
TransactionManager (DesignDocument document, DescriptorRegistry descriptorRegistry, ListenerManager listenerManager) { assert Debug.isFriend (DesignDocument.class, "<init>"); // NOI18N this.document = document; this.descriptorRegistry = descriptorRegistry; this.listenerManager = listenerManager; }
final void setSuperComponentDescriptor (ComponentDescriptor superDescriptor) { assert Debug.isFriend (GlobalDescriptorRegistry.class, "resolveDescriptor") || Debug.isFriend (GlobalDescriptorRegistry.class, "reloadCore") || Debug.isFriend (DescriptorRegistry.class, "reloadCore"); // NOI18N this.superDescriptor = superDescriptor; }
static GlobalDescriptorRegistry getGlobalDescriptorRegistry (String projectType) { assert Debug.isFriend (DescriptorRegistry.class, "getDescriptorRegistry") || Debug.isFriend (ComponentSerializationSupport.class); // NOI18N synchronized (registries) { WeakReference<GlobalDescriptorRegistry> ref = registries.get (projectType); GlobalDescriptorRegistry registry = ref != null ? ref.get () : null; if (registry == null) { registry = new GlobalDescriptorRegistry (projectType); registries.put (projectType, new WeakReference<GlobalDescriptorRegistry> (registry)); } return registry; } }
void addAffectedDesignComponent (DesignComponent component, String propertyName, PropertyValue oldPropertyValue) { assert Debug.isFriend (TransactionManager.class, "writePropertyHappened"); // NOI18N fullyComponents.add (component); HashMap<String, PropertyValue> properties = oldPropertyValues.get (component); if (properties == null) { properties = new HashMap<String, PropertyValue> (100); oldPropertyValues.put (component, properties); } if (! properties.containsKey (propertyName)) properties.put (propertyName, oldPropertyValue); }
void rootChangeHappened (DesignComponent root) { assert Debug.isFriend (DesignDocument.class, "setRootComponent"); // NOI18N assert assertEventAllowed; listenerManager.addAffectedComponentHierarchy (root); discardAllEdits = true; }
void componentDescriptorChangeHappened (DesignComponent component, Collection<? extends Presenter> presentersToRemove, Collection<Presenter> presentersToAdd, boolean useUndo) { assert Debug.isFriend (DesignComponent.class, "setComponentDescriptor"); // NOI18N assert assertEventAllowed; listenerManager.addComponentDescriptorChanged (component, presentersToRemove, presentersToAdd); if (useUndo) discardAllEdits = true; }
DescriptorRegistry getProjectRegistry (String projectID) { assert Debug.isFriend (DescriptorRegistry.class, "getDescriptorRegistry"); // NOI18N synchronized (projectID2projectRegistry) { WeakReference<DescriptorRegistry> ref = projectID2projectRegistry.get (projectID); DescriptorRegistry registry = ref != null ? ref.get () : null; if (registry == null) { registry = new DescriptorRegistry (this); // projectType, projectID); projectID2projectRegistry.put (projectID, new WeakReference<DescriptorRegistry> (registry)); } return registry; } }
void addComponentDescriptorChanged (DesignComponent component, Collection<? extends Presenter> presentersToRemove, Collection<Presenter> presentersToAdd) { assert Debug.isFriend (TransactionManager.class, "componentDescriptorChangeHappened"); // NOI18N descriptorChangedComponents.add (component); if (presentersToAdd != null) for (Presenter presenter : presentersToAdd) presenter.setNotifyAttached (component); presenterItems.add (new PresenterItem (component, presentersToRemove/*, presentersToAdd*/)); }
DescriptorRegistry (GlobalDescriptorRegistry globalDescriptorRegistry) { //, String projectType, String projectID) { assert Debug.isFriend (GlobalDescriptorRegistry.class, "getProjectRegistry"); // NOI18N // this.projectType = projectType; // this.projectID = projectID; this.globalDescriptorRegistry = globalDescriptorRegistry; // GlobalDescriptorRegistry.getGlobalDescriptorRegistry (projectType); globalDescriptorRegistry.addRegistryListener (listener); reload (); }
static void postProcessDescriptor (String projectType, ComponentDescriptor descriptor, ArrayList<PropertyDescriptor> properties) { assert Debug.isFriend (GlobalDescriptorRegistry.class, "resolveDescriptor"); // NOI18N for (PropertiesProcessor processor : result.allInstances ()) if (projectType.equals (processor.getProjectType ())) processor.postProcessProperties (descriptor, properties); } }
public static void notifyDataEditorViewActivated(DataEditorView activatedView) { assert Debug.isFriend(EditorViewElement.class, "componentActivated"); // NOI18N if (activatedView == null) { return; } CodeResolver resolver = resolvers.get(activatedView.getContext().getDataObject()); if (resolver != null) { resolver.viewActivated(activatedView); } }
static void postProcessDescriptor (String projectType, DesignDocument document, ComponentDescriptor descriptor, ArrayList<Presenter> presenters) { assert Debug.isFriend (DesignComponent.class, "setComponentDescriptor"); // NOI18N for (PresentersProcessor processor : result.allInstances ()) if (projectType.equals (processor.getProjectType ())) processor.postProcessPresenters (document, descriptor, presenters); }
static void postInitializeComponent (String projectType, DesignComponent component) { assert Debug.isFriend (DesignDocument.class, "createComponent"); // NOI18N for (PostInitializeProcessor processor : result.allInstances ()) if (projectType.equals (processor.getProjectType ())) processor.postInitialize (component); }
static PresenterDeserializer.PresenterFactory deserialize (String projectType, Node node) { assert Debug.isFriend (XMLComponentDescriptor.class, "deserializePresenters"); // NOI18N for (PresenterDeserializer deserializer : result.allInstances ()) if (projectType.equals (deserializer.getProjectType ())) { PresenterDeserializer.PresenterFactory descriptor = deserializer.deserialize (node); if (descriptor != null) return descriptor; } return null; }
void parentChangeHappened (DesignComponent previousParent, DesignComponent parent, DesignComponent child) { assert Debug.isFriend (DesignComponent.class, "addComponent") || Debug.isFriend (DesignComponent.class, "removeComponent"); // NOI18N assert assertEventAllowed; listenerManager.addAffectedComponentHierarchy (previousParent); listenerManager.addAffectedComponentHierarchy (parent); listenerManager.addAffectedComponentHierarchy (child); undoableEditHappened (new SetParentEdit (previousParent, parent, child)); }
void selectComponentsHappened (Collection<DesignComponent> oldSelection, Collection<DesignComponent> newSelection) { assert Debug.isFriend (DesignDocument.class, "setSelectedComponents"); // NOI18N assert assertEventAllowed; listenerManager.setSelectionChanged (); undoableEditHappened (new SelectionEdit (document, oldSelection, newSelection)); }
void writePropertyHappened (DesignComponent component, String propertyName, PropertyValue oldValue, PropertyValue newValue) { assert Debug.isFriend (DesignComponent.class, "writeProperty"); // NOI18N assert assertEventAllowed; listenerManager.addAffectedDesignComponent (component, propertyName, oldValue); undoableEditHappened (new WritePropertyEdit (component, propertyName, oldValue, newValue)); }
static PropertyValue createComponentReferenceCore(DesignComponent component) { assert Debug.isFriend(DesignComponent.class, "<init>"); // NOI18N assert component != null; TypeID type = component.getType(); assert type.getKind() == TypeID.Kind.COMPONENT; PropertyValue val = new PropertyValue(Kind.REFERENCE); val.type = type; val.component = component; return val; }