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
4ec19b23
Commit
4ec19b23
authored
8 years ago
by
Simon Barner
Browse files
Options
Downloads
Patches
Plain Diff
- Enforce full update of annotation views on setUpdateEnabled(true)
parent
e7740cdf
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/annotation/view/AnnotationViewPartBase.java
+20
-3
20 additions, 3 deletions
...oling/base/ui/annotation/view/AnnotationViewPartBase.java
with
20 additions
and
3 deletions
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/view/AnnotationViewPartBase.java
+
20
−
3
View file @
4ec19b23
...
...
@@ -60,7 +60,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService;
* @author barner
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash:
E5338A681AFA613876C560BD968F34A9
* @ConQAT.Rating YELLOW Hash:
B5EED9862BC0107F49D3E471B16282D7
*/
public
abstract
class
AnnotationViewPartBase
extends
ViewPart
implements
ISelectionListener
,
IAnnotationViewPart
{
...
...
@@ -71,6 +71,9 @@ public abstract class AnnotationViewPartBase extends ViewPart implements ISelect
/** Last selected object. */
private
IModelElement
lastSelectedObject
;
/** Last root element determined during the last successful {@link #update(IModelElement)}. */
private
IProjectRootElement
lastRootElement
;
/**
* Root element for which the {@link #changeListener} has been installed to (recursively)
* watch for model changes (to trigger an update of this {@link AnnotationViewPartBase}).
...
...
@@ -229,11 +232,19 @@ public abstract class AnnotationViewPartBase extends ViewPart implements ISelect
* {@link #update(Collection)}, and update model change listeners.
*/
protected
void
update
(
IModelElement
modelElement
)
{
EObject
rootElement
=
getParentElement
(
modelElement
,
IProjectRootElement
.
class
,
true
);
IProjectRootElement
rootElement
=
getParentElement
(
modelElement
,
IProjectRootElement
.
class
,
true
);
if
(
rootElement
==
null
)
{
return
;
}
lastRootElement
=
rootElement
;
update
(
rootElement
);
}
/** Perform update for given {@link IProjectRootElement}. */
private
void
update
(
IProjectRootElement
rootElement
)
{
// Check cache if annotation entries for the given root element have already been determined
Collection
<
AnnotationEntry
>
annotationEntries
=
lastAnnotationEntriesMap
.
get
(
rootElement
);
...
...
@@ -315,6 +326,12 @@ public abstract class AnnotationViewPartBase extends ViewPart implements ISelect
activeInstances
.
remove
(
this
);
}
/** Enforces a full update of the view based on {@link #lastRootElement}. */
private
void
forceFullUpdate
()
{
lastAnnotationEntriesMap
.
clear
();
update
(
lastRootElement
);
}
/** Sets {@link #isUpdateEnabled}. If the update is re-enabled, the view is refreshed. */
public
static
synchronized
void
setUpdateEnabled
(
boolean
isUpdateEnabled
)
{
AnnotationViewPartBase
.
isUpdateEnabled
=
isUpdateEnabled
;
...
...
@@ -323,7 +340,7 @@ public abstract class AnnotationViewPartBase extends ViewPart implements ISelect
@Override
public
void
run
()
{
for
(
AnnotationViewPartBase
avp
:
activeInstances
)
{
avp
.
u
pdate
();
avp
.
forceFullU
pdate
();
}
}
});
...
...
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