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, 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 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 Details

    • PropertySheetPage

      public PropertySheetPage()
  • Method Details

    • createControl

      public void createControl(org.eclipse.swt.widgets.Composite parent)
      Creates the root ScrolledComposite and a Composite inside it that serves as a parent for all UI elements that display and edit fields of an object. Also creates FormToolkit to create the UI controls with.

      Creates PropertyPaletteModel instance. Starts listening to changes of preferences related to property palette.

      Specified by:
      createControl in interface org.eclipse.ui.part.IPage
    • dispose

      public void dispose()
      Disposes off the FormToolkit and PropertyPaletteModel created in createControl(Composite). Stops listening to changes of preferences related to property palette.
      Specified by:
      dispose in interface org.eclipse.ui.part.IPage
    • getControl

      public org.eclipse.swt.widgets.Control getControl()
      Returns the root Composite of this page.
      Specified by:
      getControl in interface org.eclipse.ui.part.IPage
    • getSite

      public org.eclipse.ui.part.IPageSite getSite()
      Specified by:
      getSite in interface org.eclipse.ui.part.IPageBookViewPage
    • init

      public void init(org.eclipse.ui.part.IPageSite site) throws org.eclipse.ui.PartInitException
      Specified by:
      init in interface org.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 interface org.eclipse.jface.util.IPropertyChangeListener
    • selectionChanged

      public void selectionChanged(org.eclipse.ui.IWorkbenchPart part, ISelection selection)
      Informs PropertyPaletteModel of selection change. Hides the root Composite if selection is empty.
      Specified by:
      selectionChanged in interface org.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 interface org.eclipse.ui.part.IPage
    • setFocus

      public void setFocus()
      Specified by:
      setFocus in interface org.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 null if 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()
      Returns FormToolkit used to create controls.
      Returns:
      FormToolkit used to create controls. Returns null 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

      protected boolean processSelectionChanged(ISelection newSelection)
      Processes selection changed event.
      Parameters:
      newSelection - - new selection. Cannot be null.
      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 be null.
    • registerServiceConsumers

      protected void registerServiceConsumers(IScene scene)
      Registers service consumers at given scene.
      Parameters:
      scene - - scene to register consumers. Cannot be null.
    • createFormToolkit

      protected org.eclipse.ui.forms.widgets.FormToolkit createFormToolkit()
      Creates and returns FormToolkit 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 be null.
      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 be null.
      selection - - original selection reported by Property Palette. Cannot be null.
      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.
    • createScene

      protected IScene createScene(IEngine engine, org.eclipse.swt.widgets.Composite parent)
    • initializePreferenceListeners

      protected void initializePreferenceListeners()
      Initializes property page preference listeners.