Class ConfigurationHeaderMenu
- 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.AbstractHeaderMenu
-
- net.ssehub.easy.producer.ui.productline_editor.configuration.AbstractConfigMenu
-
- net.ssehub.easy.producer.ui.productline_editor.configuration.ConfigurationHeaderMenu
-
- All Implemented Interfaces:
IProductLineProjectListener,IVilExecutionListener,IConfigurationChangeListener,org.eclipse.swt.graphics.Drawable
public class ConfigurationHeaderMenu extends AbstractConfigMenu implements IProductLineProjectListener, IVilExecutionListener
Header menu holding buttons for the product configuration editor page.
This buttons allow the user to:- Validate made Decisions
- Transform the product
- Author:
- EL-Sharkawy
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classConfigurationHeaderMenu.PropagateListenerIReasonerListenerfor propagating values.private classConfigurationHeaderMenu.ReasoningPreFreezeListenerIReasonerListener, for a reasoning which is executed automatically before freezing the configuration.private classConfigurationHeaderMenu.ValidateConfigListenerIReasonerListenerfor validating the configuration.
-
Field Summary
Fields Modifier and Type Field Description private org.eclipse.swt.widgets.ButtonbtnAbortInstantiationprivate org.eclipse.swt.widgets.ButtonbtnFreezeAllprivate org.eclipse.swt.widgets.ButtonbtnInstantiateprivate org.eclipse.swt.widgets.ButtonbtnPropagateCreated for demonstrating only.private static org.eclipse.swt.graphics.ImageIMG_ABORTprivate static org.eclipse.swt.graphics.ImageIMG_FREEZEprivate static org.eclipse.swt.graphics.ImageIMG_INSTANTIATEprivate static org.eclipse.swt.graphics.ImageIMG_UNDOprivate static org.eclipse.swt.graphics.ImageIMG_VALIDATEprivate static EASyLoggerFactory.EASyLoggerLOGGERprivate AbstractEASyEditorPageparentPageprivate org.eclipse.swt.widgets.ButtonundoButtonprivate org.eclipse.swt.widgets.ButtonvalidateProductButton
-
Constructor Summary
Constructors Constructor Description ConfigurationHeaderMenu(org.eclipse.swt.widgets.Composite parent, ProductLineProject plp, AbstractEASyEditorPage parentPage)Sole constructor for this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildScriptChanged()This method is called, if thePLPInfo.getBuildScript()was changed.voidconfigurationPulled()This method is called, if the configuration is pulled.private voidcreateAbortInstantiationButton()Creates the transform button.private voidcreateButtons()Creates the two buttons.private voidcreateFreezeButton()Tests whether the model is valid and freezes all not frozen variables.private voidcreateInstantiateButton()Creates the transform button.private voidcreatePropagateButton()Creates Propagation button.private voidcreateReasoningProgressObserver(ReasoningOperation operation, IReasonerListener listener)Creates a reasoning progress observer based onAbstractHeaderMenu.getProductLineProject().private voidcreateUndoButton()Creates revert button.private voidcreateValidateButton()Creates validation button.private voiddisplayWarnings(ReasoningResult result)Method for preparing a RasonerResult for showing a warnings dialog.voiddispose()voidprojectClosed()This method is called, if the relatedPLPInfois closed.voidrevalidateButtons()Enables or disables the buttons, depending on whether a the related action is possible.private voidsetInstantiationListeners()Creates a listener for the instantiation and abort button and add them the buttons.private voidsetValidateListener()Creates a listener for the validation button and add it to the button.voidvilExecutionAborted(PLPInfo plp, VilException exc)VIL execution (instantiation) was aborted through an error.voidvilExecutionFinished(PLPInfo plp, boolean instantiationSuccessfull)VIL execution (instantiation) was finished.-
Methods inherited from class net.ssehub.easy.producer.ui.productline_editor.configuration.AbstractConfigMenu
clearErrorMessages, configurationRefreshed, getConfigContainer, itemChanged, setErrorMessages, setFilter, setGUIConfiguration, stateChanged
-
Methods inherited from class net.ssehub.easy.producer.ui.productline_editor.AbstractHeaderMenu
close, getProductLineProject, setLayout
-
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, setFocus, 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
-
-
-
-
Field Detail
-
LOGGER
private static final EASyLoggerFactory.EASyLogger LOGGER
-
IMG_INSTANTIATE
private static final org.eclipse.swt.graphics.Image IMG_INSTANTIATE
-
IMG_VALIDATE
private static final org.eclipse.swt.graphics.Image IMG_VALIDATE
-
IMG_FREEZE
private static final org.eclipse.swt.graphics.Image IMG_FREEZE
-
IMG_UNDO
private static final org.eclipse.swt.graphics.Image IMG_UNDO
-
IMG_ABORT
private static final org.eclipse.swt.graphics.Image IMG_ABORT
-
validateProductButton
private org.eclipse.swt.widgets.Button validateProductButton
-
undoButton
private org.eclipse.swt.widgets.Button undoButton
-
btnInstantiate
private org.eclipse.swt.widgets.Button btnInstantiate
-
btnFreezeAll
private org.eclipse.swt.widgets.Button btnFreezeAll
-
btnAbortInstantiation
private org.eclipse.swt.widgets.Button btnAbortInstantiation
-
btnPropagate
private org.eclipse.swt.widgets.Button btnPropagate
Created for demonstrating only. Please remove this after Dry-Run-Review.
-
parentPage
private AbstractEASyEditorPage parentPage
-
-
Constructor Detail
-
ConfigurationHeaderMenu
public ConfigurationHeaderMenu(org.eclipse.swt.widgets.Composite parent, ProductLineProject plp, AbstractEASyEditorPage parentPage)Sole constructor for this class.- Parameters:
parent- the parent control (must not be null).plp- Current configured project holding the configuration (must not be null).parentPage- The page bearing this menu item (must not be null).
-
-
Method Detail
-
createButtons
private void createButtons()
Creates the two buttons.
-
createPropagateButton
private void createPropagateButton()
Creates Propagation button. TODO: Remove this button after Dry-Run-Review.
-
createFreezeButton
private void createFreezeButton()
Tests whether the model is valid and freezes all not frozen variables.
-
createReasoningProgressObserver
private void createReasoningProgressObserver(ReasoningOperation operation, IReasonerListener listener)
Creates a reasoning progress observer based onAbstractHeaderMenu.getProductLineProject().- Parameters:
operation- the desired reasoning operationlistener- A listener which will be called after the reasoning has been finished. Can be null, if no action shall be executed after the reasoning is finished.
-
createUndoButton
private void createUndoButton()
Creates revert button.
-
createValidateButton
private void createValidateButton()
Creates validation button.
-
setValidateListener
private void setValidateListener()
Creates a listener for the validation button and add it to the button.
-
createInstantiateButton
private void createInstantiateButton()
Creates the transform button.
-
createAbortInstantiationButton
private void createAbortInstantiationButton()
Creates the transform button.
-
setInstantiationListeners
private void setInstantiationListeners()
Creates a listener for the instantiation and abort button and add them the buttons.
-
displayWarnings
private void displayWarnings(ReasoningResult result)
Method for preparing a RasonerResult for showing a warnings dialog. It filters only warnings out of the RasonerResult and creates a dialog which displays the warnings.- Parameters:
result- The result of an reasoning step, may containing warnings.
-
revalidateButtons
public void revalidateButtons()
Description copied from class:AbstractHeaderMenuEnables or disables the buttons, depending on whether a the related action is possible. This check should be performed whenever the page becomes activated.- Specified by:
revalidateButtonsin classAbstractHeaderMenu
-
configurationPulled
public void configurationPulled()
Description copied from interface:IProductLineProjectListenerThis method is called, if the configuration is pulled.- Specified by:
configurationPulledin interfaceIProductLineProjectListener
-
dispose
public void dispose()
- Overrides:
disposein classorg.eclipse.swt.widgets.Widget
-
projectClosed
public void projectClosed()
Description copied from interface:IProductLineProjectListenerThis method is called, if the relatedPLPInfois closed.- Specified by:
projectClosedin interfaceIProductLineProjectListener
-
buildScriptChanged
public void buildScriptChanged()
Description copied from interface:IProductLineProjectListenerThis method is called, if thePLPInfo.getBuildScript()was changed.- Specified by:
buildScriptChangedin interfaceIProductLineProjectListener
-
vilExecutionAborted
public void vilExecutionAborted(PLPInfo plp, VilException exc)
Description copied from interface:IVilExecutionListenerVIL execution (instantiation) was aborted through an error.- Specified by:
vilExecutionAbortedin interfaceIVilExecutionListener- Parameters:
plp- ThePLPInfo, which should be instantiated and is the source for this error.exc- The error which lead to the abortion.
-
vilExecutionFinished
public void vilExecutionFinished(PLPInfo plp, boolean instantiationSuccessfull)
Description copied from interface:IVilExecutionListenerVIL execution (instantiation) was finished. This is usually the case if script execution reached the end of the script, but may also be the case if the user aborted the instantiation.- Specified by:
vilExecutionFinishedin interfaceIVilExecutionListener- Parameters:
plp- ThePLPInfo, which was be instantiatedinstantiationSuccessfull- trueinstantiation finished successfully, false instantiation was aborted, e.g., by the user.
-
-