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:
ScrolledComposite
and its contents,
Action
s 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 to PropertyPaletteModel
directly. Other user activity: changes in display mode, filtering, etc.
arrive there via a listener of
preferences and
a help of Preferences
.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
createControl
(org.eclipse.swt.widgets.Composite parent) Creates the rootScrolledComposite
and aComposite
inside it that serves as a parent for all UI elements that display and edit fields of an object.protected org.eclipse.ui.forms.widgets.FormToolkit
Creates and returnsFormToolkit
used to create controls.protected void
createInternalControls
(org.eclipse.swt.widgets.Composite parent) Creates internal controlsprotected org.eclipse.swt.widgets.Composite
createRootComposite
(org.eclipse.swt.widgets.Composite parent) Creates a root composite.protected IScene
createScene
(IEngine engine, org.eclipse.swt.widgets.Composite parent) protected void
createTopCompositeContent
(org.eclipse.swt.widgets.Composite composite) Creates controls which will be on top of property page.void
dispose()
org.eclipse.swt.widgets.Control
Returns the rootComposite
of this page.protected ISelection
Returns property page current selection.protected PropertyPaletteComponent
Returns palette component.protected PropertyPaletteModel
Returns palette model.protected org.eclipse.swt.widgets.Composite
Returns page root composite.protected IScene
getScene()
Returns scene.protected ISelection
getSelectionForPropertyPage
(org.eclipse.ui.IWorkbenchPart part, ISelection selection) Obtains a selection suitable for use by the Property Palette.protected org.eclipse.ui.IWorkbenchPart
Returns selection part.org.eclipse.ui.part.IPageSite
getSite()
protected final org.eclipse.ui.forms.widgets.FormToolkit
ReturnsFormToolkit
used to create controls.void
init
(org.eclipse.ui.part.IPageSite site) protected void
initializeEngine
(IEngine engine) protected void
Initializes property page preference listeners.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.boolean
protected boolean
processSelectionChanged
(ISelection newSelection) Processes selection changed event.void
propertyChange
(org.eclipse.jface.util.PropertyChangeEvent event) Adapts itself to changes in preferencesprotected void
registerServiceConsumers
(IScene scene) Registers service consumers at given scene.void
selectionChanged
(org.eclipse.ui.IWorkbenchPart part, ISelection selection) InformsPropertyPaletteModel
of selection change.void
setActionBars
(org.eclipse.ui.IActionBars actionBars) Adds toggle buttons for alphabetical and categorial display modes.void
setFocus()
protected void
Suppresses focus restoration for more recently focused component.protected void
Updates page selection.
-
Constructor Details
-
PropertySheetPage
public PropertySheetPage()
-
-
Method Details
-
createControl
public void createControl(org.eclipse.swt.widgets.Composite parent) Creates the rootScrolledComposite
and aComposite
inside it that serves as a parent for all UI elements that display and edit fields of an object. Also createsFormToolkit
to create the UI controls with.Creates
PropertyPaletteModel
instance. Starts listening to changes of preferences related to property palette.- Specified by:
createControl
in interfaceorg.eclipse.ui.part.IPage
-
dispose
public void dispose()Disposes off theFormToolkit
andPropertyPaletteModel
created increateControl(Composite)
. Stops listening to changes of preferences related to property palette.- Specified by:
dispose
in interfaceorg.eclipse.ui.part.IPage
-
getControl
public org.eclipse.swt.widgets.Control getControl()Returns the rootComposite
of this page.- Specified by:
getControl
in interfaceorg.eclipse.ui.part.IPage
-
getSite
public org.eclipse.ui.part.IPageSite getSite()- Specified by:
getSite
in interfaceorg.eclipse.ui.part.IPageBookViewPage
-
init
public void init(org.eclipse.ui.part.IPageSite site) throws org.eclipse.ui.PartInitException - Specified by:
init
in interfaceorg.eclipse.ui.part.IPageBookViewPage
- Throws:
org.eclipse.ui.PartInitException
-
isDisposed
public boolean isDisposed()- Returns:
true
if the page is disposed,false
otherwise.
-
propertyChange
public void propertyChange(org.eclipse.jface.util.PropertyChangeEvent event) Adapts itself to changes in preferences- Specified by:
propertyChange
in interfaceorg.eclipse.jface.util.IPropertyChangeListener
-
selectionChanged
InformsPropertyPaletteModel
of selection change. Hides the rootComposite
if selection is empty.- Specified by:
selectionChanged
in 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:
setActionBars
in interfaceorg.eclipse.ui.part.IPage
-
setFocus
public void setFocus()- Specified by:
setFocus
in interfaceorg.eclipse.ui.part.IPage
-
getScene
Returns scene.- Returns:
- scene. Cannot return
null
.
-
getPaletteComponent
Returns palette component.- Returns:
- palette component. Cannot return
null
.
-
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
null
if controls was not created.
-
getCurrentSelection
Returns property page current selection.- Returns:
- current selection. Can return
null
.
-
getToolkit
protected final org.eclipse.ui.forms.widgets.FormToolkit getToolkit()ReturnsFormToolkit
used to create controls.- Returns:
FormToolkit
used to create controls. Returnsnull
if 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
Processes selection changed event.- Parameters:
newSelection
- - new selection. Cannot benull
.- Returns:
true
if specified selection can be displayed on property sheet,false
in otherwise.
-
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
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 returnsFormToolkit
used 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
-
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
.
-
createScene
-
initializePreferenceListeners
protected void initializePreferenceListeners()Initializes property page preference listeners.
-