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 Summary
Nested ClassesField Summary
Fields inherited from class org.eclipse.swt.widgets.Control
handleConstructor Summary
ConstructorsConstructorDescriptionPropertyEditor(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 Summary
Modifier and TypeMethodDescriptionvoidaddFocusInfo(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 voidonThemeChanged(ApplicationUI appUI) Called once the new theme has stabilized after a period of time.voidCauses redraw of properties after collapse/expand/filter/multi-edit.voidrestoreState(org.eclipse.ui.IMemento memento) Called with a memento for this editor.voidsaveState(org.eclipse.ui.IMemento memento) Saves the state of the object in the given memento.voidsetEditedProperties(PropCnr[] pcs) Sets a new content to the editor.voidsetEditedProperties(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, toStringMethods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBarMethods 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, updateMethods 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, setDataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.swt.graphics.Drawable
isAutoScalable
Constructor Details
PropertyEditor
public PropertyEditor(IPropertyEditorController controller, org.eclipse.swt.widgets.Composite parent, PropertyEditorSetup pes) Creates the properties composite.- Parameters:
controller- The property controller.parent- The parent composite.
PropertyEditor
public 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.
PropertyEditor
public 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.
PropertyEditor
public 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.
PropertyEditor
public 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.
PropertyEditor
public 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
onFilter
Called when a filter text has been applied.- Specified by:
onFilterin 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:
onThemeChangedin 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
public 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 interfaceorg.eclipse.ui.IPersistableEditor- Parameters:
memento- the saved state for this editor. May benull.
saveState
public void saveState(org.eclipse.ui.IMemento memento) Saves the state of the object in the given memento.- Specified by:
saveStatein interfaceorg.eclipse.ui.IPersistable- 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
public 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.
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.