Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
af3
kernel
Commits
b02c6515
Commit
b02c6515
authored
11 years ago
by
Cheng Zhang
Browse files
Options
Downloads
Patches
Plain Diff
Add guard check in automaton transition segment properties
refs 1758
parent
98a4deb5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dialog/CheckBoxTreeDialog.java
+110
-0
110 additions, 0 deletions
...rg/fortiss/tooling/base/ui/dialog/CheckBoxTreeDialog.java
with
110 additions
and
0 deletions
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dialog/CheckBoxTreeDialog.java
0 → 100644
+
110
−
0
View file @
b02c6515
/*--------------------------------------------------------------------------+
$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
| |
| Copyright 2013 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package
org.fortiss.tooling.base.ui.dialog
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.conqat.ide.commons.ui.jface.TreeContentProviderBase
;
import
org.eclipse.jface.dialogs.TitleAreaDialog
;
import
org.eclipse.jface.viewers.CheckStateChangedEvent
;
import
org.eclipse.jface.viewers.CheckboxTreeViewer
;
import
org.eclipse.jface.viewers.ICheckStateListener
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.layout.GridData
;
import
org.eclipse.swt.widgets.Composite
;
import
org.eclipse.swt.widgets.Control
;
import
org.eclipse.swt.widgets.Shell
;
/**
*
* @author czhang
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating RED Hash:
*/
public
class
CheckBoxTreeDialog
extends
TitleAreaDialog
{
/** stores checkboxTreeViewer */
private
CheckboxTreeViewer
checkboxTreeViewer
;
/** stores rootElements */
private
ArrayList
<
Object
>
rootElements
;
/** stores selected objects */
private
Object
[]
selectedObjects
;
/** stores title */
private
String
title
;
/** stores message */
private
String
message
;
/** Constructor. */
public
CheckBoxTreeDialog
(
Shell
parentShell
,
List
<?>
roots
,
String
title
,
String
message
)
{
super
(
parentShell
);
if
(
roots
==
null
)
{
rootElements
=
new
ArrayList
<
Object
>();
}
else
{
rootElements
=
new
ArrayList
<
Object
>(
roots
);
}
this
.
title
=
title
;
this
.
message
=
message
;
setBlockOnOpen
(
true
);
}
/** {@inheritDoc} */
@Override
protected
Control
createDialogArea
(
Composite
parent
)
{
Composite
container
=
(
Composite
)
super
.
createDialogArea
(
parent
);
super
.
setTitle
(
title
);
super
.
setMessage
(
message
);
checkboxTreeViewer
=
new
CheckboxTreeViewer
(
container
,
SWT
.
NONE
);
checkboxTreeViewer
.
getControl
().
setLayoutData
(
new
GridData
(
GridData
.
FILL_BOTH
));
checkboxTreeViewer
.
setContentProvider
(
new
TreeContentProviderBase
()
{
@Override
public
Object
[]
getChildren
(
Object
parentElement
)
{
if
(
parentElement
==
rootElements
)
{
return
rootElements
.
toArray
();
}
return
null
;
}
});
checkboxTreeViewer
.
setInput
(
rootElements
);
checkboxTreeViewer
.
addCheckStateListener
(
new
ICheckStateListener
()
{
@Override
public
void
checkStateChanged
(
CheckStateChangedEvent
event
)
{
setSelectedObjects
();
}
});
return
container
;
}
/** Gets selectedObjects. */
public
Object
[]
getSelectedObjects
()
{
return
selectedObjects
;
}
/** Sets selectedObjects. */
private
void
setSelectedObjects
()
{
selectedObjects
=
checkboxTreeViewer
.
getCheckedElements
();
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment