/** * Gets a LayoutConstraintsDescriptor with the specified preferred width and preferred height * * @param prefWidth the preferred width of the Docking Area. Can be negative to indicate a flexible width. * @param prefHeight the preferred height of the Docking Area. Can be negative to indicate a flexible height. * @return a LayoutConstraintsDescriptor */ public static LayoutConstraintsDescriptor getLayoutConstraints(double prefWidth, double prefHeight) { return new LayoutConstraintsDescriptor(prefWidth, prefHeight); }
public E createEditorEntry(Object content, Class<? extends D> editorType, String icon, ResourceLoader resourceLoader) throws SecurityException, InvocationTargetException, IllegalAccessException, IllegalArgumentException, NoSuchMethodException, InstantiationException { D editor = createEditor(content, editorType, icon, resourceLoader); return createDockableEntry(editor, DockableKind.EDITOR); }
@Override public void close() { closeAllEditors(); closeAllViews(); }
@Override public void updateLayoutConstraints() { if (LayoutConstraintsDescriptor.isPreferred(getLayoutConstraints().getPrefWidth())) { getLayoutConstraints().setPrefWidth(getWidth()); } if (LayoutConstraintsDescriptor.isPreferred(getLayoutConstraints().getPrefHeight())) { getLayoutConstraints().setPrefHeight(getHeight()); } }
public void unregisterView(E viewEntry) throws Exception { if (viewEntry != null && viewEntry.getKind() == DockableKind.VIEW) { final D dockable = viewEntry.getDockable(); dockableDataManager.unregisterDockableData(dockable); dockablePreferencesManager.unregisterDockablePreferences(dockable); closeAutoCloseable(dockable); } }
private D createEditor(Object content, Class<? extends D> editorType, String icon, ResourceLoader resourceLoader) throws SecurityException, InvocationTargetException, IllegalAccessException, IllegalArgumentException, NoSuchMethodException, InstantiationException { D editor = createEditor(content, editorType); DATA dockableData = dockableDataFactory.createDockableData(icon, resourceLoader); dockableDataManager.registerDockableData(editor, dockableData); inject(editor); return editor; }
private D createAndRegisterView(Class<? extends D> viewType, String displayName, String icon, ResourceLoader resourceLoader) throws InstantiationException, IllegalAccessException { D view = createView(viewType); DATA dockableData = dockableDataFactory.createDockableData(displayName, icon, resourceLoader); dockableDataManager.registerDockableData(view, dockableData); inject(view); return view; }
private double getPrefSize(double prefSize) { if (isPreferred(prefSize)) { return prefSize; } else { return FLEXIBLE_PREF; } }
public void registerEditor(Object uniqueKey, E dockableEntry) { if (uniqueKey != null && dockableEntry != null && dockableEntry.getKind() == DockableKind.EDITOR) { editorRegistry.registerEditor(uniqueKey, dockableEntry); } }
public E createAndRegisterViewEntry(Class<? extends D> viewType, String displayName, String icon, ResourceLoader resourceLoader) throws InstantiationException, IllegalAccessException { D view = createAndRegisterView(viewType, displayName, icon, resourceLoader); E viewEntry = createDockableEntry(view, DockableKind.VIEW); viewEntries.add(viewEntry); return viewEntry; }
private double getPrefSize(RegionDimension dimension, LayoutConstraintsDescriptor layoutConstraints) { if (dimension.equals(RegionDimension.WIDTH)) { return layoutConstraints.getPrefWidth(); } else { return layoutConstraints.getPrefHeight(); } }
public static LayoutConstraintsDescriptor createLayoutConstraintsDescriptor(LayoutConstraintsType layoutConstraints) { return LayoutConstraintsDescriptor.getLayoutConstraints(layoutConstraints.getPrefWidth(), layoutConstraints.getPrefHeight()); }
/** * Creates a new instance of this class. * * @param prefWidth the preferred width of the Docking Area. Can be negative to indicate a flexible width. * @param prefHeight the preferred height of the Docking Area. Can be negative to indicate a flexible height. */ private LayoutConstraintsDescriptor(double prefWidth, double prefHeight) { this.prefWidth = getPrefSize(prefWidth); this.prefHeight = getPrefSize(prefHeight); }
public void unregisterEditor(E editorEntry) throws Exception { if (editorEntry != null && editorEntry.getKind() == DockableKind.EDITOR) { final D dockable = editorEntry.getDockable(); dockableDataManager.unregisterDockableData(dockable); dockablePreferencesManager.unregisterDockablePreferences(dockable); editorRegistry.unregisterEditor(editorEntry); closeAutoCloseable(dockable); } }
public static boolean isFlexible(double size) { return !isPreferred(size); }
public static LayoutConstraintsDescriptor prefHeight(double prefHeight) { return new LayoutConstraintsDescriptor(FLEXIBLE_PREF, prefHeight); }
public void setPrefHeight(double prefHeight) { double oldValue = this.prefHeight; this.prefHeight = getPrefSize(prefHeight); firePropertyChange(propertyChangeSupport, "prefHeight", oldValue, this.prefHeight); }
public static LayoutConstraintsDescriptor prefWidth(double prefWidth) { return new LayoutConstraintsDescriptor(prefWidth, FLEXIBLE_PREF); }
public void setPrefWidth(double prefWidth) { double oldValue = this.prefWidth; this.prefWidth = getPrefSize(prefWidth); firePropertyChange(propertyChangeSupport, "prefWidth", oldValue, this.prefWidth); }
public static LayoutConstraintsDescriptor flexible() { return new LayoutConstraintsDescriptor(FLEXIBLE_PREF, FLEXIBLE_PREF); }