Package com._1c.g5.properties.ui
Class PropertySheetPage
- java.lang.Object
-
- com._1c.g5.properties.ui.PropertySheetPage
-
- All Implemented Interfaces:
EventListener,org.eclipse.jface.util.IPropertyChangeListener,org.eclipse.ui.ISelectionListener,org.eclipse.ui.part.IPage,org.eclipse.ui.part.IPageBookViewPage,org.eclipse.ui.views.properties.IPropertySheetPage
- Direct Known Subclasses:
MdPropertySheetPage
public class PropertySheetPage extends Object implements org.eclipse.ui.part.IPageBookViewPage, org.eclipse.ui.views.properties.IPropertySheetPage, org.eclipse.jface.util.IPropertyChangeListener
Represents property sheet page for objects. It manages the UI-side of the property palette:ScrolledCompositeand its contents,Actions and menu items in the toolbar, selection changes.It makes use of
PropertyPaletteModel, the back-end that does all the non-UI work. Selection changes are propagated toPropertyPaletteModeldirectly. Other user activity: changes in display mode, filtering, etc. arrive there via a listener of preferences and a help ofPreferences.
-
-
Constructor Summary
Constructors Constructor Description PropertySheetPage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateControl(org.eclipse.swt.widgets.Composite parent)Creates the rootScrolledCompositeand aCompositeinside it that serves as a parent for all UI elements that display and edit fields of an object.protected org.eclipse.ui.forms.widgets.FormToolkitcreateFormToolkit()Creates and returnsFormToolkitused to create controls.protected voidcreateInternalControls(org.eclipse.swt.widgets.Composite parent)Creates internal controlsprotected org.eclipse.swt.widgets.CompositecreateRootComposite(org.eclipse.swt.widgets.Composite parent)Creates a root composite.protected IScenecreateScene(IEngine engine, org.eclipse.swt.widgets.Composite parent)protected voidcreateTopCompositeContent(org.eclipse.swt.widgets.Composite composite)Creates controls which will be on top of property page.voiddispose()org.eclipse.swt.widgets.ControlgetControl()Returns the rootCompositeof this page.protected ISelectiongetCurrentSelection()Returns property page current selection.protected PropertyPaletteComponentgetPaletteComponent()Returns palette component.protected PropertyPaletteModelgetPaletteModel()Returns palette model.protected org.eclipse.swt.widgets.CompositegetRootComposite()Returns page root composite.protected IScenegetScene()Returns scene.protected ISelectiongetSelectionForPropertyPage(org.eclipse.ui.IWorkbenchPart part, ISelection selection)Obtains a selection suitable for use by the Property Palette.protected org.eclipse.ui.IWorkbenchPartgetSelectionPart()Returns selection part.org.eclipse.ui.part.IPageSitegetSite()protected org.eclipse.ui.forms.widgets.FormToolkitgetToolkit()ReturnsFormToolkitused to create controls.voidinit(org.eclipse.ui.part.IPageSite site)protected voidinitializeEngine(IEngine engine)protected voidinitializePreferenceListeners()Initializes property page preference listeners.protected org.eclipse.ui.operations.UndoRedoActionGroupinitUndoRedoActionGroup(org.eclipse.ui.IViewSite viewSite)Inits undo redo action group which will be used to fill undo/redo action bars.booleanisDisposed()protected voidprocessSelectionChanged(ISelection newSelection)Processes selection changed event.voidpropertyChange(org.eclipse.jface.util.PropertyChangeEvent event)Adapts itself to changes in preferencesprotected voidregisterServiceConsumers(IScene scene)Registers service consumers at given scene.voidselectionChanged(org.eclipse.ui.IWorkbenchPart part, ISelection selection)InformsPropertyPaletteModelof selection change.voidsetActionBars(org.eclipse.ui.IActionBars actionBars)Adds toggle buttons for alphabetical and categorial display modes.voidsetFocus()protected voidsuppressFocusRestoration()Suppresses focus restoration for more recently focused component.protected voidupdateSelection()Updates page selection.
-
-
-
Method Detail
-
createControl
public void createControl(org.eclipse.swt.widgets.Composite parent)
Creates the rootScrolledCompositeand aCompositeinside it that serves as a parent for all UI elements that display and edit fields of an object. Also createsFormToolkitto create the UI controls with.Creates
PropertyPaletteModelinstance. Starts listening to changes of preferences related to property palette.- Specified by:
createControlin interfaceorg.eclipse.ui.part.IPage
-
dispose
public void dispose()
Disposes off theFormToolkitandPropertyPaletteModelcreated increateControl(Composite). Stops listening to changes of preferences related to property palette.- Specified by:
disposein interfaceorg.eclipse.ui.part.IPage
-
getControl
public org.eclipse.swt.widgets.Control getControl()
Returns the rootCompositeof this page.- Specified by:
getControlin interfaceorg.eclipse.ui.part.IPage
-
getSite
public org.eclipse.ui.part.IPageSite getSite()
- Specified by:
getSitein interfaceorg.eclipse.ui.part.IPageBookViewPage
-
init
public void init(org.eclipse.ui.part.IPageSite site) throws org.eclipse.ui.PartInitException- Specified by:
initin interfaceorg.eclipse.ui.part.IPageBookViewPage- Throws:
org.eclipse.ui.PartInitException
-
isDisposed
public boolean isDisposed()
- Returns:
trueif the page is disposed,falseotherwise.
-
propertyChange
public void propertyChange(org.eclipse.jface.util.PropertyChangeEvent event)
Adapts itself to changes in preferences- Specified by:
propertyChangein interfaceorg.eclipse.jface.util.IPropertyChangeListener
-
selectionChanged
public void selectionChanged(org.eclipse.ui.IWorkbenchPart part, ISelection selection)InformsPropertyPaletteModelof selection change. Hides the rootCompositeif selection is empty.- Specified by:
selectionChangedin interfaceorg.eclipse.ui.ISelectionListener
-
setActionBars
public void setActionBars(org.eclipse.ui.IActionBars actionBars)
Adds toggle buttons for alphabetical and categorial display modes. Also adds a menu checkbox-like item to display either a human readable caption or an internal name for each field.- Specified by:
setActionBarsin interfaceorg.eclipse.ui.part.IPage
-
setFocus
public void setFocus()
- Specified by:
setFocusin interfaceorg.eclipse.ui.part.IPage
-
getScene
protected IScene getScene()
Returns scene.- Returns:
- scene. Cannot return
null.
-
getPaletteComponent
protected PropertyPaletteComponent getPaletteComponent()
Returns palette component.- Returns:
- palette component. Cannot return
null.
-
getPaletteModel
protected PropertyPaletteModel getPaletteModel()
Returns palette model.- Returns:
- palette model. Cannot return
null.
-
getRootComposite
protected org.eclipse.swt.widgets.Composite getRootComposite()
Returns page root composite.- Returns:
- page root composite. Returns
nullif controls was not created.
-
getCurrentSelection
protected ISelection getCurrentSelection()
Returns property page current selection.- Returns:
- current selection. Can return
null.
-
getToolkit
protected final org.eclipse.ui.forms.widgets.FormToolkit getToolkit()
ReturnsFormToolkitused to create controls.- Returns:
FormToolkitused to create controls. Returnsnullif controls was not created.
-
getSelectionPart
protected org.eclipse.ui.IWorkbenchPart getSelectionPart()
Returns selection part.- Returns:
- selection part. Cannot return
null.
-
updateSelection
protected void updateSelection()
Updates page selection.
-
processSelectionChanged
protected void processSelectionChanged(ISelection newSelection)
Processes selection changed event.- Parameters:
newSelection- - new selection. Cannot benull.
-
createInternalControls
protected void createInternalControls(org.eclipse.swt.widgets.Composite parent)
Creates internal controls
-
createTopCompositeContent
protected void createTopCompositeContent(org.eclipse.swt.widgets.Composite composite)
Creates controls which will be on top of property page.- Parameters:
composite- - composite to create content. Cannot benull.
-
registerServiceConsumers
protected void registerServiceConsumers(IScene scene)
Registers service consumers at given scene.- Parameters:
scene- - scene to register consumers. Cannot benull.
-
createFormToolkit
protected org.eclipse.ui.forms.widgets.FormToolkit createFormToolkit()
Creates and returnsFormToolkitused to create controls.- Returns:
- created form tookit.
-
initUndoRedoActionGroup
protected org.eclipse.ui.operations.UndoRedoActionGroup initUndoRedoActionGroup(org.eclipse.ui.IViewSite viewSite)
Inits undo redo action group which will be used to fill undo/redo action bars.- Parameters:
viewSite- - undo redo view site. Cannot benull.- Returns:
- created undo redo action group. Can return
null.
-
getSelectionForPropertyPage
protected ISelection getSelectionForPropertyPage(org.eclipse.ui.IWorkbenchPart part, ISelection selection)
Obtains a selection suitable for use by the Property Palette.- Parameters:
part- - the workbench part containing the selection. Cannot benull.selection- - original selection reported by Property Palette. Cannot benull.- Returns:
- a selection suitable for use by the Property Palette. Cannot return
null.
-
suppressFocusRestoration
protected void suppressFocusRestoration()
Suppresses focus restoration for more recently focused component.
-
initializeEngine
protected void initializeEngine(IEngine engine)
-
createRootComposite
protected org.eclipse.swt.widgets.Composite createRootComposite(org.eclipse.swt.widgets.Composite parent)
Creates a root composite.- Returns:
- a newly created composite, never
null.
-
initializePreferenceListeners
protected void initializePreferenceListeners()
Initializes property page preference listeners.
-
-