Class AbstractRuntimeInstallationPreferencePage

  • All Implemented Interfaces:
    IRuntimeInstallationChangeListener, org.eclipse.jface.dialogs.IDialogPage, org.eclipse.jface.dialogs.IMessageProvider, org.eclipse.jface.preference.IPreferencePage, org.eclipse.ui.IWorkbenchPreferencePage

    public abstract class AbstractRuntimeInstallationPreferencePage
    extends org.eclipse.jface.preference.PreferencePage
    implements org.eclipse.ui.IWorkbenchPreferencePage, IRuntimeInstallationChangeListener
    Abstract preference page that supports 1C:Enterprise Runtime installations managing. Type of the 1C:Enterprise Runtime installations to manage will be the same as IRuntimeInstallationManager managing type.
    The page allows:
    • Add new 1C:Enterprise Runtime installation
    • Edit existing 1C:Enterprise Runtime installation
    • Remove existing 1C:Enterprise Runtime installation
    • Searches existing installations of 1C:Enterprise Runtime
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void add​(TableViewer viewer)
      Add a new 1C:Enterprise Runtime installation.
      protected org.eclipse.swt.widgets.Button createButton​(String text, org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.events.SelectionListener listener)
      Creates push button with the specified settings.
      protected org.eclipse.swt.widgets.Button createButton​(String text, org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.events.SelectionListener listener, boolean enabled)
      Creates push button with the specified settings.
      protected void createButtons​(org.eclipse.swt.widgets.Composite parent, TableViewer viewer)
      Create buttons for the viewer.
      protected TableViewerColumn createColumn​(String text, int width, CellLabelProvider labelProvider)
      Creates column for the viewer with the specified settings.
      protected void createColumns​(TableViewer viewer)
      Creates columns for the viewer.
      protected org.eclipse.swt.widgets.Control createContents​(org.eclipse.swt.widgets.Composite parent)  
      protected void createHeader​(org.eclipse.swt.widgets.Composite parent)
      Create header fot the property page.
      protected TableViewer createTable​(org.eclipse.swt.widgets.Composite parent)
      Create table viewer with the list of 1C:Enterprise Runtime installations.
      protected abstract IRuntimeInstallationWizard createWizard()
      Create new wizard of 1C:Enterprise Runtime installation.
      void dispose()  
      protected void edit​(RuntimeInstallation element, TableViewer viewer)
      Edit the existing 1C:Enterprise Runtime installation.
      protected Collection<RuntimeInstallation> getInput()
      Returns the input 1C:Enterprise Runtime installations.
      protected Collection<String> getInputNames​(TableViewer viewer)
      Returns names collection for the input 1C:Enterprise Runtime installations.
      protected abstract String getNodeQualifier()
      Returns the Eclipse preferences node qualifier to use for preference storing.
      protected org.eclipse.swt.graphics.Image getRuntimeInstallationImage​(RuntimeInstallation element)
      Returns image for the table element.
      protected void handleDoubleClick​(DoubleClickEvent event)
      Handles double click event of the table.
      void init​(org.eclipse.ui.IWorkbench workbench)  
      void installationsAdded​(Collection<RuntimeInstallation> installations)
      Notifies that new instances 1C:Enetrprise runtime installation was added and persisted.
      void installationsRemoved​(Collection<RuntimeInstallation> installations)
      Notifies that instances 1C:Enetrprise runtime installation was removed.
      boolean performOk()  
      protected void refresh​(TableViewer viewer)
      Searches 1C:Enterprise Runtime installations in the target folder and adds result to the viewer.
      protected void remove​(IStructuredSelection selection, TableViewer viewer)
      Removes current selection from the viewer.
      protected void search​(TableViewer viewer)
      Searches 1C:Enterprise Runtime installations and adds result to the viewer.
      protected void setTableDescription​(String tableDescription)
      Set the description of the table.
      protected void sortByLocation​(TableViewer viewer)
      Sort table by the 1C:Enteprise Runtime installation location.
      protected void sortByName​(TableViewer viewer)
      Sort table by the 1C:Enteprise Runtime installation name.
      protected void sortByVersion​(TableViewer viewer)
      Sort table by the 1C:Enteprise Runtime installation version.
      protected boolean validate​(RuntimeInstallation installation)
      Returns whether given 1C:Enterprise Runtime installation is supported by IDE 1C:Enterprise support.
      • Methods inherited from class org.eclipse.jface.preference.PreferencePage

        applyData, applyDialogFont, computeSize, contributeButtons, createControl, createDescriptionLabel, createNoteComposite, doComputeSize, doGetPreferenceStore, getApplyButton, getContainer, getDefaultsButton, getPreferenceStore, isValid, noDefaultAndApplyButton, noDefaultButton, okToLeave, performApply, performCancel, performDefaults, performHelp, setContainer, setErrorMessage, setMessage, setPreferenceStore, setSize, setTitle, setValid, toString, updateApplyButton
      • Methods inherited from class org.eclipse.jface.dialogs.DialogPage

        convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getImage, getMessage, getMessageType, getShell, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, setButtonLayoutData, setControl, setDescription, setImageDescriptor, setMessage, setVisible
      • Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage

        createControl, getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, performHelp, setDescription, setImageDescriptor, setTitle, setVisible
      • Methods inherited from interface org.eclipse.jface.preference.IPreferencePage

        computeSize, isValid, okToLeave, performCancel, setContainer, setSize
    • Constructor Detail

      • AbstractRuntimeInstallationPreferencePage

        public AbstractRuntimeInstallationPreferencePage​(IRuntimeInstallationManager runtimeInstallationManager,
                                                         String title)
        Parameters:
        runtimeInstallationManager - 1C:Enterprise Runtime installation manager, that manages this page type of 1C:Enterprise Runtime installations, cannot be null
        title - the title of this preference page, cannot be null
    • Method Detail

      • init

        public void init​(org.eclipse.ui.IWorkbench workbench)
        Specified by:
        init in interface org.eclipse.ui.IWorkbenchPreferencePage
      • createContents

        protected org.eclipse.swt.widgets.Control createContents​(org.eclipse.swt.widgets.Composite parent)
        Specified by:
        createContents in class org.eclipse.jface.preference.PreferencePage
      • dispose

        public void dispose()
        Specified by:
        dispose in interface org.eclipse.jface.dialogs.IDialogPage
        Overrides:
        dispose in class org.eclipse.jface.dialogs.DialogPage
      • performOk

        public boolean performOk()
        Specified by:
        performOk in interface org.eclipse.jface.preference.IPreferencePage
        Overrides:
        performOk in class org.eclipse.jface.preference.PreferencePage
      • setTableDescription

        protected void setTableDescription​(String tableDescription)
        Set the description of the table.
        Parameters:
        description - the description of the table, cannot be null
      • getNodeQualifier

        protected abstract String getNodeQualifier()
        Returns the Eclipse preferences node qualifier to use for preference storing.
        Returns:
        the Eclipse preferences node qualifier to use for preference storing, never null
      • createWizard

        protected abstract IRuntimeInstallationWizard createWizard()
                                                            throws org.eclipse.core.runtime.CoreException
        Create new wizard of 1C:Enterprise Runtime installation.
        Returns:
        new wizard of 1C:Enterprise Runtime installation, never null
        Throws:
        org.eclipse.core.runtime.CoreException - if creation fails
      • createHeader

        protected void createHeader​(org.eclipse.swt.widgets.Composite parent)
        Create header fot the property page.
        Parameters:
        parent - the parent composite, cannot be null
      • createTable

        protected TableViewer createTable​(org.eclipse.swt.widgets.Composite parent)
        Create table viewer with the list of 1C:Enterprise Runtime installations.
        Parameters:
        parent - the parent composite, cannot be null
        Returns:
        the created table viewer, never null
      • createColumns

        protected void createColumns​(TableViewer viewer)
        Creates columns for the viewer.
        Parameters:
        viewer - the page viewer, cannot be null
      • getRuntimeInstallationImage

        protected org.eclipse.swt.graphics.Image getRuntimeInstallationImage​(RuntimeInstallation element)
        Returns image for the table element.
        Parameters:
        element - the table element, cannot be null
        Returns:
        image for the table element or null if none
      • createColumn

        protected TableViewerColumn createColumn​(String text,
                                                 int width,
                                                 CellLabelProvider labelProvider)
        Creates column for the viewer with the specified settings.
        Parameters:
        text - the column label text, cannot be null
        width - the column width
        labelProvider - the column label provider, cannot be null
        Returns:
        created table column, never null
      • createButtons

        protected void createButtons​(org.eclipse.swt.widgets.Composite parent,
                                     TableViewer viewer)
        Create buttons for the viewer.
        Parameters:
        parent - the parent composite, cannot be null
        viewer - the page viewer, cannot be null
      • createButton

        protected org.eclipse.swt.widgets.Button createButton​(String text,
                                                              org.eclipse.swt.widgets.Composite parent,
                                                              org.eclipse.swt.events.SelectionListener listener)
        Creates push button with the specified settings.

        Shortcut for: createButton(text, parent, listener, true);

        Parameters:
        text - the button label text, cannot be null
        parent - the parent composite, cannot be null
        listener - the button selection listener, cannot be null
        Returns:
        created button instance, never null
      • createButton

        protected org.eclipse.swt.widgets.Button createButton​(String text,
                                                              org.eclipse.swt.widgets.Composite parent,
                                                              org.eclipse.swt.events.SelectionListener listener,
                                                              boolean enabled)
        Creates push button with the specified settings.
        Parameters:
        text - the button label text, cannot be null
        parent - the parent composite, cannot be null
        listener - the button selection listener, cannot be null
        enabled - whether the button is enabled by default
        Returns:
        created button instance, never null
      • getInput

        protected Collection<RuntimeInstallation> getInput()
        Returns the input 1C:Enterprise Runtime installations.
        Returns:
        the input 1C:Enterprise Runtime installations, never null, if input was set, can be empty
      • handleDoubleClick

        protected void handleDoubleClick​(DoubleClickEvent event)
        Handles double click event of the table.
        Parameters:
        event - the double click event, cannot be null
      • sortByName

        protected void sortByName​(TableViewer viewer)
        Sort table by the 1C:Enteprise Runtime installation name.
        Parameters:
        viewer - the page viewer, cannot be null
      • sortByVersion

        protected void sortByVersion​(TableViewer viewer)
        Sort table by the 1C:Enteprise Runtime installation version.
        Parameters:
        viewer - the page viewer, cannot be null
      • sortByLocation

        protected void sortByLocation​(TableViewer viewer)
        Sort table by the 1C:Enteprise Runtime installation location.
        Parameters:
        viewer - the page viewer, cannot be null
      • validate

        protected boolean validate​(RuntimeInstallation installation)
        Returns whether given 1C:Enterprise Runtime installation is supported by IDE 1C:Enterprise support.
        Parameters:
        installation - 1C:Enterprise Runtime installation to check support for, cannot be null
        Returns:
        whether given 1C:Enterprise Runtime installation is supported by IDE 1C:Enterprise support
      • add

        protected void add​(TableViewer viewer)
        Add a new 1C:Enterprise Runtime installation.
        Parameters:
        viewer - the page viewer, cannot be null
      • edit

        protected void edit​(RuntimeInstallation element,
                            TableViewer viewer)
        Edit the existing 1C:Enterprise Runtime installation.
        Parameters:
        element - the existing 1C:Enterprise Runtime installation to edit, cannot be null
        viewer - the page viewer, cannot be null
      • refresh

        protected void refresh​(TableViewer viewer)
        Searches 1C:Enterprise Runtime installations in the target folder and adds result to the viewer.
        Parameters:
        viewer - the page viewer, cannot be null
      • search

        protected void search​(TableViewer viewer)
        Searches 1C:Enterprise Runtime installations and adds result to the viewer.
        Parameters:
        viewer - the page viewer, cannot be null
      • remove

        protected void remove​(IStructuredSelection selection,
                              TableViewer viewer)
        Removes current selection from the viewer.
        Parameters:
        selection - the current selection to remove from the viewer, cannot be null
        viewer - the page viewer, cannot be null
      • getInputNames

        protected Collection<String> getInputNames​(TableViewer viewer)
        Returns names collection for the input 1C:Enterprise Runtime installations.
        Parameters:
        viewer - the page viewer, cannot be null
        Returns:
        names collection for the input 1C:Enterprise Runtime installations, never null