Class InstantiatorConfigPage
- java.lang.Object
-
- org.eclipse.swt.widgets.Widget
-
- org.eclipse.swt.widgets.Control
-
- org.eclipse.swt.widgets.Scrollable
-
- org.eclipse.swt.widgets.Composite
-
- net.ssehub.easy.producer.ui.productline_editor.AbstractEASyEditorPage
-
- net.ssehub.easy.producer.ui.productline_editor.instantiator.InstantiatorConfigPage
-
- All Implemented Interfaces:
IEASyEditorPage,org.eclipse.jface.dialogs.IPageChangedListener,org.eclipse.swt.graphics.Drawable,org.eclipse.ui.IPropertyListener
public class InstantiatorConfigPage extends AbstractEASyEditorPage
Creates the editor page for linking files with a file instantiator.
This page allows the user to:- Add and delete instantiator engines
- See configured instantiator engines
- Change the files bound to an instantiator if that instantiator had been created in this ProductLineProject
- See informations about the instantiator that is currently shown
- See the filetype an instantiator will handle, after clicking save, if there are multiple filetypes to be handled, the type will be shown as "various"
- To check for files that might be instantiated by multiple instantiator engines
- Author:
- gawenda, El-Sharkawy
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classInstantiatorConfigPage.TreeNodeInsertionSelectionAdapterA selection adapter checking for supported insertion first.private classInstantiatorConfigPage.TreeSelectionListenerReacts on general tree selections and enables / disables buttons.
-
Field Summary
Fields Modifier and Type Field Description private org.eclipse.swt.widgets.ButtonaddCopyRuleButtonprivate org.eclipse.swt.widgets.ButtonaddRuleButtonprivate org.eclipse.swt.widgets.ButtonaddSystemCallButtonprivate org.eclipse.swt.widgets.ButtondeleteElementButtonprivate org.eclipse.swt.widgets.ButtoninsertInstantiatorButtonprivate org.eclipse.jface.viewers.TreeViewerruleTree
-
Constructor Summary
Constructors Constructor Description InstantiatorConfigPage(org.eclipse.swt.widgets.Composite parent, ProductLineProject plp)Sole constructor for this class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Optional method for specifying an on-closed action.private voidcreateAddInstantiatorButton(org.eclipse.swt.widgets.Composite parent)Creates an "add instantiator" button.private voidcreateAddRuleButton(org.eclipse.swt.widgets.Composite parent)Creates an "add rule" button.private voidcreateAddSystemCallButton(org.eclipse.swt.widgets.Composite parent)Creates a "system call" button.private voidcreateButtons(org.eclipse.swt.widgets.Composite parent)Creates the buttons.private voidcreateContent(org.eclipse.swt.widgets.Composite parent)Creates the main content with the list of instantiators, a tree for a chosen instantiator, and a list of multiple instantiated files, which is only shown, if the user decides to have them calculated.private voidcreateCopyRuleButton(org.eclipse.swt.widgets.Composite parent)Creates a "copy rule" button.private voidcreateDeleteElementButton(org.eclipse.swt.widgets.Composite parent)Creates a "delete element" button.private TreeNode[]createRuleTree()Creates the rule tree for the tree viewer.java.lang.StringgetPageText()Returns the text label for the editor page.private java.lang.StringgetScriptSignature()Returns the actual script signature.private TreeNodegetSelected(org.eclipse.jface.viewers.ISelection selection)Returns the selected tree node.protected voidpageActivated()This method will be called, when this editor page becomes active.voidpropertyChanged(java.lang.Object source, int propId)voidrefresh()Refreshes the shown content of the current project.private static voidsetEnabled(org.eclipse.swt.widgets.Button button, TreeNode node, TreeNode.Insertable insertable)Changes the enabled state ofbuttondependent on the selectednodeand the intendedinsertable.-
Methods inherited from class net.ssehub.easy.producer.ui.productline_editor.AbstractEASyEditorPage
createForm, createSection, createSection, dispose, doSave, getContentPane, getProductLineProject, getToolkit, pageChanged, register, setDirty, setFocus
-
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setLayout, setLayoutDeferred, setTabList
-
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
-
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
-
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.ssehub.easy.producer.ui.productline_editor.IEASyEditorPage
getDisplay, isDisposed
-
-
-
-
Field Detail
-
addRuleButton
private org.eclipse.swt.widgets.Button addRuleButton
-
addCopyRuleButton
private org.eclipse.swt.widgets.Button addCopyRuleButton
-
addSystemCallButton
private org.eclipse.swt.widgets.Button addSystemCallButton
-
insertInstantiatorButton
private org.eclipse.swt.widgets.Button insertInstantiatorButton
-
deleteElementButton
private org.eclipse.swt.widgets.Button deleteElementButton
-
ruleTree
private org.eclipse.jface.viewers.TreeViewer ruleTree
-
-
Constructor Detail
-
InstantiatorConfigPage
public InstantiatorConfigPage(org.eclipse.swt.widgets.Composite parent, ProductLineProject plp)Sole constructor for this class.- Parameters:
parent- the parent controlplp- The ProductLineProject which will be edited
-
-
Method Detail
-
createButtons
private void createButtons(org.eclipse.swt.widgets.Composite parent)
Creates the buttons.- Parameters:
parent- the parent composite
-
createAddRuleButton
private void createAddRuleButton(org.eclipse.swt.widgets.Composite parent)
Creates an "add rule" button.- Parameters:
parent- the parent composite
-
createCopyRuleButton
private void createCopyRuleButton(org.eclipse.swt.widgets.Composite parent)
Creates a "copy rule" button.- Parameters:
parent- the parent composite
-
createAddSystemCallButton
private void createAddSystemCallButton(org.eclipse.swt.widgets.Composite parent)
Creates a "system call" button.- Parameters:
parent- the parent composite
-
createAddInstantiatorButton
private void createAddInstantiatorButton(org.eclipse.swt.widgets.Composite parent)
Creates an "add instantiator" button.- Parameters:
parent- the parent composite
-
createDeleteElementButton
private void createDeleteElementButton(org.eclipse.swt.widgets.Composite parent)
Creates a "delete element" button.- Parameters:
parent- the parent composite
-
createContent
private void createContent(org.eclipse.swt.widgets.Composite parent)
Creates the main content with the list of instantiators, a tree for a chosen instantiator, and a list of multiple instantiated files, which is only shown, if the user decides to have them calculated.- Parameters:
parent- the parent composite
-
getScriptSignature
private java.lang.String getScriptSignature()
Returns the actual script signature.- Returns:
- the actual script signature
-
setEnabled
private static void setEnabled(org.eclipse.swt.widgets.Button button, TreeNode node, TreeNode.Insertable insertable)Changes the enabled state ofbuttondependent on the selectednodeand the intendedinsertable.- Parameters:
button- the buttonnode- the selected node (may be null)insertable- the insertable
-
getSelected
private TreeNode getSelected(org.eclipse.jface.viewers.ISelection selection)
Returns the selected tree node.- Parameters:
selection- the current selection- Returns:
- the selected tree node (may be null if none is selected)
-
refresh
public void refresh()
Description copied from interface:IEASyEditorPageRefreshes the shown content of the current project. This method should be calles if the contant inside the editor has been changed and should also affect other editor parts.
-
createRuleTree
private TreeNode[] createRuleTree()
Creates the rule tree for the tree viewer.- Returns:
- the rule tree
-
getPageText
public final java.lang.String getPageText()
Description copied from interface:IEASyEditorPageReturns the text label for the editor page. This is for creating labels/tabs in an editor.- Returns:
- The text label for the editor page (must not be null).
-
pageActivated
protected void pageActivated()
Description copied from class:AbstractEASyEditorPageThis method will be called, when this editor page becomes active.- Specified by:
pageActivatedin classAbstractEASyEditorPage
-
propertyChanged
public void propertyChanged(java.lang.Object source, int propId)
-
close
public void close()
Description copied from class:AbstractEASyEditorPageOptional method for specifying an on-closed action.- Specified by:
closein classAbstractEASyEditorPage
-
-