Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AF3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
257
Issues
257
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
af3
AF3
Commits
0dcbf834
Commit
0dcbf834
authored
Mar 31, 2020
by
Alexander Diewald
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '3961' into 'master'
3961 See merge request af3/af3!310
parents
5e8c466a
86827aa7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
6 deletions
+43
-6
org.fortiss.af3.state.ui/src/org/fortiss/af3/state/ui/editor/fx/.ratings
....state.ui/src/org/fortiss/af3/state/ui/editor/fx/.ratings
+1
-1
org.fortiss.af3.state.ui/src/org/fortiss/af3/state/ui/editor/fx/DataStateFXEditorBase.java
...fortiss/af3/state/ui/editor/fx/DataStateFXEditorBase.java
+42
-5
No files found.
org.fortiss.af3.state.ui/src/org/fortiss/af3/state/ui/editor/fx/.ratings
View file @
0dcbf834
DataStateFXEditor.java e64fcec84ea83e5ba99e48a6825063471e9ea70d GREEN
DataStateFXEditor.java e64fcec84ea83e5ba99e48a6825063471e9ea70d GREEN
DataStateFXEditorBase.java
0bec3533962ebcd7326f6597d598a5ff7c8ba8e6
GREEN
DataStateFXEditorBase.java
83655742fdcfdade31eabd7deafa88862f28ba22
GREEN
DataStateFXEditorBinding.java 46ab36b197a6fca102a5e2d75aa24b1fbba26b89 GREEN
DataStateFXEditorBinding.java 46ab36b197a6fca102a5e2d75aa24b1fbba26b89 GREEN
DataStateFXEditorContentProvider.java 324cd24e2219ba2cf360b0f82e3628ca1b5dabba GREEN
DataStateFXEditorContentProvider.java 324cd24e2219ba2cf360b0f82e3628ca1b5dabba GREEN
DataStateFXEditorUIProvider.java 4993d4a6685b7738dd28a7a55177ab43fe81fc53 GREEN
DataStateFXEditorUIProvider.java 4993d4a6685b7738dd28a7a55177ab43fe81fc53 GREEN
...
...
org.fortiss.af3.state.ui/src/org/fortiss/af3/state/ui/editor/fx/DataStateFXEditorBase.java
View file @
0dcbf834
...
@@ -19,17 +19,21 @@ import static org.eclipse.emf.ecore.util.EcoreUtil.delete;
...
@@ -19,17 +19,21 @@ import static org.eclipse.emf.ecore.util.EcoreUtil.delete;
import
static
org
.
fortiss
.
af3
.
component
.
utils
.
BehaviorModelElementFactory
.
createDataStateVariable
;
import
static
org
.
fortiss
.
af3
.
component
.
utils
.
BehaviorModelElementFactory
.
createDataStateVariable
;
import
static
org
.
fortiss
.
af3
.
expression
.
utils
.
ExpressionModelElementFactory
.
intConst
;
import
static
org
.
fortiss
.
af3
.
expression
.
utils
.
ExpressionModelElementFactory
.
intConst
;
import
static
org
.
fortiss
.
af3
.
expression
.
utils
.
ExpressionModelElementFactory
.
intType
;
import
static
org
.
fortiss
.
af3
.
expression
.
utils
.
ExpressionModelElementFactory
.
intType
;
import
static
org
.
fortiss
.
tooling
.
common
.
ui
.
javafx
.
util
.
GraphicUtils
.
getFXImage
;
import
java.util.List
;
import
java.util.List
;
import
org.eclipse.core.runtime.IStatus
;
import
org.eclipse.emf.common.notify.Notification
;
import
org.eclipse.emf.common.notify.Notification
;
import
org.eclipse.emf.ecore.EObject
;
import
org.eclipse.emf.ecore.EObject
;
import
org.fortiss.af3.component.model.behavior.common.DataStateVariable
;
import
org.fortiss.af3.component.model.behavior.common.DataStateVariable
;
import
org.fortiss.af3.component.model.behavior.common.IDataStateVariableProvider
;
import
org.fortiss.af3.component.model.behavior.common.IDataStateVariableProvider
;
import
org.fortiss.af3.expression.ui.databinding.validate.StringToTypeValidator
;
import
org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeContentProviderBase
;
import
org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeContentProviderBase
;
import
org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeTableViewer
;
import
org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeTableViewer
;
import
org.fortiss.tooling.kernel.extension.data.ITopLevelElement
;
import
org.fortiss.tooling.kernel.extension.data.ITopLevelElement
;
import
org.fortiss.tooling.kernel.service.IPersistencyService
;
import
org.fortiss.tooling.kernel.service.IPersistencyService
;
import
org.fortiss.tooling.kernel.ui.ToolingKernelUIActivator
;
import
org.fortiss.tooling.kernel.ui.extension.base.FXEditorBase
;
import
org.fortiss.tooling.kernel.ui.extension.base.FXEditorBase
;
import
org.fortiss.tooling.kernel.utils.KernelServiceBasedModelListenerBase
;
import
org.fortiss.tooling.kernel.utils.KernelServiceBasedModelListenerBase
;
...
@@ -37,6 +41,10 @@ import javafx.event.ActionEvent;
...
@@ -37,6 +41,10 @@ import javafx.event.ActionEvent;
import
javafx.event.EventHandler
;
import
javafx.event.EventHandler
;
import
javafx.scene.Parent
;
import
javafx.scene.Parent
;
import
javafx.scene.control.Button
;
import
javafx.scene.control.Button
;
import
javafx.scene.control.Label
;
import
javafx.scene.image.ImageView
;
import
javafx.scene.input.KeyCode
;
import
javafx.scene.input.KeyEvent
;
import
javafx.scene.layout.BorderPane
;
import
javafx.scene.layout.BorderPane
;
import
javafx.scene.layout.VBox
;
import
javafx.scene.layout.VBox
;
...
@@ -47,18 +55,18 @@ import javafx.scene.layout.VBox;
...
@@ -47,18 +55,18 @@ import javafx.scene.layout.VBox;
*/
*/
public
abstract
class
DataStateFXEditorBase
<
T
extends
IDataStateVariableProvider
>
public
abstract
class
DataStateFXEditorBase
<
T
extends
IDataStateVariableProvider
>
extends
FXEditorBase
<
T
>
{
extends
FXEditorBase
<
T
>
{
/** The description. */
private
static
final
String
DESCRIPTION
=
"Define data state variables with the table below:"
;
/** The tree-table viewer. */
/** The tree-table viewer. */
private
DynamicTreeTableViewer
<
EObject
>
viewer
;
private
DynamicTreeTableViewer
<
EObject
>
viewer
;
/** The remove button. */
/** The remove button. */
private
Button
removeButton
;
private
Button
removeButton
;
/** The add button. */
/** The add button. */
private
Button
addButton
;
private
Button
addButton
;
/** The model listener. */
/** The model listener. */
private
KernelServiceBasedModelListenerBase
<
IDataStateVariableProvider
>
modelListener
;
private
KernelServiceBasedModelListenerBase
<
IDataStateVariableProvider
>
modelListener
;
/** The description / error label. */
private
Label
descriptionError
;
/** {@inheritDoc} */
/** {@inheritDoc} */
@Override
@Override
...
@@ -76,10 +84,39 @@ public abstract class DataStateFXEditorBase<T extends IDataStateVariableProvider
...
@@ -76,10 +84,39 @@ public abstract class DataStateFXEditorBase<T extends IDataStateVariableProvider
DynamicTreeContentProviderBase
<
EObject
>
contentProvider
=
DynamicTreeContentProviderBase
<
EObject
>
contentProvider
=
new
DataStateFXEditorContentProvider
();
new
DataStateFXEditorContentProvider
();
DataStateFXEditorUIProvider
uiProvider
=
new
DataStateFXEditorUIProvider
();
DataStateFXEditorUIProvider
uiProvider
=
new
DataStateFXEditorUIProvider
()
{
@Override
public
void
validateOnKeyReleased
(
KeyEvent
event
,
int
colIndex
,
EObject
item
,
String
text
)
{
String
message
=
DataStateFXEditorBase
.
DESCRIPTION
;
ImageView
icon
=
null
;
if
(
event
.
getCode
()
!=
KeyCode
.
ESCAPE
&&
colIndex
==
1
)
{
StringToTypeValidator
validator
=
new
StringToTypeValidator
(
item
);
IStatus
status
=
validator
.
validate
(
text
);
if
(!
status
.
isOK
())
{
message
=
status
.
getMessage
();
icon
=
new
ImageView
(
getFXImage
(
ToolingKernelUIActivator
.
PLUGIN_ID
,
"/icons/error.png"
));
}
}
descriptionError
.
setText
(
message
);
descriptionError
.
setGraphic
(
icon
);
event
.
consume
();
}
/** {@inheritDoc} */
@Override
public
void
validateOnCancelEdit
(
int
colIndex
,
EObject
item
)
{
descriptionError
.
setText
(
DataStateFXEditorBase
.
DESCRIPTION
);
descriptionError
.
setGraphic
(
null
);
}
};
// Add main pane with the table.
// Add main pane with the table.
BorderPane
mainPane
=
new
BorderPane
();
BorderPane
mainPane
=
new
BorderPane
();
descriptionError
=
new
Label
(
DESCRIPTION
);
mainPane
.
setTop
(
descriptionError
);
viewer
=
new
DynamicTreeTableViewer
<>(
provider
,
false
,
2
,
contentProvider
,
uiProvider
);
viewer
=
new
DynamicTreeTableViewer
<>(
provider
,
false
,
2
,
contentProvider
,
uiProvider
);
viewer
.
addColumn
(
"Variable"
,
160
);
viewer
.
addColumn
(
"Variable"
,
160
);
viewer
.
addColumn
(
"Type"
,
160
);
viewer
.
addColumn
(
"Type"
,
160
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment