Package com.iizigo.prop
Class PropertyEditor
java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
com.iizigo.prop.PropertyEditor
- All Implemented Interfaces:
- IThemeListener,- IFilterListener,- org.eclipse.swt.graphics.Drawable,- org.eclipse.ui.IPersistable,- org.eclipse.ui.IPersistableEditor
public class PropertyEditor extends org.eclipse.swt.widgets.Composite implements IFilterListener, org.eclipse.ui.IPersistableEditor, IThemeListener
The Property Editor implemented as an SWT composite.
- Author:
- Christopher Mindus
- Nested Class SummaryNested Classes
- Field Summary- Fields inherited from class org.eclipse.swt.widgets.Control- handle
- Constructor SummaryConstructorsConstructorDescription- PropertyEditor- (IPropertyEditorController controller, org.eclipse.swt.widgets.Composite parent, PropertyEditorSetup pes) Creates the properties composite.- PropertyEditor- (IPropertyEditorController controller, org.eclipse.swt.widgets.Composite parent, PropertyEditorSetup pes, boolean useFilter) Creates the properties composite.- PropertyEditor- (IPropertyEditorController controller, org.eclipse.swt.widgets.Composite parent, PropertyEditorSetup pes, boolean useFilter, boolean enableGroups, org.eclipse.ui.IMemento propsMemento) Creates the properties composite.- PropertyEditor- (IPropertyEditorController controller, org.eclipse.swt.widgets.Composite parent, PropertyEditorSetup pes, boolean useFilter, boolean enableGroups, org.eclipse.ui.IMemento propsMemento, int style) Creates the properties composite.- PropertyEditor- (IPropertyEditorController controller, org.eclipse.swt.widgets.Composite parent, PropertyEditorSetup pes, boolean useFilter, boolean enableGroups, org.eclipse.ui.IMemento propsMemento, int style, int scrollStyle) Creates the properties composite.- PropertyEditor- (IPropertyEditorController controller, org.eclipse.swt.widgets.Composite parent, PropertyEditorSetup pes, boolean useFilter, org.eclipse.ui.IMemento propsMemento) Creates the properties composite.
- Method SummaryModifier and TypeMethodDescription- void- addFocusInfo- (org.eclipse.swt.widgets.Control c) Adds focus info at creation time of controls in the edited part.Gets the controller.- PropCnr[]Gets the edited property containers.- BaseEditor<?,- ?> Finds the base editor that has focus.Gets the context menu for the headerBackground.Gets or creates the KStringInfoProviderAdapter used to resolve KString's and others containing KString's (e.g.- voidCalled when a filter text has been applied.- final void- onThemeChanged- (ApplicationUI appUI) Called once the new theme has stabilized after a period of time.- voidCauses redraw of properties after collapse/expand/filter/multi-edit.- void- restoreState- (org.eclipse.ui.IMemento memento) Called with a memento for this editor.- void- saveState- (org.eclipse.ui.IMemento memento) Saves the state of the object in the given memento.- void- setEditedProperties- (PropCnr[] pcs) Sets a new content to the editor.- void- setEditedProperties- (PropCnr pc, ArrayList<PropertyEditorInfo> infos) Sets a new content to the editor.- voidSets a new content to the editor for dialog boxes and preference pages, regardless of component visibility under Windows.- voidEnables fixed tooltips that are not removed.- booleanAttempts to set focus to a property item with a specific atom.- booleanAttempts to set focus to a property item with a specific atom.- booleanAttempts to set focus to a property currently being edited.- booleanAttempts to set focus to a property item with a specific atom.- booleanAttempts to set focus to a property item with a specific atom.- voidSets the image and title for the property editor, default is "Properties".- PropCnr[]- setViewerEditedProperties- (org.eclipse.jface.viewers.TreeViewer viewer) Sets the edited properties from a viewer.- voidScans the edited property containers for max error level and assigns it to the properties icon.- Methods inherited from class org.eclipse.swt.widgets.Composite- changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList, toString- Methods inherited from class org.eclipse.swt.widgets.Scrollable- computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar- Methods inherited from class org.eclipse.swt.widgets.Control- addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update- Methods inherited from class org.eclipse.swt.widgets.Widget- addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData- Methods inherited from class java.lang.Object- clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait- Methods inherited from interface org.eclipse.swt.graphics.Drawable- isAutoScalable
- Constructor Details- PropertyEditorpublic PropertyEditor- (IPropertyEditorController controller, org.eclipse.swt.widgets.Composite parent, PropertyEditorSetup pes) Creates the properties composite.- Parameters:
- controller- The property controller.
- parent- The parent composite.
 
- PropertyEditorpublic PropertyEditor- (IPropertyEditorController controller, org.eclipse.swt.widgets.Composite parent, PropertyEditorSetup pes, boolean useFilter) Creates the properties composite.- Parameters:
- controller- The property controller.
- parent- The parent composite.
- useFilter- Use the filtering mechanism/control.
 
- PropertyEditorpublic PropertyEditor- (IPropertyEditorController controller, org.eclipse.swt.widgets.Composite parent, PropertyEditorSetup pes, boolean useFilter, org.eclipse.ui.IMemento propsMemento) Creates the properties composite.- Parameters:
- controller- The property controller.
- parent- The parent composite.
- useFilter- Use the filtering mechanism/control.
- propsMemento- A memento for initialization or null for none.
 
- PropertyEditorpublic PropertyEditor- (IPropertyEditorController controller, org.eclipse.swt.widgets.Composite parent, PropertyEditorSetup pes, boolean useFilter, boolean enableGroups, org.eclipse.ui.IMemento propsMemento) Creates the properties composite.- Parameters:
- controller- The property controller.
- parent- The parent composite.
- pes- The property editor setup.
- useFilter- Use the filtering mechanism/control.
- enableGroups- Enable groups flag.
- propsMemento- A memento for initialization or null for none.
 
- PropertyEditorpublic PropertyEditor- (IPropertyEditorController controller, org.eclipse.swt.widgets.Composite parent, PropertyEditorSetup pes, boolean useFilter, boolean enableGroups, org.eclipse.ui.IMemento propsMemento, int style) Creates the properties composite.- Parameters:
- controller- The property controller.
- parent- The parent composite.
- pes- The property editor setup.
- useFilter- Use the filtering mechanism/control.
- enableGroups- Enable groups flag.
- propsMemento- A memento for initialization or null for none.
- style- Style of the container.
 
- PropertyEditorpublic PropertyEditor- (IPropertyEditorController controller, org.eclipse.swt.widgets.Composite parent, PropertyEditorSetup pes, boolean useFilter, boolean enableGroups, org.eclipse.ui.IMemento propsMemento, int style, int scrollStyle) Creates the properties composite.- Parameters:
- controller- The property controller.
- parent- The parent composite.
- pes- The property editor setup.
- useFilter- Use the filtering mechanism/control.
- enableGroups- Flag to enable groups.
- propsMemento- A memento for initialization or null for none.
- style- Style of the container.
- scrollStyle- Style for the scrolled container: SWT.H_SCROLL|SWT.V_SCROLL by default, set to SWT.NONE for no scrollbars.
 
 
- Method Details- onFilterCalled when a filter text has been applied.- Specified by:
- onFilterin interface- IFilterListener
- Parameters:
- text- The filter text to apply, null for none (never empty string).
 
- redrawPropertiespublic void redrawProperties()Causes redraw of properties after collapse/expand/filter/multi-edit.
- onThemeChangedCalled once the new theme has stabilized after a period of time.- Specified by:
- onThemeChangedin interface- IThemeListener
- Parameters:
- appUI- The new ApplicationUI instance.
 
- setTitleSets the image and title for the property editor, default is "Properties".- Parameters:
- image- The image to use or null for none.
- title- The title to use or null for none.
 
- setFixedTooltipspublic void setFixedTooltips()Enables fixed tooltips that are not removed.
- getHeaderContextMenuGets the context menu for the headerBackground.
- restoreStatepublic void restoreState- (org.eclipse.ui.IMemento memento) Called with a memento for this editor. The editor can parse the data or save the memento. This method may not be called.- Specified by:
- restoreStatein interface- org.eclipse.ui.IPersistableEditor
- Parameters:
- memento- the saved state for this editor. May be- null.
 
- saveStatepublic void saveState- (org.eclipse.ui.IMemento memento) Saves the state of the object in the given memento.- Specified by:
- saveStatein interface- org.eclipse.ui.IPersistable
- Parameters:
- memento- The storage area for object's state.
 
- getEditedPropertiesGets the edited property containers.- Returns:
- The edited properties if previously edited and displayed, null otherwise.
 
- getControllerGets the controller.
- setViewerEditedPropertiesSets the edited properties from a viewer. The selection must be inside the editor owning this property editor. This method selects all properties really selected in the tree for editing, as opposed to- Activator.getSelected...that strips children.
- setEditedPropertiesSets a new content to the editor. If no component is visible, nothing is done under Windows until later when visibility is back and a new call to this method is done.- Parameters:
- pcs- The edited properties.
 
- setEditedPropertiesForPopupWindowsSets a new content to the editor for dialog boxes and preference pages, regardless of component visibility under Windows.- Parameters:
- pcs- The edited properties.
 
- setEditedPropertiesSets a new content to the editor.
- addFocusInfopublic void addFocusInfo- (org.eclipse.swt.widgets.Control c) Adds focus info at creation time of controls in the edited part.- Parameters:
- c- Control to get focus.
 
- setFocusAttempts to set focus to a property currently being edited.- Parameters:
- property- The property to focus.
- index- Index in multi-property, -1 for none.
- childName- Name of a child property when it doesn't exist in the parent.
- Returns:
- true For success, false for failure.
 
- setFocusAttempts to set focus to a property item with a specific atom.- Parameters:
- name- Name of property to focus.
- Returns:
- true For success, false for failure.
 
- setFocusAttempts to set focus to a property item with a specific atom.- Parameters:
- name- Name of property to focus.
- index- Index in multi-property, -1 for none.
- Returns:
- true For success, false for failure.
 
- setFocusAttempts to set focus to a property item with a specific atom.- Parameters:
- atom- The property atom to focus, null for name.
- Returns:
- true For success, false for failure.
 
- setFocusAttempts to set focus to a property item with a specific atom.- Parameters:
- atom- The property atom to focus, null for name.
- index- Index in multi-property, -1 for none.
- Returns:
- true For success, false for failure.
 
- verifySeveritypublic void verifySeverity()Scans the edited property containers for max error level and assigns it to the properties icon. This method scans the edited nodes and not the property errors in order to reflect the same state as the edited properties.
- getFocusedBaseEditorFinds the base editor that has focus.- Returns:
- The BaseEditor having focus, null for none.
 
- getKStringInfoProviderAdapterGets or creates the KStringInfoProviderAdapter used to resolve KString's and others containing KString's (e.g. tooltips, badge).- This method expects to be called from the SWT thread. - Returns:
- The KStringInfoProviderAdapter instance.