Class AbstractRuntimeInstallationPreferencePage
- java.lang.Object
-
- org.eclipse.jface.dialogs.DialogPage
-
- org.eclipse.jface.preference.PreferencePage
-
- com._1c.g5.v8.dt.platform.services.ui.runtimes.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 asIRuntimeInstallationManager
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
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
HEIGHT_HINT
protected IRuntimeInstallationManager
runtimeInstallationManager
protected IRuntimeVersionSupport
runtimeVersionSupport
protected String
tableDescription
protected TableViewer
viewer
protected static int
WIDTH_HINT
-
Constructor Summary
Constructors Constructor Description AbstractRuntimeInstallationPreferencePage(IRuntimeInstallationManager runtimeInstallationManager, String title)
Constructor ofAbstractRuntimeInstallationPreferencePage
.
-
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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
HEIGHT_HINT
protected static final int HEIGHT_HINT
- See Also:
- Constant Field Values
-
WIDTH_HINT
protected static final int WIDTH_HINT
- See Also:
- Constant Field Values
-
runtimeVersionSupport
@Inject protected IRuntimeVersionSupport runtimeVersionSupport
-
runtimeInstallationManager
protected IRuntimeInstallationManager runtimeInstallationManager
-
viewer
protected TableViewer viewer
-
tableDescription
protected String tableDescription
-
-
Constructor Detail
-
AbstractRuntimeInstallationPreferencePage
public AbstractRuntimeInstallationPreferencePage(IRuntimeInstallationManager runtimeInstallationManager, String title)
Constructor ofAbstractRuntimeInstallationPreferencePage
.- Parameters:
runtimeInstallationManager
- 1C:Enterprise Runtime installation manager, that manages this page type of 1C:Enterprise Runtime installations, cannot benull
title
- the title of this preference page, cannot benull
-
-
Method Detail
-
init
public void init(org.eclipse.ui.IWorkbench workbench)
- Specified by:
init
in interfaceorg.eclipse.ui.IWorkbenchPreferencePage
-
createContents
protected org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite parent)
- Specified by:
createContents
in classorg.eclipse.jface.preference.PreferencePage
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceorg.eclipse.jface.dialogs.IDialogPage
- Overrides:
dispose
in classorg.eclipse.jface.dialogs.DialogPage
-
installationsAdded
public void installationsAdded(Collection<RuntimeInstallation> installations)
Description copied from interface:IRuntimeInstallationChangeListener
Notifies that new instances 1C:Enetrprise runtime installation was added and persisted.- Specified by:
installationsAdded
in interfaceIRuntimeInstallationChangeListener
- Parameters:
installations
- a collection of added 1C:Enetrprise runtime installations, cannot benull
-
installationsRemoved
public void installationsRemoved(Collection<RuntimeInstallation> installations)
Description copied from interface:IRuntimeInstallationChangeListener
Notifies that instances 1C:Enetrprise runtime installation was removed.- Specified by:
installationsRemoved
in interfaceIRuntimeInstallationChangeListener
- Parameters:
installations
- a collection of removed 1C:Enetrprise runtime installations, cannot benull
-
performOk
public boolean performOk()
- Specified by:
performOk
in interfaceorg.eclipse.jface.preference.IPreferencePage
- Overrides:
performOk
in classorg.eclipse.jface.preference.PreferencePage
-
setTableDescription
protected void setTableDescription(String tableDescription)
Set the description of the table.- Parameters:
description
- the description of the table, cannot benull
-
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 benull
-
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 benull
- Returns:
- the created table viewer, never
null
-
createColumns
protected void createColumns(TableViewer viewer)
Creates columns for the viewer.- Parameters:
viewer
- the page viewer, cannot benull
-
getRuntimeInstallationImage
protected org.eclipse.swt.graphics.Image getRuntimeInstallationImage(RuntimeInstallation element)
Returns image for the table element.- Parameters:
element
- the table element, cannot benull
- 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 benull
width
- the column widthlabelProvider
- the column label provider, cannot benull
- 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 benull
viewer
- the page viewer, cannot benull
-
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 benull
parent
- the parent composite, cannot benull
listener
- the button selection listener, cannot benull
- 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 benull
parent
- the parent composite, cannot benull
listener
- the button selection listener, cannot benull
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 benull
-
sortByName
protected void sortByName(TableViewer viewer)
Sort table by the 1C:Enteprise Runtime installation name.- Parameters:
viewer
- the page viewer, cannot benull
-
sortByVersion
protected void sortByVersion(TableViewer viewer)
Sort table by the 1C:Enteprise Runtime installation version.- Parameters:
viewer
- the page viewer, cannot benull
-
sortByLocation
protected void sortByLocation(TableViewer viewer)
Sort table by the 1C:Enteprise Runtime installation location.- Parameters:
viewer
- the page viewer, cannot benull
-
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 benull
- 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 benull
-
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 benull
viewer
- the page viewer, cannot benull
-
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 benull
-
search
protected void search(TableViewer viewer)
Searches 1C:Enterprise Runtime installations and adds result to the viewer.- Parameters:
viewer
- the page viewer, cannot benull
-
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 benull
viewer
- the page viewer, cannot benull
-
getInputNames
protected Collection<String> getInputNames(TableViewer viewer)
Returns names collection for the input 1C:Enterprise Runtime installations.- Parameters:
viewer
- the page viewer, cannot benull
- Returns:
- names collection for the input 1C:Enterprise Runtime installations,
never
null
-
-