Class AbstractGrammerBasedEditDialog
- java.lang.Object
-
- org.eclipse.jface.window.Window
-
- org.eclipse.jface.dialogs.Dialog
-
- org.eclipse.jface.dialogs.TrayDialog
-
- org.eclipse.jface.dialogs.TitleAreaDialog
-
- org.palladiosimulator.editors.commons.dialogs.stoex.AbstractGrammerBasedEditDialog
-
- All Implemented Interfaces:
IShellProvider
- Direct Known Subclasses:
StochasticExpressionEditDialog
public abstract class AbstractGrammerBasedEditDialog extends TitleAreaDialog
The Class AbstractGrammerBasedEditDialog.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
Window.IExceptionHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected org.palladiosimulator.pcm.repository.Parameter[]
context
The context.static String
ERROR_TYPE
The Constant ERROR_TYPE.protected String
newText
The new text.static String
WARNING_TYPE
The Constant WARNING_TYPE.-
Fields inherited from class org.eclipse.jface.dialogs.TitleAreaDialog
DLG_IMG_TITLE_BANNER, DLG_IMG_TITLE_ERROR, INFO_MESSAGE, WARNING_MESSAGE
-
Fields inherited from class org.eclipse.jface.dialogs.Dialog
blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSIS
-
Fields inherited from class org.eclipse.jface.window.Window
CANCEL, OK, resizeHasOccurred
-
-
Constructor Summary
Constructors Constructor Description AbstractGrammerBasedEditDialog(Shell parent)
Constructor.AbstractGrammerBasedEditDialog(Shell parent, org.palladiosimulator.pcm.repository.Parameter[] context)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
cancelPressed()
protected void
configureShell(Shell newShell)
protected Control
createContents(Composite parent)
protected Control
createDialogArea(Composite parent)
protected SourceViewer
createSourceViewer(Composite parent, CompositeRuler ruler, int styles)
Creates the source viewer.protected abstract String
getInitialText()
Gets the initial text.protected abstract org.antlr.runtime.Lexer
getLexer(String text)
Gets the lexer.protected abstract Class<?>
getLexerClass()
Gets the lexer class.protected Object
getResult()
Gets the result.String
getResultText()
Gets the result text.protected abstract String
getTitle()
Gets the title.protected abstract ITokenMapper
getTokenMapper()
Gets the token mapper.protected abstract EObject
parse(org.antlr.runtime.Lexer lexer)
Parses the.protected void
parseInputAndRefreshAnnotations()
Parses the input and refresh annotations.void
setDisplayTitle(String newTitle)
Sets the display title.-
Methods inherited from class org.eclipse.jface.dialogs.TitleAreaDialog
getErrorMessage, getInitialSize, getMessage, getTitleArea, getTitleImageLabel, setErrorMessage, setMessage, setMessage, setTitle, setTitleAreaColor, setTitleImage
-
Methods inherited from class org.eclipse.jface.dialogs.TrayDialog
closeTray, createButtonBar, createHelpControl, getLayout, getTray, handleShellCloseEvent, isDialogHelpAvailable, isHelpAvailable, openTray, setDialogHelpAvailable, setHelpAvailable
-
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, buttonPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, createButtonsForButtonBar, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getOKButton, initializeBounds, initializeDialogUnits, isResizable, okPressed, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
-
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
-
-
-
-
Field Detail
-
ERROR_TYPE
public static final String ERROR_TYPE
The Constant ERROR_TYPE.- See Also:
- Constant Field Values
-
WARNING_TYPE
public static final String WARNING_TYPE
The Constant WARNING_TYPE.- See Also:
- Constant Field Values
-
newText
protected String newText
The new text.
-
context
protected org.palladiosimulator.pcm.repository.Parameter[] context
The context.
-
-
Constructor Detail
-
AbstractGrammerBasedEditDialog
public AbstractGrammerBasedEditDialog(Shell parent)
Constructor.- Parameters:
parent
- shell
-
AbstractGrammerBasedEditDialog
public AbstractGrammerBasedEditDialog(Shell parent, org.palladiosimulator.pcm.repository.Parameter[] context)
Constructor.- Parameters:
parent
- shellcontext
- - A list of parameters used in code completion
-
-
Method Detail
-
createSourceViewer
protected SourceViewer createSourceViewer(Composite parent, CompositeRuler ruler, int styles)
Creates the source viewer.- Parameters:
parent
- the parentruler
- the rulerstyles
- the styles- Returns:
- the source viewer
-
getInitialText
protected abstract String getInitialText()
Gets the initial text.- Returns:
- the initial text
-
setDisplayTitle
public void setDisplayTitle(String newTitle)
Sets the display title.- Parameters:
newTitle
- the new display title
-
cancelPressed
protected void cancelPressed()
- Overrides:
cancelPressed
in classDialog
-
createDialogArea
protected Control createDialogArea(Composite parent)
- Overrides:
createDialogArea
in classTitleAreaDialog
-
createContents
protected Control createContents(Composite parent)
- Overrides:
createContents
in classTitleAreaDialog
-
getTokenMapper
protected abstract ITokenMapper getTokenMapper()
Gets the token mapper.- Returns:
- the token mapper
-
getLexerClass
protected abstract Class<?> getLexerClass()
Gets the lexer class.- Returns:
- the lexer class
-
getTitle
protected abstract String getTitle()
Gets the title.- Returns:
- the title
-
parseInputAndRefreshAnnotations
protected void parseInputAndRefreshAnnotations()
Parses the input and refresh annotations.
-
getLexer
protected abstract org.antlr.runtime.Lexer getLexer(String text)
Gets the lexer.- Parameters:
text
- the text- Returns:
- the lexer
-
parse
protected abstract EObject parse(org.antlr.runtime.Lexer lexer) throws org.antlr.runtime.RecognitionException, StoExParserException
Parses the.- Parameters:
lexer
- the lexer- Returns:
- the e object
- Throws:
org.antlr.runtime.RecognitionException
- the recognition exceptionStoExParserException
- the sto ex parser exception
-
getResult
protected Object getResult()
Gets the result.- Returns:
- the result
-
configureShell
protected void configureShell(Shell newShell)
- Overrides:
configureShell
in classWindow
-
getResultText
public String getResultText()
Gets the result text.- Returns:
- the result text
-
-