Package com.iizigo.prop
Class PropertyEditor
- All Implemented Interfaces:
IThemeListener
,IFilterListener
,Drawable
,IPersistable
,IPersistableEditor
public class PropertyEditor extends Composite implements IFilterListener, IPersistableEditor, IThemeListener
The Property Editor implemented as an SWT composite.
- Author:
- Christopher Mindus
Nested Class Summary
Field Summary
Constructor Summary
ConstructorDescriptionPropertyEditor
(IPropertyEditorController controller, Composite parent, PropertyEditorSetup pes) Creates the properties composite.PropertyEditor
(IPropertyEditorController controller, Composite parent, PropertyEditorSetup pes, boolean useFilter) Creates the properties composite.PropertyEditor
(IPropertyEditorController controller, Composite parent, PropertyEditorSetup pes, boolean useFilter, boolean enableGroups, IMemento propsMemento) Creates the properties composite.PropertyEditor
(IPropertyEditorController controller, Composite parent, PropertyEditorSetup pes, boolean useFilter, boolean enableGroups, IMemento propsMemento, int style) Creates the properties composite.PropertyEditor
(IPropertyEditorController controller, Composite parent, PropertyEditorSetup pes, boolean useFilter, boolean enableGroups, IMemento propsMemento, int style, int scrollStyle) Creates the properties composite.PropertyEditor
(IPropertyEditorController controller, Composite parent, PropertyEditorSetup pes, boolean useFilter, IMemento propsMemento) Creates the properties composite.Method Summary
Modifier and TypeMethodDescriptionvoid
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.void
Called when a filter text has been applied.final void
onThemeChanged
(ApplicationUI appUI) Called once the new theme has stabilized after a period of time.void
Causes redraw of properties after collapse/expand/filter/multi-edit.void
restoreState
(IMemento memento) Called with a memento for this editor.void
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.void
Sets a new content to the editor for dialog boxes and preference pages, regardless of component visibility under Windows.void
Enables fixed tooltips that are not removed.boolean
Attempts to set focus to a property item with a specific atom.boolean
Attempts to set focus to a property item with a specific atom.boolean
Attempts to set focus to a property currently being edited.boolean
Attempts to set focus to a property item with a specific atom.boolean
Attempts to set focus to a property item with a specific atom.void
Sets the image and title for the property editor, default is "Properties".PropCnr[]
setViewerEditedProperties
(TreeViewer viewer) Sets the edited properties from a viewer.void
Scans 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, computeSize, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, redraw, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList, toString
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar, setScrollbarsMode
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, 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, 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, addTypedListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeTypedListener, 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
PropertyEditor
public PropertyEditor(IPropertyEditorController controller, Composite parent, PropertyEditorSetup pes) Creates the properties composite.- Parameters:
controller
- The property controller.parent
- The parent composite.
PropertyEditor
public PropertyEditor(IPropertyEditorController controller, 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.
PropertyEditor
public PropertyEditor(IPropertyEditorController controller, Composite parent, PropertyEditorSetup pes, boolean useFilter, 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.
PropertyEditor
public PropertyEditor(IPropertyEditorController controller, Composite parent, PropertyEditorSetup pes, boolean useFilter, boolean enableGroups, 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.
PropertyEditor
public PropertyEditor(IPropertyEditorController controller, Composite parent, PropertyEditorSetup pes, boolean useFilter, boolean enableGroups, 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.
PropertyEditor
public PropertyEditor(IPropertyEditorController controller, Composite parent, PropertyEditorSetup pes, boolean useFilter, boolean enableGroups, 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
onFilter
Called when a filter text has been applied.- Specified by:
onFilter
in interfaceIFilterListener
- Parameters:
text
- The filter text to apply, null for none (never empty string).
redrawProperties
public void redrawProperties()Causes redraw of properties after collapse/expand/filter/multi-edit.onThemeChanged
Called once the new theme has stabilized after a period of time.- Specified by:
onThemeChanged
in interfaceIThemeListener
- Parameters:
appUI
- The new ApplicationUI instance.
setTitle
Sets 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.
setFixedTooltips
public void setFixedTooltips()Enables fixed tooltips that are not removed.getHeaderContextMenu
Gets the context menu for the headerBackground.restoreState
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:
restoreState
in interfaceIPersistableEditor
- Parameters:
memento
- the saved state for this editor. May benull
.
saveState
Saves the state of the object in the given memento.- Specified by:
saveState
in interfaceIPersistable
- Parameters:
memento
- The storage area for object's state.
getEditedProperties
Gets the edited property containers.- Returns:
- The edited properties if previously edited and displayed, null otherwise.
getController
Gets the controller.setViewerEditedProperties
Sets 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 toActivator.getSelected...
that strips children.setEditedProperties
Sets 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.
setEditedPropertiesForPopupWindows
Sets a new content to the editor for dialog boxes and preference pages, regardless of component visibility under Windows.- Parameters:
pcs
- The edited properties.
setEditedProperties
Sets a new content to the editor.addFocusInfo
Adds focus info at creation time of controls in the edited part.- Parameters:
c
- Control to get focus.
setFocus
Attempts 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.
setFocus
Attempts 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.
setFocus
Attempts 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.
setFocus
Attempts 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.
setFocus
Attempts 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.
verifySeverity
public 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.getFocusedBaseEditor
Finds the base editor that has focus.- Returns:
- The BaseEditor having focus, null for none.
getKStringInfoProviderAdapter
Gets 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.