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
1b57a7d8
Commit
1b57a7d8
authored
12 years ago
by
Chen Wenwen
Browse files
Options
Downloads
Patches
Plain Diff
refs 790
parent
de4f5056
No related branches found
No related tags found
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/ElementTreeMultiSelectEditableDialog.java
+31
-3
31 additions, 3 deletions
.../base/ui/dialog/ElementTreeMultiSelectEditableDialog.java
with
31 additions
and
3 deletions
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dialog/ElementTreeMultiSelectEditableDialog.java
+
31
−
3
View file @
1b57a7d8
...
@@ -59,7 +59,7 @@ import org.eclipse.swt.widgets.Shell;
...
@@ -59,7 +59,7 @@ import org.eclipse.swt.widgets.Shell;
* @author mou
* @author mou
* @author $Author: ratiu $
* @author $Author: ratiu $
* @version $Rev: 5186 $
* @version $Rev: 5186 $
* @ConQAT.Rating YELLOW Hash:
392450008DED6743B21318ECC5A6994D
* @ConQAT.Rating YELLOW Hash:
0B27319B1ADBE1AA96C2F17ED686F467
*/
*/
public
class
ElementTreeMultiSelectEditableDialog
extends
TitleAreaDialog
{
public
class
ElementTreeMultiSelectEditableDialog
extends
TitleAreaDialog
{
...
@@ -360,7 +360,10 @@ public class ElementTreeMultiSelectEditableDialog extends TitleAreaDialog {
...
@@ -360,7 +360,10 @@ public class ElementTreeMultiSelectEditableDialog extends TitleAreaDialog {
return
;
return
;
for
(
TreePath
path
:
selection
.
getPaths
())
{
for
(
TreePath
path
:
selection
.
getPaths
())
{
Object
convertedSelection
=
selectConverter
(
path
.
getLastSegment
());
if
(!
canSelect
(
path
.
getLastSegment
()))
{
continue
;
}
Object
convertedSelection
=
selectConverterAction
(
path
.
getLastSegment
());
if
(
convertedSelection
==
null
||
selectedElements
.
contains
(
convertedSelection
))
if
(
convertedSelection
==
null
||
selectedElements
.
contains
(
convertedSelection
))
continue
;
continue
;
if
(
acceptElement
(
path
.
getLastSegment
()))
{
if
(
acceptElement
(
path
.
getLastSegment
()))
{
...
@@ -385,6 +388,9 @@ public class ElementTreeMultiSelectEditableDialog extends TitleAreaDialog {
...
@@ -385,6 +388,9 @@ public class ElementTreeMultiSelectEditableDialog extends TitleAreaDialog {
return
;
return
;
for
(
TreePath
path
:
selection
.
getPaths
())
{
for
(
TreePath
path
:
selection
.
getPaths
())
{
if
(!
canDeselect
(
path
.
getLastSegment
()))
{
continue
;
}
deselectAction
(
path
.
getLastSegment
());
deselectAction
(
path
.
getLastSegment
());
if
(
selectedElements
.
remove
(
path
.
getLastSegment
()))
{
if
(
selectedElements
.
remove
(
path
.
getLastSegment
()))
{
gui
.
getSelectTreeViewer
().
remove
(
path
.
getLastSegment
());
gui
.
getSelectTreeViewer
().
remove
(
path
.
getLastSegment
());
...
@@ -507,7 +513,7 @@ public class ElementTreeMultiSelectEditableDialog extends TitleAreaDialog {
...
@@ -507,7 +513,7 @@ public class ElementTreeMultiSelectEditableDialog extends TitleAreaDialog {
* @param selectedElement
* @param selectedElement
* @return element after convert
* @return element after convert
*/
*/
public
Object
selectConverter
(
Object
selectedElement
)
{
public
Object
selectConverter
Action
(
Object
selectedElement
)
{
return
selectedElement
;
return
selectedElement
;
}
}
...
@@ -523,4 +529,26 @@ public class ElementTreeMultiSelectEditableDialog extends TitleAreaDialog {
...
@@ -523,4 +529,26 @@ public class ElementTreeMultiSelectEditableDialog extends TitleAreaDialog {
}
}
/**
* This method can be overwritten by subclasses to check, if the selected element can be
* selected
*
* @param toSelectedElement
* @return if the toSelectedElement can be selected
*/
public
boolean
canSelect
(
Object
toSelectedElement
)
{
return
true
;
}
/**
* This method can be overwritten by subclasses to check, if the selected element can be
* deselected
*
* @param toDeselectedElement
* @return if the to DeselectedElement can be deselected
*/
public
boolean
canDeselect
(
Object
toDeselectedElement
)
{
return
true
;
}
}
}
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