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
b8443ae5
Commit
b8443ae5
authored
8 years ago
by
Simon Barner
Browse files
Options
Downloads
Patches
Plain Diff
- Add setRedraw() and getDraw() to control update of tree viewer
parent
233116a3
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/editor/TreeViewerEditorBase.java
+21
-3
21 additions, 3 deletions
.../fortiss/tooling/base/ui/editor/TreeViewerEditorBase.java
with
21 additions
and
3 deletions
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/TreeViewerEditorBase.java
+
21
−
3
View file @
b8443ae5
...
...
@@ -40,13 +40,16 @@ import org.fortiss.tooling.kernel.ui.extension.base.EditorBase;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash:
B41A78E1C4B5CE289ABE9708C75C3BE2
* @ConQAT.Rating YELLOW Hash:
C9AE2970436C1B319E0CDB08EA9A0428
*/
public
abstract
class
TreeViewerEditorBase
<
T
extends
EObject
>
extends
EditorBase
<
T
>
{
/** Stores the {@link TreeViewer}. */
private
TreeViewer
treeViewer
;
/** Flag if redraw of the underlying {@link #treeViewer} is enabled. */
boolean
redraw
;
/** The adapter used for dealing with changes of the content. */
private
final
Adapter
editedObjectChanged
=
new
EContentAdapter
()
{
@Override
...
...
@@ -54,7 +57,7 @@ public abstract class TreeViewerEditorBase<T extends EObject> extends EditorBase
super
.
notifyChanged
(
notification
);
if
(
notification
.
getEventType
()
!=
Notification
.
REMOVING_ADAPTER
)
{
Display
.
getDefault
().
asyncExec
(()
->
{
if
(!
treeViewer
.
getTree
().
isDisposed
())
{
if
(!
treeViewer
.
getTree
().
isDisposed
()
&&
getRedraw
()
)
{
treeViewer
.
refresh
(
true
);
}
});
...
...
@@ -66,6 +69,7 @@ public abstract class TreeViewerEditorBase<T extends EObject> extends EditorBase
@Override
public
void
createPartControl
(
Composite
parent
)
{
treeViewer
=
new
TreeViewer
(
parent
);
redraw
=
true
;
setupTreeViewer
(
treeViewer
);
...
...
@@ -110,8 +114,22 @@ public abstract class TreeViewerEditorBase<T extends EObject> extends EditorBase
treeViewer
.
getTree
().
setFocus
();
}
/** Returns treeViewer. */
/** Returns
{@link #
treeViewer
}
. */
public
TreeViewer
getTreeViewer
()
{
return
treeViewer
;
}
/** Sets {@link #redraw}. */
public
void
setRedraw
(
boolean
redraw
)
{
this
.
redraw
=
redraw
;
treeViewer
.
getTree
().
setRedraw
(
redraw
);
if
(
redraw
)
{
treeViewer
.
refresh
();
}
}
/** Returns {@link #redraw}. */
boolean
getRedraw
()
{
return
redraw
;
}
}
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