Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlorenzo2013-04-26 09:06:00 -0400
committervlorenzo2013-04-26 09:06:00 -0400
commitd2b9c1fc202ba2533f3b72ffa2307df51c5ef1cc (patch)
tree4552cd9eac34a9ac3ab8ac9d18224534a2800069 /sandbox
parent74e3af1dd40dfe3a50d3e3b8780b996cd88fae86 (diff)
downloadorg.eclipse.papyrus-d2b9c1fc202ba2533f3b72ffa2307df51c5ef1cc.tar.gz
org.eclipse.papyrus-d2b9c1fc202ba2533f3b72ffa2307df51c5ef1cc.tar.xz
org.eclipse.papyrus-d2b9c1fc202ba2533f3b72ffa2307df51c5ef1cc.zip
401764: [Table 2] The classes managing the table model and Nattable must be refactored
https://bugs.eclipse.org/bugs/show_bug.cgi?id=401764 Correct a small name error in the table metamodel + fix the synchronized tables
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/plugin.properties2
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/provider/AxisManagerConfigurationItemProvider.java12
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/provider/AxisManagerRepresentationItemProvider.java12
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/META-INF/MANIFEST.MF2
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/plugin.xml6
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxis/presentation/NattableaxisEditor.java328
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/presentation/NattableaxisconfigurationEditor.java328
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisprovider/presentation/NattableaxisproviderEditor.java328
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableconfiguration/presentation/NattableconfigurationEditor.java328
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattablelabelprovider/presentation/NattablelabelproviderEditor.java328
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattabletester/presentation/NattabletesterEditor.java328
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/presentation/NattableEditor.java1133
12 files changed, 1544 insertions, 1591 deletions
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/plugin.properties b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/plugin.properties
index f1cc4f628b0..e01f91c4018 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/plugin.properties
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/plugin.properties
@@ -191,3 +191,5 @@ _UI_IAxis_alias_feature = Alias
_UI_FeatureAxis_localLabelConfiguration_feature = Local Label Configuration
_UI_ObjectAxis_localLabelConfiguration_feature = Local Label Configuration
_UI_EStructuralFeatureAxis_element_feature = Element
+_UI_AxisManagerRepresentation_specificAxisConfigurations_feature = Specific Axis Configurations
+_UI_AxisManagerConfiguration_localSpecificConfigurations_feature = Local Specific Configurations
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/provider/AxisManagerConfigurationItemProvider.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/provider/AxisManagerConfigurationItemProvider.java
index 61ad295fc36..e01e5526b57 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/provider/AxisManagerConfigurationItemProvider.java
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/provider/AxisManagerConfigurationItemProvider.java
@@ -71,7 +71,7 @@ public class AxisManagerConfigurationItemProvider
addLocalHeaderLabelConfigurationPropertyDescriptor(object);
addAxisManagerPropertyDescriptor(object);
- addLocalSpecificConfigurationPropertyDescriptor(object);
+ addLocalSpecificConfigurationsPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
@@ -121,19 +121,19 @@ public class AxisManagerConfigurationItemProvider
}
/**
- * This adds a property descriptor for the Local Specific Configuration feature.
+ * This adds a property descriptor for the Local Specific Configurations feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- protected void addLocalSpecificConfigurationPropertyDescriptor(Object object) {
+ protected void addLocalSpecificConfigurationsPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
- getString("_UI_AxisManagerConfiguration_localSpecificConfiguration_feature"), //$NON-NLS-1$
- getString("_UI_PropertyDescriptor_description", "_UI_AxisManagerConfiguration_localSpecificConfiguration_feature", "_UI_AxisManagerConfiguration_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- NattableaxisconfigurationPackage.Literals.AXIS_MANAGER_CONFIGURATION__LOCAL_SPECIFIC_CONFIGURATION,
+ getString("_UI_AxisManagerConfiguration_localSpecificConfigurations_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_AxisManagerConfiguration_localSpecificConfigurations_feature", "_UI_AxisManagerConfiguration_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ NattableaxisconfigurationPackage.Literals.AXIS_MANAGER_CONFIGURATION__LOCAL_SPECIFIC_CONFIGURATIONS,
true,
false,
true,
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/provider/AxisManagerRepresentationItemProvider.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/provider/AxisManagerRepresentationItemProvider.java
index 4d08735dac3..bb0f62d12e7 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/provider/AxisManagerRepresentationItemProvider.java
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.edit/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/provider/AxisManagerRepresentationItemProvider.java
@@ -75,7 +75,7 @@ public class AxisManagerRepresentationItemProvider
addAxisManagerIdPropertyDescriptor(object);
addLabelProviderContextPropertyDescriptor(object);
addHeaderLabelConfigurationPropertyDescriptor(object);
- addSpecificAxisConfigurationPropertyDescriptor(object);
+ addSpecificAxisConfigurationsPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
@@ -147,19 +147,19 @@ public class AxisManagerRepresentationItemProvider
}
/**
- * This adds a property descriptor for the Specific Axis Configuration feature.
+ * This adds a property descriptor for the Specific Axis Configurations feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- protected void addSpecificAxisConfigurationPropertyDescriptor(Object object) {
+ protected void addSpecificAxisConfigurationsPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
- getString("_UI_AxisManagerRepresentation_specificAxisConfiguration_feature"), //$NON-NLS-1$
- getString("_UI_PropertyDescriptor_description", "_UI_AxisManagerRepresentation_specificAxisConfiguration_feature", "_UI_AxisManagerRepresentation_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- NattableaxisconfigurationPackage.Literals.AXIS_MANAGER_REPRESENTATION__SPECIFIC_AXIS_CONFIGURATION,
+ getString("_UI_AxisManagerRepresentation_specificAxisConfigurations_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_AxisManagerRepresentation_specificAxisConfigurations_feature", "_UI_AxisManagerRepresentation_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ NattableaxisconfigurationPackage.Literals.AXIS_MANAGER_REPRESENTATION__SPECIFIC_AXIS_CONFIGURATIONS,
true,
false,
true,
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/META-INF/MANIFEST.MF b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/META-INF/MANIFEST.MF
index ff0f55c444e..a84f292b514 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/META-INF/MANIFEST.MF
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/META-INF/MANIFEST.MF
@@ -17,7 +17,7 @@ Export-Package: org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxis.p
org.eclipse.papyrus.infra.nattable.model.nattable.presentation
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources;visibility:=reexport,
- org.eclipse.papyrus.infra.nattable.model.edit;bundle-version="0.10.0";visibility:=reexport,
+ org.eclipse.papyrus.infra.nattable.model.edit;visibility:=reexport;bundle-version="0.10.0",
org.eclipse.emf.ecore.xmi;visibility:=reexport,
org.eclipse.emf.edit.ui;visibility:=reexport,
org.eclipse.ui.ide;visibility:=reexport,
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/plugin.xml b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/plugin.xml
index 2ddcb928217..ee1840bc292 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/plugin.xml
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/plugin.xml
@@ -73,6 +73,7 @@
</extension>
null
+null
<extension point="org.eclipse.ui.editors">
<!-- @generated nattable -->
<editor
@@ -103,6 +104,7 @@ null
null
null
+null
<extension point="org.eclipse.ui.editors">
<!-- @generated nattable -->
<editor
@@ -132,6 +134,7 @@ null
</extension>
null
+null
<extension point="org.eclipse.ui.editors">
<!-- @generated nattable -->
<editor
@@ -161,6 +164,7 @@ null
</extension>
null
+null
<extension point="org.eclipse.ui.editors">
<!-- @generated nattable -->
<editor
@@ -190,6 +194,7 @@ null
</extension>
null
+null
<extension point="org.eclipse.ui.editors">
<!-- @generated nattable -->
<editor
@@ -218,4 +223,5 @@ null
</wizard>
</extension>
+null
null</plugin>
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxis/presentation/NattableaxisEditor.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxis/presentation/NattableaxisEditor.java
index b920dca3147..08537380e25 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxis/presentation/NattableaxisEditor.java
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxis/presentation/NattableaxisEditor.java
@@ -306,14 +306,14 @@ public class NattableaxisEditor
new IPartListener() {
public void partActivated(IWorkbenchPart p) {
if (p instanceof ContentOutline) {
- if (((ContentOutline)p).getCurrentPage() == NattableaxisEditor.this.contentOutlinePage) {
+ if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) {
getActionBarContributor().setActiveEditor(NattableaxisEditor.this);
- setCurrentViewer(NattableaxisEditor.this.contentOutlineViewer);
+ setCurrentViewer(contentOutlineViewer);
}
}
else if (p instanceof PropertySheet) {
- if (NattableaxisEditor.this.propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
+ if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
getActionBarContributor().setActiveEditor(NattableaxisEditor.this);
handleActivate();
}
@@ -394,13 +394,13 @@ public class NattableaxisEditor
Resource resource = (Resource)notification.getNotifier();
Diagnostic diagnostic = analyzeResourceProblems(resource, null);
if (diagnostic.getSeverity() != Diagnostic.OK) {
- NattableaxisEditor.this.resourceToDiagnosticMap.put(resource, diagnostic);
+ resourceToDiagnosticMap.put(resource, diagnostic);
}
else {
- NattableaxisEditor.this.resourceToDiagnosticMap.remove(resource);
+ resourceToDiagnosticMap.remove(resource);
}
- if (NattableaxisEditor.this.updateProblemIndication) {
+ if (updateProblemIndication) {
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
@@ -425,8 +425,8 @@ public class NattableaxisEditor
@Override
protected void unsetTarget(Resource target) {
basicUnsetTarget(target);
- NattableaxisEditor.this.resourceToDiagnosticMap.remove(target);
- if (NattableaxisEditor.this.updateProblemIndication) {
+ resourceToDiagnosticMap.remove(target);
+ if (updateProblemIndication) {
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
@@ -449,7 +449,7 @@ public class NattableaxisEditor
IResourceDelta delta = event.getDelta();
try {
class ResourceDeltaVisitor implements IResourceDeltaVisitor {
- protected ResourceSet resourceSet = NattableaxisEditor.this.editingDomain.getResourceSet();
+ protected ResourceSet resourceSet = editingDomain.getResourceSet();
protected Collection<Resource> changedResources = new ArrayList<Resource>();
protected Collection<Resource> removedResources = new ArrayList<Resource>();
@@ -457,13 +457,13 @@ public class NattableaxisEditor
if (delta.getResource().getType() == IResource.FILE) {
if (delta.getKind() == IResourceDelta.REMOVED ||
delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
- Resource resource = this.resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
+ Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
if (resource != null) {
if (delta.getKind() == IResourceDelta.REMOVED) {
- this.removedResources.add(resource);
+ removedResources.add(resource);
}
- else if (!NattableaxisEditor.this.savedResources.remove(resource)) {
- this.changedResources.add(resource);
+ else if (!savedResources.remove(resource)) {
+ changedResources.add(resource);
}
}
}
@@ -474,11 +474,11 @@ public class NattableaxisEditor
}
public Collection<Resource> getChangedResources() {
- return this.changedResources;
+ return changedResources;
}
public Collection<Resource> getRemovedResources() {
- return this.removedResources;
+ return removedResources;
}
}
@@ -489,7 +489,7 @@ public class NattableaxisEditor
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
- NattableaxisEditor.this.removedResources.addAll(visitor.getRemovedResources());
+ removedResources.addAll(visitor.getRemovedResources());
if (!isDirty()) {
getSite().getPage().closeEditor(NattableaxisEditor.this, false);
}
@@ -501,7 +501,7 @@ public class NattableaxisEditor
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
- NattableaxisEditor.this.changedResources.addAll(visitor.getChangedResources());
+ changedResources.addAll(visitor.getChangedResources());
if (getSite().getPage().getActiveEditor() == NattableaxisEditor.this) {
handleActivate();
}
@@ -524,29 +524,29 @@ public class NattableaxisEditor
protected void handleActivate() {
// Recompute the read only state.
//
- if (this.editingDomain.getResourceToReadOnlyMap() != null) {
- this.editingDomain.getResourceToReadOnlyMap().clear();
+ if (editingDomain.getResourceToReadOnlyMap() != null) {
+ editingDomain.getResourceToReadOnlyMap().clear();
// Refresh any actions that may become enabled or disabled.
//
setSelection(getSelection());
}
- if (!this.removedResources.isEmpty()) {
+ if (!removedResources.isEmpty()) {
if (handleDirtyConflict()) {
getSite().getPage().closeEditor(NattableaxisEditor.this, false);
}
else {
- this.removedResources.clear();
- this.changedResources.clear();
- this.savedResources.clear();
+ removedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
}
}
- else if (!this.changedResources.isEmpty()) {
- this.changedResources.removeAll(this.savedResources);
+ else if (!changedResources.isEmpty()) {
+ changedResources.removeAll(savedResources);
handleChangedResources();
- this.changedResources.clear();
- this.savedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
}
}
@@ -557,32 +557,32 @@ public class NattableaxisEditor
* @generated
*/
protected void handleChangedResources() {
- if (!this.changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
+ if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
if (isDirty()) {
- this.changedResources.addAll(this.editingDomain.getResourceSet().getResources());
+ changedResources.addAll(editingDomain.getResourceSet().getResources());
}
- this.editingDomain.getCommandStack().flush();
+ editingDomain.getCommandStack().flush();
- this.updateProblemIndication = false;
- for (Resource resource : this.changedResources) {
+ updateProblemIndication = false;
+ for (Resource resource : changedResources) {
if (resource.isLoaded()) {
resource.unload();
try {
resource.load(Collections.EMPTY_MAP);
}
catch (IOException exception) {
- if (!this.resourceToDiagnosticMap.containsKey(resource)) {
- this.resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ if (!resourceToDiagnosticMap.containsKey(resource)) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
}
}
}
}
- if (AdapterFactoryEditingDomain.isStale(this.editorSelection)) {
+ if (AdapterFactoryEditingDomain.isStale(editorSelection)) {
setSelection(StructuredSelection.EMPTY);
}
- this.updateProblemIndication = true;
+ updateProblemIndication = true;
updateProblemIndication();
}
}
@@ -594,15 +594,15 @@ public class NattableaxisEditor
* @generated
*/
protected void updateProblemIndication() {
- if (this.updateProblemIndication) {
+ if (updateProblemIndication) {
BasicDiagnostic diagnostic =
new BasicDiagnostic
(Diagnostic.OK,
"org.eclipse.papyrus.infra.nattable.model.editor", //$NON-NLS-1$
0,
null,
- new Object [] { this.editingDomain.getResourceSet() });
- for (Diagnostic childDiagnostic : this.resourceToDiagnosticMap.values()) {
+ new Object [] { editingDomain.getResourceSet() });
+ for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) {
if (childDiagnostic.getSeverity() != Diagnostic.OK) {
diagnostic.add(childDiagnostic);
}
@@ -618,7 +618,7 @@ public class NattableaxisEditor
else if (diagnostic.getSeverity() != Diagnostic.OK) {
ProblemEditorPart problemEditorPart = new ProblemEditorPart();
problemEditorPart.setDiagnostic(diagnostic);
- problemEditorPart.setMarkerHelper(this.markerHelper);
+ problemEditorPart.setMarkerHelper(markerHelper);
try {
addPage(++lastEditorPage, problemEditorPart, getEditorInput());
setPageText(lastEditorPage, problemEditorPart.getPartName());
@@ -630,11 +630,11 @@ public class NattableaxisEditor
}
}
- if (this.markerHelper.hasMarkers(this.editingDomain.getResourceSet())) {
- this.markerHelper.deleteMarkers(this.editingDomain.getResourceSet());
+ if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
+ markerHelper.deleteMarkers(editingDomain.getResourceSet());
if (diagnostic.getSeverity() != Diagnostic.OK) {
try {
- this.markerHelper.createMarkers(diagnostic);
+ markerHelper.createMarkers(diagnostic);
}
catch (CoreException exception) {
NattableEditorPlugin.INSTANCE.log(exception);
@@ -678,18 +678,18 @@ public class NattableaxisEditor
protected void initializeEditingDomain() {
// Create an adapter factory that yields item providers.
//
- this.adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
-
- this.adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableconfigurationItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableaxisproviderItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattablelabelproviderItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableaxisconfigurationItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattabletesterItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableaxisItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableconfigurationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableaxisproviderItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattablelabelproviderItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableaxisconfigurationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattabletesterItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableaxisItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
// Create the command stack that will notify this editor as commands are executed.
//
@@ -711,7 +711,7 @@ public class NattableaxisEditor
if (mostRecentCommand != null) {
setSelectionToViewer(mostRecentCommand.getAffectedObjects());
}
- for (Iterator<PropertySheetPage> i = NattableaxisEditor.this.propertySheetPages.iterator(); i.hasNext(); ) {
+ for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) {
PropertySheetPage propertySheetPage = i.next();
if (propertySheetPage.getControl().isDisposed()) {
i.remove();
@@ -727,7 +727,7 @@ public class NattableaxisEditor
// Create the editing domain with a special command stack.
//
- this.editingDomain = new AdapterFactoryEditingDomain(this.adapterFactory, commandStack, new HashMap<Resource, Boolean>());
+ editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
}
/**
@@ -757,8 +757,8 @@ public class NattableaxisEditor
public void run() {
// Try to select the items in the current content viewer of the editor.
//
- if (NattableaxisEditor.this.currentViewer != null) {
- NattableaxisEditor.this.currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
+ if (currentViewer != null) {
+ currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
}
}
};
@@ -775,7 +775,7 @@ public class NattableaxisEditor
* @generated
*/
public EditingDomain getEditingDomain() {
- return this.editingDomain;
+ return editingDomain;
}
/**
@@ -843,13 +843,13 @@ public class NattableaxisEditor
* @generated
*/
public void setCurrentViewerPane(ViewerPane viewerPane) {
- if (this.currentViewerPane != viewerPane) {
- if (this.currentViewerPane != null) {
- this.currentViewerPane.showFocus(false);
+ if (currentViewerPane != viewerPane) {
+ if (currentViewerPane != null) {
+ currentViewerPane.showFocus(false);
}
- this.currentViewerPane = viewerPane;
+ currentViewerPane = viewerPane;
}
- setCurrentViewer(this.currentViewerPane.getViewer());
+ setCurrentViewer(currentViewerPane.getViewer());
}
/**
@@ -862,11 +862,11 @@ public class NattableaxisEditor
public void setCurrentViewer(Viewer viewer) {
// If it is changing...
//
- if (this.currentViewer != viewer) {
- if (this.selectionChangedListener == null) {
+ if (currentViewer != viewer) {
+ if (selectionChangedListener == null) {
// Create the listener on demand.
//
- this.selectionChangedListener =
+ selectionChangedListener =
new ISelectionChangedListener() {
// This just notifies those things that are affected by the section.
//
@@ -878,23 +878,23 @@ public class NattableaxisEditor
// Stop listening to the old one.
//
- if (this.currentViewer != null) {
- this.currentViewer.removeSelectionChangedListener(this.selectionChangedListener);
+ if (currentViewer != null) {
+ currentViewer.removeSelectionChangedListener(selectionChangedListener);
}
// Start listening to the new one.
//
if (viewer != null) {
- viewer.addSelectionChangedListener(this.selectionChangedListener);
+ viewer.addSelectionChangedListener(selectionChangedListener);
}
// Remember it.
//
- this.currentViewer = viewer;
+ currentViewer = viewer;
// Set the editors selection based on the current viewer's selection.
//
- setSelection(this.currentViewer == null ? StructuredSelection.EMPTY : this.currentViewer.getSelection());
+ setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection());
}
}
@@ -905,7 +905,7 @@ public class NattableaxisEditor
* @generated
*/
public Viewer getViewer() {
- return this.currentViewer;
+ return currentViewer;
}
/**
@@ -926,7 +926,7 @@ public class NattableaxisEditor
int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() };
viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
- viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(this.editingDomain, viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
}
/**
@@ -942,18 +942,18 @@ public class NattableaxisEditor
try {
// Load the resource through the editing domain.
//
- resource = this.editingDomain.getResourceSet().getResource(resourceURI, true);
+ resource = editingDomain.getResourceSet().getResource(resourceURI, true);
}
catch (Exception e) {
exception = e;
- resource = this.editingDomain.getResourceSet().getResource(resourceURI, false);
+ resource = editingDomain.getResourceSet().getResource(resourceURI, false);
}
Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
if (diagnostic.getSeverity() != Diagnostic.OK) {
- this.resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
}
- this.editingDomain.getResourceSet().eAdapters().add(this.problemIndicationAdapter);
+ editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
}
/**
@@ -1023,17 +1023,17 @@ public class NattableaxisEditor
};
viewerPane.createControl(getContainer());
- this.selectionViewer = (TreeViewer)viewerPane.getViewer();
- this.selectionViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
+ selectionViewer = (TreeViewer)viewerPane.getViewer();
+ selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
- this.selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
- this.selectionViewer.setInput(this.editingDomain.getResourceSet());
- this.selectionViewer.setSelection(new StructuredSelection(this.editingDomain.getResourceSet().getResources().get(0)), true);
- viewerPane.setTitle(this.editingDomain.getResourceSet());
+ selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ selectionViewer.setInput(editingDomain.getResourceSet());
+ selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ viewerPane.setTitle(editingDomain.getResourceSet());
- new AdapterFactoryTreeEditor(this.selectionViewer.getTree(), this.adapterFactory);
+ new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
- createContextMenuFor(this.selectionViewer);
+ createContextMenuFor(selectionViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_SelectionPage_label")); //$NON-NLS-1$
}
@@ -1057,12 +1057,12 @@ public class NattableaxisEditor
};
viewerPane.createControl(getContainer());
- this.parentViewer = (TreeViewer)viewerPane.getViewer();
- this.parentViewer.setAutoExpandLevel(30);
- this.parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(this.adapterFactory));
- this.parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ parentViewer = (TreeViewer)viewerPane.getViewer();
+ parentViewer.setAutoExpandLevel(30);
+ parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
+ parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.parentViewer);
+ createContextMenuFor(parentViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_ParentPage_label")); //$NON-NLS-1$
}
@@ -1083,11 +1083,11 @@ public class NattableaxisEditor
}
};
viewerPane.createControl(getContainer());
- this.listViewer = (ListViewer)viewerPane.getViewer();
- this.listViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.listViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ listViewer = (ListViewer)viewerPane.getViewer();
+ listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.listViewer);
+ createContextMenuFor(listViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_ListPage_label")); //$NON-NLS-1$
}
@@ -1108,13 +1108,13 @@ public class NattableaxisEditor
}
};
viewerPane.createControl(getContainer());
- this.treeViewer = (TreeViewer)viewerPane.getViewer();
- this.treeViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ treeViewer = (TreeViewer)viewerPane.getViewer();
+ treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- new AdapterFactoryTreeEditor(this.treeViewer.getTree(), this.adapterFactory);
+ new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
- createContextMenuFor(this.treeViewer);
+ createContextMenuFor(treeViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TreePage_label")); //$NON-NLS-1$
}
@@ -1135,9 +1135,9 @@ public class NattableaxisEditor
}
};
viewerPane.createControl(getContainer());
- this.tableViewer = (TableViewer)viewerPane.getViewer();
+ tableViewer = (TableViewer)viewerPane.getViewer();
- Table table = this.tableViewer.getTable();
+ Table table = tableViewer.getTable();
TableLayout layout = new TableLayout();
table.setLayout(layout);
table.setHeaderVisible(true);
@@ -1153,11 +1153,11 @@ public class NattableaxisEditor
selfColumn.setText(getString("_UI_SelfColumn_label")); //$NON-NLS-1$
selfColumn.setResizable(true);
- this.tableViewer.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
- this.tableViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ tableViewer.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
+ tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.tableViewer);
+ createContextMenuFor(tableViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TablePage_label")); //$NON-NLS-1$
}
@@ -1179,9 +1179,9 @@ public class NattableaxisEditor
};
viewerPane.createControl(getContainer());
- this.treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
+ treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
- Tree tree = this.treeViewerWithColumns.getTree();
+ Tree tree = treeViewerWithColumns.getTree();
tree.setLayoutData(new FillLayout());
tree.setHeaderVisible(true);
tree.setLinesVisible(true);
@@ -1196,11 +1196,11 @@ public class NattableaxisEditor
selfColumn.setResizable(true);
selfColumn.setWidth(200);
- this.treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
- this.treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
+ treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.treeViewerWithColumns);
+ createContextMenuFor(treeViewerWithColumns);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label")); //$NON-NLS-1$
}
@@ -1221,10 +1221,10 @@ public class NattableaxisEditor
boolean guard = false;
@Override
public void controlResized(ControlEvent event) {
- if (!this.guard) {
- this.guard = true;
+ if (!guard) {
+ guard = true;
hideTabs();
- this.guard = false;
+ guard = false;
}
}
});
@@ -1283,8 +1283,8 @@ public class NattableaxisEditor
protected void pageChange(int pageIndex) {
super.pageChange(pageIndex);
- if (this.contentOutlinePage != null) {
- handleContentOutlineSelection(this.contentOutlinePage.getSelection());
+ if (contentOutlinePage != null) {
+ handleContentOutlineSelection(contentOutlinePage.getSelection());
}
}
@@ -1318,37 +1318,37 @@ public class NattableaxisEditor
* @generated
*/
public IContentOutlinePage getContentOutlinePage() {
- if (this.contentOutlinePage == null) {
+ if (contentOutlinePage == null) {
// The content outline is just a tree.
//
class MyContentOutlinePage extends ContentOutlinePage {
@Override
public void createControl(Composite parent) {
super.createControl(parent);
- NattableaxisEditor.this.contentOutlineViewer = getTreeViewer();
- NattableaxisEditor.this.contentOutlineViewer.addSelectionChangedListener(this);
+ contentOutlineViewer = getTreeViewer();
+ contentOutlineViewer.addSelectionChangedListener(this);
// Set up the tree viewer.
//
- NattableaxisEditor.this.contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(NattableaxisEditor.this.adapterFactory));
- NattableaxisEditor.this.contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(NattableaxisEditor.this.adapterFactory));
- NattableaxisEditor.this.contentOutlineViewer.setInput(NattableaxisEditor.this.editingDomain.getResourceSet());
+ contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ contentOutlineViewer.setInput(editingDomain.getResourceSet());
// Make sure our popups work.
//
- createContextMenuFor(NattableaxisEditor.this.contentOutlineViewer);
+ createContextMenuFor(contentOutlineViewer);
- if (!NattableaxisEditor.this.editingDomain.getResourceSet().getResources().isEmpty()) {
+ if (!editingDomain.getResourceSet().getResources().isEmpty()) {
// Select the root object in the view.
//
- NattableaxisEditor.this.contentOutlineViewer.setSelection(new StructuredSelection(NattableaxisEditor.this.editingDomain.getResourceSet().getResources().get(0)), true);
+ contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
}
}
@Override
public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
super.makeContributions(menuManager, toolBarManager, statusLineManager);
- NattableaxisEditor.this.contentOutlineStatusLineManager = statusLineManager;
+ contentOutlineStatusLineManager = statusLineManager;
}
@Override
@@ -1358,11 +1358,11 @@ public class NattableaxisEditor
}
}
- this.contentOutlinePage = new MyContentOutlinePage();
+ contentOutlinePage = new MyContentOutlinePage();
// Listen to selection so that we can handle it is a special way.
//
- this.contentOutlinePage.addSelectionChangedListener
+ contentOutlinePage.addSelectionChangedListener
(new ISelectionChangedListener() {
// This ensures that we handle selections correctly.
//
@@ -1372,7 +1372,7 @@ public class NattableaxisEditor
});
}
- return this.contentOutlinePage;
+ return contentOutlinePage;
}
/**
@@ -1383,7 +1383,7 @@ public class NattableaxisEditor
*/
public IPropertySheetPage getPropertySheetPage() {
PropertySheetPage propertySheetPage =
- new ExtendedPropertySheetPage(this.editingDomain) {
+ new ExtendedPropertySheetPage(editingDomain) {
@Override
public void setSelectionToViewer(List<?> selection) {
NattableaxisEditor.this.setSelectionToViewer(selection);
@@ -1396,8 +1396,8 @@ public class NattableaxisEditor
getActionBarContributor().shareGlobalActions(this, actionBars);
}
};
- propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.propertySheetPages.add(propertySheetPage);
+ propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
+ propertySheetPages.add(propertySheetPage);
return propertySheetPage;
}
@@ -1409,7 +1409,7 @@ public class NattableaxisEditor
* @generated
*/
public void handleContentOutlineSelection(ISelection selection) {
- if (this.currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
+ if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
if (selectedElements.hasNext()) {
// Get the first selected element.
@@ -1418,7 +1418,7 @@ public class NattableaxisEditor
// If it's the selection viewer, then we want it to select the same selection as this selection.
//
- if (this.currentViewerPane.getViewer() == this.selectionViewer) {
+ if (currentViewerPane.getViewer() == selectionViewer) {
ArrayList<Object> selectionList = new ArrayList<Object>();
selectionList.add(selectedElement);
while (selectedElements.hasNext()) {
@@ -1427,14 +1427,14 @@ public class NattableaxisEditor
// Set the selection to the widget.
//
- this.selectionViewer.setSelection(new StructuredSelection(selectionList));
+ selectionViewer.setSelection(new StructuredSelection(selectionList));
}
else {
// Set the input to the widget.
//
- if (this.currentViewerPane.getViewer().getInput() != selectedElement) {
- this.currentViewerPane.getViewer().setInput(selectedElement);
- this.currentViewerPane.setTitle(selectedElement);
+ if (currentViewerPane.getViewer().getInput() != selectedElement) {
+ currentViewerPane.getViewer().setInput(selectedElement);
+ currentViewerPane.setTitle(selectedElement);
}
}
}
@@ -1449,7 +1449,7 @@ public class NattableaxisEditor
*/
@Override
public boolean isDirty() {
- return ((BasicCommandStack)this.editingDomain.getCommandStack()).isSaveNeeded();
+ return ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();
}
/**
@@ -1526,7 +1526,7 @@ public class NattableaxisEditor
protected boolean isPersisted(Resource resource) {
boolean result = false;
try {
- InputStream stream = this.editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
+ InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
if (stream != null) {
result = true;
stream.close();
@@ -1574,7 +1574,7 @@ public class NattableaxisEditor
* @generated
*/
protected void doSaveAs(URI uri, IEditorInput editorInput) {
- (this.editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
+ (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
setInputWithNotify(editorInput);
setPartName(editorInput.getName());
IProgressMonitor progressMonitor =
@@ -1590,7 +1590,7 @@ public class NattableaxisEditor
* @generated
*/
public void gotoMarker(IMarker marker) {
- List<?> targetObjects = this.markerHelper.getTargetObjects(this.editingDomain, marker);
+ List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker);
if (!targetObjects.isEmpty()) {
setSelectionToViewer(targetObjects);
}
@@ -1608,8 +1608,8 @@ public class NattableaxisEditor
setInputWithNotify(editorInput);
setPartName(editorInput.getName());
site.setSelectionProvider(this);
- site.getPage().addPartListener(this.partListener);
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this.resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+ site.getPage().addPartListener(partListener);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
}
/**
@@ -1619,8 +1619,8 @@ public class NattableaxisEditor
*/
@Override
public void setFocus() {
- if (this.currentViewerPane != null) {
- this.currentViewerPane.setFocus();
+ if (currentViewerPane != null) {
+ currentViewerPane.setFocus();
}
else {
getControl(getActivePage()).setFocus();
@@ -1634,7 +1634,7 @@ public class NattableaxisEditor
* @generated
*/
public void addSelectionChangedListener(ISelectionChangedListener listener) {
- this.selectionChangedListeners.add(listener);
+ selectionChangedListeners.add(listener);
}
/**
@@ -1644,7 +1644,7 @@ public class NattableaxisEditor
* @generated
*/
public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- this.selectionChangedListeners.remove(listener);
+ selectionChangedListeners.remove(listener);
}
/**
@@ -1654,7 +1654,7 @@ public class NattableaxisEditor
* @generated
*/
public ISelection getSelection() {
- return this.editorSelection;
+ return editorSelection;
}
/**
@@ -1665,9 +1665,9 @@ public class NattableaxisEditor
* @generated
*/
public void setSelection(ISelection selection) {
- this.editorSelection = selection;
+ editorSelection = selection;
- for (ISelectionChangedListener listener : this.selectionChangedListeners) {
+ for (ISelectionChangedListener listener : selectionChangedListeners) {
listener.selectionChanged(new SelectionChangedEvent(this, selection));
}
setStatusLineManager(selection);
@@ -1679,8 +1679,8 @@ public class NattableaxisEditor
* @generated
*/
public void setStatusLineManager(ISelection selection) {
- IStatusLineManager statusLineManager = this.currentViewer != null && this.currentViewer == this.contentOutlineViewer ?
- this.contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
+ IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
+ contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
if (statusLineManager != null) {
if (selection instanceof IStructuredSelection) {
@@ -1691,7 +1691,7 @@ public class NattableaxisEditor
break;
}
case 1: {
- String text = new AdapterFactoryItemDelegator(this.adapterFactory).getText(collection.iterator().next());
+ String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); //$NON-NLS-1$
break;
}
@@ -1761,7 +1761,7 @@ public class NattableaxisEditor
* @generated
*/
public AdapterFactory getAdapterFactory() {
- return this.adapterFactory;
+ return adapterFactory;
}
/**
@@ -1771,24 +1771,24 @@ public class NattableaxisEditor
*/
@Override
public void dispose() {
- this.updateProblemIndication = false;
+ updateProblemIndication = false;
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(this.resourceChangeListener);
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
- getSite().getPage().removePartListener(this.partListener);
+ getSite().getPage().removePartListener(partListener);
- this.adapterFactory.dispose();
+ adapterFactory.dispose();
if (getActionBarContributor().getActiveEditor() == this) {
getActionBarContributor().setActiveEditor(null);
}
- for (PropertySheetPage propertySheetPage : this.propertySheetPages) {
+ for (PropertySheetPage propertySheetPage : propertySheetPages) {
propertySheetPage.dispose();
}
- if (this.contentOutlinePage != null) {
- this.contentOutlinePage.dispose();
+ if (contentOutlinePage != null) {
+ contentOutlinePage.dispose();
}
super.dispose();
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/presentation/NattableaxisconfigurationEditor.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/presentation/NattableaxisconfigurationEditor.java
index 19b1b3a758a..31cabba6f22 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/presentation/NattableaxisconfigurationEditor.java
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisconfiguration/presentation/NattableaxisconfigurationEditor.java
@@ -306,14 +306,14 @@ public class NattableaxisconfigurationEditor
new IPartListener() {
public void partActivated(IWorkbenchPart p) {
if (p instanceof ContentOutline) {
- if (((ContentOutline)p).getCurrentPage() == NattableaxisconfigurationEditor.this.contentOutlinePage) {
+ if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) {
getActionBarContributor().setActiveEditor(NattableaxisconfigurationEditor.this);
- setCurrentViewer(NattableaxisconfigurationEditor.this.contentOutlineViewer);
+ setCurrentViewer(contentOutlineViewer);
}
}
else if (p instanceof PropertySheet) {
- if (NattableaxisconfigurationEditor.this.propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
+ if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
getActionBarContributor().setActiveEditor(NattableaxisconfigurationEditor.this);
handleActivate();
}
@@ -394,13 +394,13 @@ public class NattableaxisconfigurationEditor
Resource resource = (Resource)notification.getNotifier();
Diagnostic diagnostic = analyzeResourceProblems(resource, null);
if (diagnostic.getSeverity() != Diagnostic.OK) {
- NattableaxisconfigurationEditor.this.resourceToDiagnosticMap.put(resource, diagnostic);
+ resourceToDiagnosticMap.put(resource, diagnostic);
}
else {
- NattableaxisconfigurationEditor.this.resourceToDiagnosticMap.remove(resource);
+ resourceToDiagnosticMap.remove(resource);
}
- if (NattableaxisconfigurationEditor.this.updateProblemIndication) {
+ if (updateProblemIndication) {
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
@@ -425,8 +425,8 @@ public class NattableaxisconfigurationEditor
@Override
protected void unsetTarget(Resource target) {
basicUnsetTarget(target);
- NattableaxisconfigurationEditor.this.resourceToDiagnosticMap.remove(target);
- if (NattableaxisconfigurationEditor.this.updateProblemIndication) {
+ resourceToDiagnosticMap.remove(target);
+ if (updateProblemIndication) {
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
@@ -449,7 +449,7 @@ public class NattableaxisconfigurationEditor
IResourceDelta delta = event.getDelta();
try {
class ResourceDeltaVisitor implements IResourceDeltaVisitor {
- protected ResourceSet resourceSet = NattableaxisconfigurationEditor.this.editingDomain.getResourceSet();
+ protected ResourceSet resourceSet = editingDomain.getResourceSet();
protected Collection<Resource> changedResources = new ArrayList<Resource>();
protected Collection<Resource> removedResources = new ArrayList<Resource>();
@@ -457,13 +457,13 @@ public class NattableaxisconfigurationEditor
if (delta.getResource().getType() == IResource.FILE) {
if (delta.getKind() == IResourceDelta.REMOVED ||
delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
- Resource resource = this.resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
+ Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
if (resource != null) {
if (delta.getKind() == IResourceDelta.REMOVED) {
- this.removedResources.add(resource);
+ removedResources.add(resource);
}
- else if (!NattableaxisconfigurationEditor.this.savedResources.remove(resource)) {
- this.changedResources.add(resource);
+ else if (!savedResources.remove(resource)) {
+ changedResources.add(resource);
}
}
}
@@ -474,11 +474,11 @@ public class NattableaxisconfigurationEditor
}
public Collection<Resource> getChangedResources() {
- return this.changedResources;
+ return changedResources;
}
public Collection<Resource> getRemovedResources() {
- return this.removedResources;
+ return removedResources;
}
}
@@ -489,7 +489,7 @@ public class NattableaxisconfigurationEditor
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
- NattableaxisconfigurationEditor.this.removedResources.addAll(visitor.getRemovedResources());
+ removedResources.addAll(visitor.getRemovedResources());
if (!isDirty()) {
getSite().getPage().closeEditor(NattableaxisconfigurationEditor.this, false);
}
@@ -501,7 +501,7 @@ public class NattableaxisconfigurationEditor
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
- NattableaxisconfigurationEditor.this.changedResources.addAll(visitor.getChangedResources());
+ changedResources.addAll(visitor.getChangedResources());
if (getSite().getPage().getActiveEditor() == NattableaxisconfigurationEditor.this) {
handleActivate();
}
@@ -524,29 +524,29 @@ public class NattableaxisconfigurationEditor
protected void handleActivate() {
// Recompute the read only state.
//
- if (this.editingDomain.getResourceToReadOnlyMap() != null) {
- this.editingDomain.getResourceToReadOnlyMap().clear();
+ if (editingDomain.getResourceToReadOnlyMap() != null) {
+ editingDomain.getResourceToReadOnlyMap().clear();
// Refresh any actions that may become enabled or disabled.
//
setSelection(getSelection());
}
- if (!this.removedResources.isEmpty()) {
+ if (!removedResources.isEmpty()) {
if (handleDirtyConflict()) {
getSite().getPage().closeEditor(NattableaxisconfigurationEditor.this, false);
}
else {
- this.removedResources.clear();
- this.changedResources.clear();
- this.savedResources.clear();
+ removedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
}
}
- else if (!this.changedResources.isEmpty()) {
- this.changedResources.removeAll(this.savedResources);
+ else if (!changedResources.isEmpty()) {
+ changedResources.removeAll(savedResources);
handleChangedResources();
- this.changedResources.clear();
- this.savedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
}
}
@@ -557,32 +557,32 @@ public class NattableaxisconfigurationEditor
* @generated
*/
protected void handleChangedResources() {
- if (!this.changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
+ if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
if (isDirty()) {
- this.changedResources.addAll(this.editingDomain.getResourceSet().getResources());
+ changedResources.addAll(editingDomain.getResourceSet().getResources());
}
- this.editingDomain.getCommandStack().flush();
+ editingDomain.getCommandStack().flush();
- this.updateProblemIndication = false;
- for (Resource resource : this.changedResources) {
+ updateProblemIndication = false;
+ for (Resource resource : changedResources) {
if (resource.isLoaded()) {
resource.unload();
try {
resource.load(Collections.EMPTY_MAP);
}
catch (IOException exception) {
- if (!this.resourceToDiagnosticMap.containsKey(resource)) {
- this.resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ if (!resourceToDiagnosticMap.containsKey(resource)) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
}
}
}
}
- if (AdapterFactoryEditingDomain.isStale(this.editorSelection)) {
+ if (AdapterFactoryEditingDomain.isStale(editorSelection)) {
setSelection(StructuredSelection.EMPTY);
}
- this.updateProblemIndication = true;
+ updateProblemIndication = true;
updateProblemIndication();
}
}
@@ -594,15 +594,15 @@ public class NattableaxisconfigurationEditor
* @generated
*/
protected void updateProblemIndication() {
- if (this.updateProblemIndication) {
+ if (updateProblemIndication) {
BasicDiagnostic diagnostic =
new BasicDiagnostic
(Diagnostic.OK,
"org.eclipse.papyrus.infra.nattable.model.editor", //$NON-NLS-1$
0,
null,
- new Object [] { this.editingDomain.getResourceSet() });
- for (Diagnostic childDiagnostic : this.resourceToDiagnosticMap.values()) {
+ new Object [] { editingDomain.getResourceSet() });
+ for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) {
if (childDiagnostic.getSeverity() != Diagnostic.OK) {
diagnostic.add(childDiagnostic);
}
@@ -618,7 +618,7 @@ public class NattableaxisconfigurationEditor
else if (diagnostic.getSeverity() != Diagnostic.OK) {
ProblemEditorPart problemEditorPart = new ProblemEditorPart();
problemEditorPart.setDiagnostic(diagnostic);
- problemEditorPart.setMarkerHelper(this.markerHelper);
+ problemEditorPart.setMarkerHelper(markerHelper);
try {
addPage(++lastEditorPage, problemEditorPart, getEditorInput());
setPageText(lastEditorPage, problemEditorPart.getPartName());
@@ -630,11 +630,11 @@ public class NattableaxisconfigurationEditor
}
}
- if (this.markerHelper.hasMarkers(this.editingDomain.getResourceSet())) {
- this.markerHelper.deleteMarkers(this.editingDomain.getResourceSet());
+ if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
+ markerHelper.deleteMarkers(editingDomain.getResourceSet());
if (diagnostic.getSeverity() != Diagnostic.OK) {
try {
- this.markerHelper.createMarkers(diagnostic);
+ markerHelper.createMarkers(diagnostic);
}
catch (CoreException exception) {
NattableEditorPlugin.INSTANCE.log(exception);
@@ -678,18 +678,18 @@ public class NattableaxisconfigurationEditor
protected void initializeEditingDomain() {
// Create an adapter factory that yields item providers.
//
- this.adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
-
- this.adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableconfigurationItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableaxisproviderItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattablelabelproviderItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableaxisconfigurationItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattabletesterItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableaxisItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableconfigurationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableaxisproviderItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattablelabelproviderItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableaxisconfigurationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattabletesterItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableaxisItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
// Create the command stack that will notify this editor as commands are executed.
//
@@ -711,7 +711,7 @@ public class NattableaxisconfigurationEditor
if (mostRecentCommand != null) {
setSelectionToViewer(mostRecentCommand.getAffectedObjects());
}
- for (Iterator<PropertySheetPage> i = NattableaxisconfigurationEditor.this.propertySheetPages.iterator(); i.hasNext(); ) {
+ for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) {
PropertySheetPage propertySheetPage = i.next();
if (propertySheetPage.getControl().isDisposed()) {
i.remove();
@@ -727,7 +727,7 @@ public class NattableaxisconfigurationEditor
// Create the editing domain with a special command stack.
//
- this.editingDomain = new AdapterFactoryEditingDomain(this.adapterFactory, commandStack, new HashMap<Resource, Boolean>());
+ editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
}
/**
@@ -757,8 +757,8 @@ public class NattableaxisconfigurationEditor
public void run() {
// Try to select the items in the current content viewer of the editor.
//
- if (NattableaxisconfigurationEditor.this.currentViewer != null) {
- NattableaxisconfigurationEditor.this.currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
+ if (currentViewer != null) {
+ currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
}
}
};
@@ -775,7 +775,7 @@ public class NattableaxisconfigurationEditor
* @generated
*/
public EditingDomain getEditingDomain() {
- return this.editingDomain;
+ return editingDomain;
}
/**
@@ -843,13 +843,13 @@ public class NattableaxisconfigurationEditor
* @generated
*/
public void setCurrentViewerPane(ViewerPane viewerPane) {
- if (this.currentViewerPane != viewerPane) {
- if (this.currentViewerPane != null) {
- this.currentViewerPane.showFocus(false);
+ if (currentViewerPane != viewerPane) {
+ if (currentViewerPane != null) {
+ currentViewerPane.showFocus(false);
}
- this.currentViewerPane = viewerPane;
+ currentViewerPane = viewerPane;
}
- setCurrentViewer(this.currentViewerPane.getViewer());
+ setCurrentViewer(currentViewerPane.getViewer());
}
/**
@@ -862,11 +862,11 @@ public class NattableaxisconfigurationEditor
public void setCurrentViewer(Viewer viewer) {
// If it is changing...
//
- if (this.currentViewer != viewer) {
- if (this.selectionChangedListener == null) {
+ if (currentViewer != viewer) {
+ if (selectionChangedListener == null) {
// Create the listener on demand.
//
- this.selectionChangedListener =
+ selectionChangedListener =
new ISelectionChangedListener() {
// This just notifies those things that are affected by the section.
//
@@ -878,23 +878,23 @@ public class NattableaxisconfigurationEditor
// Stop listening to the old one.
//
- if (this.currentViewer != null) {
- this.currentViewer.removeSelectionChangedListener(this.selectionChangedListener);
+ if (currentViewer != null) {
+ currentViewer.removeSelectionChangedListener(selectionChangedListener);
}
// Start listening to the new one.
//
if (viewer != null) {
- viewer.addSelectionChangedListener(this.selectionChangedListener);
+ viewer.addSelectionChangedListener(selectionChangedListener);
}
// Remember it.
//
- this.currentViewer = viewer;
+ currentViewer = viewer;
// Set the editors selection based on the current viewer's selection.
//
- setSelection(this.currentViewer == null ? StructuredSelection.EMPTY : this.currentViewer.getSelection());
+ setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection());
}
}
@@ -905,7 +905,7 @@ public class NattableaxisconfigurationEditor
* @generated
*/
public Viewer getViewer() {
- return this.currentViewer;
+ return currentViewer;
}
/**
@@ -926,7 +926,7 @@ public class NattableaxisconfigurationEditor
int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() };
viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
- viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(this.editingDomain, viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
}
/**
@@ -942,18 +942,18 @@ public class NattableaxisconfigurationEditor
try {
// Load the resource through the editing domain.
//
- resource = this.editingDomain.getResourceSet().getResource(resourceURI, true);
+ resource = editingDomain.getResourceSet().getResource(resourceURI, true);
}
catch (Exception e) {
exception = e;
- resource = this.editingDomain.getResourceSet().getResource(resourceURI, false);
+ resource = editingDomain.getResourceSet().getResource(resourceURI, false);
}
Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
if (diagnostic.getSeverity() != Diagnostic.OK) {
- this.resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
}
- this.editingDomain.getResourceSet().eAdapters().add(this.problemIndicationAdapter);
+ editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
}
/**
@@ -1023,17 +1023,17 @@ public class NattableaxisconfigurationEditor
};
viewerPane.createControl(getContainer());
- this.selectionViewer = (TreeViewer)viewerPane.getViewer();
- this.selectionViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
+ selectionViewer = (TreeViewer)viewerPane.getViewer();
+ selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
- this.selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
- this.selectionViewer.setInput(this.editingDomain.getResourceSet());
- this.selectionViewer.setSelection(new StructuredSelection(this.editingDomain.getResourceSet().getResources().get(0)), true);
- viewerPane.setTitle(this.editingDomain.getResourceSet());
+ selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ selectionViewer.setInput(editingDomain.getResourceSet());
+ selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ viewerPane.setTitle(editingDomain.getResourceSet());
- new AdapterFactoryTreeEditor(this.selectionViewer.getTree(), this.adapterFactory);
+ new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
- createContextMenuFor(this.selectionViewer);
+ createContextMenuFor(selectionViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_SelectionPage_label")); //$NON-NLS-1$
}
@@ -1057,12 +1057,12 @@ public class NattableaxisconfigurationEditor
};
viewerPane.createControl(getContainer());
- this.parentViewer = (TreeViewer)viewerPane.getViewer();
- this.parentViewer.setAutoExpandLevel(30);
- this.parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(this.adapterFactory));
- this.parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ parentViewer = (TreeViewer)viewerPane.getViewer();
+ parentViewer.setAutoExpandLevel(30);
+ parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
+ parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.parentViewer);
+ createContextMenuFor(parentViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_ParentPage_label")); //$NON-NLS-1$
}
@@ -1083,11 +1083,11 @@ public class NattableaxisconfigurationEditor
}
};
viewerPane.createControl(getContainer());
- this.listViewer = (ListViewer)viewerPane.getViewer();
- this.listViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.listViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ listViewer = (ListViewer)viewerPane.getViewer();
+ listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.listViewer);
+ createContextMenuFor(listViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_ListPage_label")); //$NON-NLS-1$
}
@@ -1108,13 +1108,13 @@ public class NattableaxisconfigurationEditor
}
};
viewerPane.createControl(getContainer());
- this.treeViewer = (TreeViewer)viewerPane.getViewer();
- this.treeViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ treeViewer = (TreeViewer)viewerPane.getViewer();
+ treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- new AdapterFactoryTreeEditor(this.treeViewer.getTree(), this.adapterFactory);
+ new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
- createContextMenuFor(this.treeViewer);
+ createContextMenuFor(treeViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TreePage_label")); //$NON-NLS-1$
}
@@ -1135,9 +1135,9 @@ public class NattableaxisconfigurationEditor
}
};
viewerPane.createControl(getContainer());
- this.tableViewer = (TableViewer)viewerPane.getViewer();
+ tableViewer = (TableViewer)viewerPane.getViewer();
- Table table = this.tableViewer.getTable();
+ Table table = tableViewer.getTable();
TableLayout layout = new TableLayout();
table.setLayout(layout);
table.setHeaderVisible(true);
@@ -1153,11 +1153,11 @@ public class NattableaxisconfigurationEditor
selfColumn.setText(getString("_UI_SelfColumn_label")); //$NON-NLS-1$
selfColumn.setResizable(true);
- this.tableViewer.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
- this.tableViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ tableViewer.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
+ tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.tableViewer);
+ createContextMenuFor(tableViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TablePage_label")); //$NON-NLS-1$
}
@@ -1179,9 +1179,9 @@ public class NattableaxisconfigurationEditor
};
viewerPane.createControl(getContainer());
- this.treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
+ treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
- Tree tree = this.treeViewerWithColumns.getTree();
+ Tree tree = treeViewerWithColumns.getTree();
tree.setLayoutData(new FillLayout());
tree.setHeaderVisible(true);
tree.setLinesVisible(true);
@@ -1196,11 +1196,11 @@ public class NattableaxisconfigurationEditor
selfColumn.setResizable(true);
selfColumn.setWidth(200);
- this.treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
- this.treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
+ treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.treeViewerWithColumns);
+ createContextMenuFor(treeViewerWithColumns);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label")); //$NON-NLS-1$
}
@@ -1221,10 +1221,10 @@ public class NattableaxisconfigurationEditor
boolean guard = false;
@Override
public void controlResized(ControlEvent event) {
- if (!this.guard) {
- this.guard = true;
+ if (!guard) {
+ guard = true;
hideTabs();
- this.guard = false;
+ guard = false;
}
}
});
@@ -1283,8 +1283,8 @@ public class NattableaxisconfigurationEditor
protected void pageChange(int pageIndex) {
super.pageChange(pageIndex);
- if (this.contentOutlinePage != null) {
- handleContentOutlineSelection(this.contentOutlinePage.getSelection());
+ if (contentOutlinePage != null) {
+ handleContentOutlineSelection(contentOutlinePage.getSelection());
}
}
@@ -1318,37 +1318,37 @@ public class NattableaxisconfigurationEditor
* @generated
*/
public IContentOutlinePage getContentOutlinePage() {
- if (this.contentOutlinePage == null) {
+ if (contentOutlinePage == null) {
// The content outline is just a tree.
//
class MyContentOutlinePage extends ContentOutlinePage {
@Override
public void createControl(Composite parent) {
super.createControl(parent);
- NattableaxisconfigurationEditor.this.contentOutlineViewer = getTreeViewer();
- NattableaxisconfigurationEditor.this.contentOutlineViewer.addSelectionChangedListener(this);
+ contentOutlineViewer = getTreeViewer();
+ contentOutlineViewer.addSelectionChangedListener(this);
// Set up the tree viewer.
//
- NattableaxisconfigurationEditor.this.contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(NattableaxisconfigurationEditor.this.adapterFactory));
- NattableaxisconfigurationEditor.this.contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(NattableaxisconfigurationEditor.this.adapterFactory));
- NattableaxisconfigurationEditor.this.contentOutlineViewer.setInput(NattableaxisconfigurationEditor.this.editingDomain.getResourceSet());
+ contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ contentOutlineViewer.setInput(editingDomain.getResourceSet());
// Make sure our popups work.
//
- createContextMenuFor(NattableaxisconfigurationEditor.this.contentOutlineViewer);
+ createContextMenuFor(contentOutlineViewer);
- if (!NattableaxisconfigurationEditor.this.editingDomain.getResourceSet().getResources().isEmpty()) {
+ if (!editingDomain.getResourceSet().getResources().isEmpty()) {
// Select the root object in the view.
//
- NattableaxisconfigurationEditor.this.contentOutlineViewer.setSelection(new StructuredSelection(NattableaxisconfigurationEditor.this.editingDomain.getResourceSet().getResources().get(0)), true);
+ contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
}
}
@Override
public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
super.makeContributions(menuManager, toolBarManager, statusLineManager);
- NattableaxisconfigurationEditor.this.contentOutlineStatusLineManager = statusLineManager;
+ contentOutlineStatusLineManager = statusLineManager;
}
@Override
@@ -1358,11 +1358,11 @@ public class NattableaxisconfigurationEditor
}
}
- this.contentOutlinePage = new MyContentOutlinePage();
+ contentOutlinePage = new MyContentOutlinePage();
// Listen to selection so that we can handle it is a special way.
//
- this.contentOutlinePage.addSelectionChangedListener
+ contentOutlinePage.addSelectionChangedListener
(new ISelectionChangedListener() {
// This ensures that we handle selections correctly.
//
@@ -1372,7 +1372,7 @@ public class NattableaxisconfigurationEditor
});
}
- return this.contentOutlinePage;
+ return contentOutlinePage;
}
/**
@@ -1383,7 +1383,7 @@ public class NattableaxisconfigurationEditor
*/
public IPropertySheetPage getPropertySheetPage() {
PropertySheetPage propertySheetPage =
- new ExtendedPropertySheetPage(this.editingDomain) {
+ new ExtendedPropertySheetPage(editingDomain) {
@Override
public void setSelectionToViewer(List<?> selection) {
NattableaxisconfigurationEditor.this.setSelectionToViewer(selection);
@@ -1396,8 +1396,8 @@ public class NattableaxisconfigurationEditor
getActionBarContributor().shareGlobalActions(this, actionBars);
}
};
- propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.propertySheetPages.add(propertySheetPage);
+ propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
+ propertySheetPages.add(propertySheetPage);
return propertySheetPage;
}
@@ -1409,7 +1409,7 @@ public class NattableaxisconfigurationEditor
* @generated
*/
public void handleContentOutlineSelection(ISelection selection) {
- if (this.currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
+ if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
if (selectedElements.hasNext()) {
// Get the first selected element.
@@ -1418,7 +1418,7 @@ public class NattableaxisconfigurationEditor
// If it's the selection viewer, then we want it to select the same selection as this selection.
//
- if (this.currentViewerPane.getViewer() == this.selectionViewer) {
+ if (currentViewerPane.getViewer() == selectionViewer) {
ArrayList<Object> selectionList = new ArrayList<Object>();
selectionList.add(selectedElement);
while (selectedElements.hasNext()) {
@@ -1427,14 +1427,14 @@ public class NattableaxisconfigurationEditor
// Set the selection to the widget.
//
- this.selectionViewer.setSelection(new StructuredSelection(selectionList));
+ selectionViewer.setSelection(new StructuredSelection(selectionList));
}
else {
// Set the input to the widget.
//
- if (this.currentViewerPane.getViewer().getInput() != selectedElement) {
- this.currentViewerPane.getViewer().setInput(selectedElement);
- this.currentViewerPane.setTitle(selectedElement);
+ if (currentViewerPane.getViewer().getInput() != selectedElement) {
+ currentViewerPane.getViewer().setInput(selectedElement);
+ currentViewerPane.setTitle(selectedElement);
}
}
}
@@ -1449,7 +1449,7 @@ public class NattableaxisconfigurationEditor
*/
@Override
public boolean isDirty() {
- return ((BasicCommandStack)this.editingDomain.getCommandStack()).isSaveNeeded();
+ return ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();
}
/**
@@ -1526,7 +1526,7 @@ public class NattableaxisconfigurationEditor
protected boolean isPersisted(Resource resource) {
boolean result = false;
try {
- InputStream stream = this.editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
+ InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
if (stream != null) {
result = true;
stream.close();
@@ -1574,7 +1574,7 @@ public class NattableaxisconfigurationEditor
* @generated
*/
protected void doSaveAs(URI uri, IEditorInput editorInput) {
- (this.editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
+ (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
setInputWithNotify(editorInput);
setPartName(editorInput.getName());
IProgressMonitor progressMonitor =
@@ -1590,7 +1590,7 @@ public class NattableaxisconfigurationEditor
* @generated
*/
public void gotoMarker(IMarker marker) {
- List<?> targetObjects = this.markerHelper.getTargetObjects(this.editingDomain, marker);
+ List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker);
if (!targetObjects.isEmpty()) {
setSelectionToViewer(targetObjects);
}
@@ -1608,8 +1608,8 @@ public class NattableaxisconfigurationEditor
setInputWithNotify(editorInput);
setPartName(editorInput.getName());
site.setSelectionProvider(this);
- site.getPage().addPartListener(this.partListener);
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this.resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+ site.getPage().addPartListener(partListener);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
}
/**
@@ -1619,8 +1619,8 @@ public class NattableaxisconfigurationEditor
*/
@Override
public void setFocus() {
- if (this.currentViewerPane != null) {
- this.currentViewerPane.setFocus();
+ if (currentViewerPane != null) {
+ currentViewerPane.setFocus();
}
else {
getControl(getActivePage()).setFocus();
@@ -1634,7 +1634,7 @@ public class NattableaxisconfigurationEditor
* @generated
*/
public void addSelectionChangedListener(ISelectionChangedListener listener) {
- this.selectionChangedListeners.add(listener);
+ selectionChangedListeners.add(listener);
}
/**
@@ -1644,7 +1644,7 @@ public class NattableaxisconfigurationEditor
* @generated
*/
public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- this.selectionChangedListeners.remove(listener);
+ selectionChangedListeners.remove(listener);
}
/**
@@ -1654,7 +1654,7 @@ public class NattableaxisconfigurationEditor
* @generated
*/
public ISelection getSelection() {
- return this.editorSelection;
+ return editorSelection;
}
/**
@@ -1665,9 +1665,9 @@ public class NattableaxisconfigurationEditor
* @generated
*/
public void setSelection(ISelection selection) {
- this.editorSelection = selection;
+ editorSelection = selection;
- for (ISelectionChangedListener listener : this.selectionChangedListeners) {
+ for (ISelectionChangedListener listener : selectionChangedListeners) {
listener.selectionChanged(new SelectionChangedEvent(this, selection));
}
setStatusLineManager(selection);
@@ -1679,8 +1679,8 @@ public class NattableaxisconfigurationEditor
* @generated
*/
public void setStatusLineManager(ISelection selection) {
- IStatusLineManager statusLineManager = this.currentViewer != null && this.currentViewer == this.contentOutlineViewer ?
- this.contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
+ IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
+ contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
if (statusLineManager != null) {
if (selection instanceof IStructuredSelection) {
@@ -1691,7 +1691,7 @@ public class NattableaxisconfigurationEditor
break;
}
case 1: {
- String text = new AdapterFactoryItemDelegator(this.adapterFactory).getText(collection.iterator().next());
+ String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); //$NON-NLS-1$
break;
}
@@ -1761,7 +1761,7 @@ public class NattableaxisconfigurationEditor
* @generated
*/
public AdapterFactory getAdapterFactory() {
- return this.adapterFactory;
+ return adapterFactory;
}
/**
@@ -1771,24 +1771,24 @@ public class NattableaxisconfigurationEditor
*/
@Override
public void dispose() {
- this.updateProblemIndication = false;
+ updateProblemIndication = false;
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(this.resourceChangeListener);
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
- getSite().getPage().removePartListener(this.partListener);
+ getSite().getPage().removePartListener(partListener);
- this.adapterFactory.dispose();
+ adapterFactory.dispose();
if (getActionBarContributor().getActiveEditor() == this) {
getActionBarContributor().setActiveEditor(null);
}
- for (PropertySheetPage propertySheetPage : this.propertySheetPages) {
+ for (PropertySheetPage propertySheetPage : propertySheetPages) {
propertySheetPage.dispose();
}
- if (this.contentOutlinePage != null) {
- this.contentOutlinePage.dispose();
+ if (contentOutlinePage != null) {
+ contentOutlinePage.dispose();
}
super.dispose();
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisprovider/presentation/NattableaxisproviderEditor.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisprovider/presentation/NattableaxisproviderEditor.java
index 4a34dd991d9..ebb05d41110 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisprovider/presentation/NattableaxisproviderEditor.java
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisprovider/presentation/NattableaxisproviderEditor.java
@@ -306,14 +306,14 @@ public class NattableaxisproviderEditor
new IPartListener() {
public void partActivated(IWorkbenchPart p) {
if (p instanceof ContentOutline) {
- if (((ContentOutline)p).getCurrentPage() == NattableaxisproviderEditor.this.contentOutlinePage) {
+ if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) {
getActionBarContributor().setActiveEditor(NattableaxisproviderEditor.this);
- setCurrentViewer(NattableaxisproviderEditor.this.contentOutlineViewer);
+ setCurrentViewer(contentOutlineViewer);
}
}
else if (p instanceof PropertySheet) {
- if (NattableaxisproviderEditor.this.propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
+ if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
getActionBarContributor().setActiveEditor(NattableaxisproviderEditor.this);
handleActivate();
}
@@ -394,13 +394,13 @@ public class NattableaxisproviderEditor
Resource resource = (Resource)notification.getNotifier();
Diagnostic diagnostic = analyzeResourceProblems(resource, null);
if (diagnostic.getSeverity() != Diagnostic.OK) {
- NattableaxisproviderEditor.this.resourceToDiagnosticMap.put(resource, diagnostic);
+ resourceToDiagnosticMap.put(resource, diagnostic);
}
else {
- NattableaxisproviderEditor.this.resourceToDiagnosticMap.remove(resource);
+ resourceToDiagnosticMap.remove(resource);
}
- if (NattableaxisproviderEditor.this.updateProblemIndication) {
+ if (updateProblemIndication) {
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
@@ -425,8 +425,8 @@ public class NattableaxisproviderEditor
@Override
protected void unsetTarget(Resource target) {
basicUnsetTarget(target);
- NattableaxisproviderEditor.this.resourceToDiagnosticMap.remove(target);
- if (NattableaxisproviderEditor.this.updateProblemIndication) {
+ resourceToDiagnosticMap.remove(target);
+ if (updateProblemIndication) {
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
@@ -449,7 +449,7 @@ public class NattableaxisproviderEditor
IResourceDelta delta = event.getDelta();
try {
class ResourceDeltaVisitor implements IResourceDeltaVisitor {
- protected ResourceSet resourceSet = NattableaxisproviderEditor.this.editingDomain.getResourceSet();
+ protected ResourceSet resourceSet = editingDomain.getResourceSet();
protected Collection<Resource> changedResources = new ArrayList<Resource>();
protected Collection<Resource> removedResources = new ArrayList<Resource>();
@@ -457,13 +457,13 @@ public class NattableaxisproviderEditor
if (delta.getResource().getType() == IResource.FILE) {
if (delta.getKind() == IResourceDelta.REMOVED ||
delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
- Resource resource = this.resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
+ Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
if (resource != null) {
if (delta.getKind() == IResourceDelta.REMOVED) {
- this.removedResources.add(resource);
+ removedResources.add(resource);
}
- else if (!NattableaxisproviderEditor.this.savedResources.remove(resource)) {
- this.changedResources.add(resource);
+ else if (!savedResources.remove(resource)) {
+ changedResources.add(resource);
}
}
}
@@ -474,11 +474,11 @@ public class NattableaxisproviderEditor
}
public Collection<Resource> getChangedResources() {
- return this.changedResources;
+ return changedResources;
}
public Collection<Resource> getRemovedResources() {
- return this.removedResources;
+ return removedResources;
}
}
@@ -489,7 +489,7 @@ public class NattableaxisproviderEditor
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
- NattableaxisproviderEditor.this.removedResources.addAll(visitor.getRemovedResources());
+ removedResources.addAll(visitor.getRemovedResources());
if (!isDirty()) {
getSite().getPage().closeEditor(NattableaxisproviderEditor.this, false);
}
@@ -501,7 +501,7 @@ public class NattableaxisproviderEditor
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
- NattableaxisproviderEditor.this.changedResources.addAll(visitor.getChangedResources());
+ changedResources.addAll(visitor.getChangedResources());
if (getSite().getPage().getActiveEditor() == NattableaxisproviderEditor.this) {
handleActivate();
}
@@ -524,29 +524,29 @@ public class NattableaxisproviderEditor
protected void handleActivate() {
// Recompute the read only state.
//
- if (this.editingDomain.getResourceToReadOnlyMap() != null) {
- this.editingDomain.getResourceToReadOnlyMap().clear();
+ if (editingDomain.getResourceToReadOnlyMap() != null) {
+ editingDomain.getResourceToReadOnlyMap().clear();
// Refresh any actions that may become enabled or disabled.
//
setSelection(getSelection());
}
- if (!this.removedResources.isEmpty()) {
+ if (!removedResources.isEmpty()) {
if (handleDirtyConflict()) {
getSite().getPage().closeEditor(NattableaxisproviderEditor.this, false);
}
else {
- this.removedResources.clear();
- this.changedResources.clear();
- this.savedResources.clear();
+ removedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
}
}
- else if (!this.changedResources.isEmpty()) {
- this.changedResources.removeAll(this.savedResources);
+ else if (!changedResources.isEmpty()) {
+ changedResources.removeAll(savedResources);
handleChangedResources();
- this.changedResources.clear();
- this.savedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
}
}
@@ -557,32 +557,32 @@ public class NattableaxisproviderEditor
* @generated
*/
protected void handleChangedResources() {
- if (!this.changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
+ if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
if (isDirty()) {
- this.changedResources.addAll(this.editingDomain.getResourceSet().getResources());
+ changedResources.addAll(editingDomain.getResourceSet().getResources());
}
- this.editingDomain.getCommandStack().flush();
+ editingDomain.getCommandStack().flush();
- this.updateProblemIndication = false;
- for (Resource resource : this.changedResources) {
+ updateProblemIndication = false;
+ for (Resource resource : changedResources) {
if (resource.isLoaded()) {
resource.unload();
try {
resource.load(Collections.EMPTY_MAP);
}
catch (IOException exception) {
- if (!this.resourceToDiagnosticMap.containsKey(resource)) {
- this.resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ if (!resourceToDiagnosticMap.containsKey(resource)) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
}
}
}
}
- if (AdapterFactoryEditingDomain.isStale(this.editorSelection)) {
+ if (AdapterFactoryEditingDomain.isStale(editorSelection)) {
setSelection(StructuredSelection.EMPTY);
}
- this.updateProblemIndication = true;
+ updateProblemIndication = true;
updateProblemIndication();
}
}
@@ -594,15 +594,15 @@ public class NattableaxisproviderEditor
* @generated
*/
protected void updateProblemIndication() {
- if (this.updateProblemIndication) {
+ if (updateProblemIndication) {
BasicDiagnostic diagnostic =
new BasicDiagnostic
(Diagnostic.OK,
"org.eclipse.papyrus.infra.nattable.model.editor", //$NON-NLS-1$
0,
null,
- new Object [] { this.editingDomain.getResourceSet() });
- for (Diagnostic childDiagnostic : this.resourceToDiagnosticMap.values()) {
+ new Object [] { editingDomain.getResourceSet() });
+ for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) {
if (childDiagnostic.getSeverity() != Diagnostic.OK) {
diagnostic.add(childDiagnostic);
}
@@ -618,7 +618,7 @@ public class NattableaxisproviderEditor
else if (diagnostic.getSeverity() != Diagnostic.OK) {
ProblemEditorPart problemEditorPart = new ProblemEditorPart();
problemEditorPart.setDiagnostic(diagnostic);
- problemEditorPart.setMarkerHelper(this.markerHelper);
+ problemEditorPart.setMarkerHelper(markerHelper);
try {
addPage(++lastEditorPage, problemEditorPart, getEditorInput());
setPageText(lastEditorPage, problemEditorPart.getPartName());
@@ -630,11 +630,11 @@ public class NattableaxisproviderEditor
}
}
- if (this.markerHelper.hasMarkers(this.editingDomain.getResourceSet())) {
- this.markerHelper.deleteMarkers(this.editingDomain.getResourceSet());
+ if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
+ markerHelper.deleteMarkers(editingDomain.getResourceSet());
if (diagnostic.getSeverity() != Diagnostic.OK) {
try {
- this.markerHelper.createMarkers(diagnostic);
+ markerHelper.createMarkers(diagnostic);
}
catch (CoreException exception) {
NattableEditorPlugin.INSTANCE.log(exception);
@@ -678,18 +678,18 @@ public class NattableaxisproviderEditor
protected void initializeEditingDomain() {
// Create an adapter factory that yields item providers.
//
- this.adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
-
- this.adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableconfigurationItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableaxisproviderItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattablelabelproviderItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableaxisconfigurationItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattabletesterItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableaxisItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableconfigurationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableaxisproviderItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattablelabelproviderItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableaxisconfigurationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattabletesterItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableaxisItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
// Create the command stack that will notify this editor as commands are executed.
//
@@ -711,7 +711,7 @@ public class NattableaxisproviderEditor
if (mostRecentCommand != null) {
setSelectionToViewer(mostRecentCommand.getAffectedObjects());
}
- for (Iterator<PropertySheetPage> i = NattableaxisproviderEditor.this.propertySheetPages.iterator(); i.hasNext(); ) {
+ for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) {
PropertySheetPage propertySheetPage = i.next();
if (propertySheetPage.getControl().isDisposed()) {
i.remove();
@@ -727,7 +727,7 @@ public class NattableaxisproviderEditor
// Create the editing domain with a special command stack.
//
- this.editingDomain = new AdapterFactoryEditingDomain(this.adapterFactory, commandStack, new HashMap<Resource, Boolean>());
+ editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
}
/**
@@ -757,8 +757,8 @@ public class NattableaxisproviderEditor
public void run() {
// Try to select the items in the current content viewer of the editor.
//
- if (NattableaxisproviderEditor.this.currentViewer != null) {
- NattableaxisproviderEditor.this.currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
+ if (currentViewer != null) {
+ currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
}
}
};
@@ -775,7 +775,7 @@ public class NattableaxisproviderEditor
* @generated
*/
public EditingDomain getEditingDomain() {
- return this.editingDomain;
+ return editingDomain;
}
/**
@@ -843,13 +843,13 @@ public class NattableaxisproviderEditor
* @generated
*/
public void setCurrentViewerPane(ViewerPane viewerPane) {
- if (this.currentViewerPane != viewerPane) {
- if (this.currentViewerPane != null) {
- this.currentViewerPane.showFocus(false);
+ if (currentViewerPane != viewerPane) {
+ if (currentViewerPane != null) {
+ currentViewerPane.showFocus(false);
}
- this.currentViewerPane = viewerPane;
+ currentViewerPane = viewerPane;
}
- setCurrentViewer(this.currentViewerPane.getViewer());
+ setCurrentViewer(currentViewerPane.getViewer());
}
/**
@@ -862,11 +862,11 @@ public class NattableaxisproviderEditor
public void setCurrentViewer(Viewer viewer) {
// If it is changing...
//
- if (this.currentViewer != viewer) {
- if (this.selectionChangedListener == null) {
+ if (currentViewer != viewer) {
+ if (selectionChangedListener == null) {
// Create the listener on demand.
//
- this.selectionChangedListener =
+ selectionChangedListener =
new ISelectionChangedListener() {
// This just notifies those things that are affected by the section.
//
@@ -878,23 +878,23 @@ public class NattableaxisproviderEditor
// Stop listening to the old one.
//
- if (this.currentViewer != null) {
- this.currentViewer.removeSelectionChangedListener(this.selectionChangedListener);
+ if (currentViewer != null) {
+ currentViewer.removeSelectionChangedListener(selectionChangedListener);
}
// Start listening to the new one.
//
if (viewer != null) {
- viewer.addSelectionChangedListener(this.selectionChangedListener);
+ viewer.addSelectionChangedListener(selectionChangedListener);
}
// Remember it.
//
- this.currentViewer = viewer;
+ currentViewer = viewer;
// Set the editors selection based on the current viewer's selection.
//
- setSelection(this.currentViewer == null ? StructuredSelection.EMPTY : this.currentViewer.getSelection());
+ setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection());
}
}
@@ -905,7 +905,7 @@ public class NattableaxisproviderEditor
* @generated
*/
public Viewer getViewer() {
- return this.currentViewer;
+ return currentViewer;
}
/**
@@ -926,7 +926,7 @@ public class NattableaxisproviderEditor
int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() };
viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
- viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(this.editingDomain, viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
}
/**
@@ -942,18 +942,18 @@ public class NattableaxisproviderEditor
try {
// Load the resource through the editing domain.
//
- resource = this.editingDomain.getResourceSet().getResource(resourceURI, true);
+ resource = editingDomain.getResourceSet().getResource(resourceURI, true);
}
catch (Exception e) {
exception = e;
- resource = this.editingDomain.getResourceSet().getResource(resourceURI, false);
+ resource = editingDomain.getResourceSet().getResource(resourceURI, false);
}
Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
if (diagnostic.getSeverity() != Diagnostic.OK) {
- this.resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
}
- this.editingDomain.getResourceSet().eAdapters().add(this.problemIndicationAdapter);
+ editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
}
/**
@@ -1023,17 +1023,17 @@ public class NattableaxisproviderEditor
};
viewerPane.createControl(getContainer());
- this.selectionViewer = (TreeViewer)viewerPane.getViewer();
- this.selectionViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
+ selectionViewer = (TreeViewer)viewerPane.getViewer();
+ selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
- this.selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
- this.selectionViewer.setInput(this.editingDomain.getResourceSet());
- this.selectionViewer.setSelection(new StructuredSelection(this.editingDomain.getResourceSet().getResources().get(0)), true);
- viewerPane.setTitle(this.editingDomain.getResourceSet());
+ selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ selectionViewer.setInput(editingDomain.getResourceSet());
+ selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ viewerPane.setTitle(editingDomain.getResourceSet());
- new AdapterFactoryTreeEditor(this.selectionViewer.getTree(), this.adapterFactory);
+ new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
- createContextMenuFor(this.selectionViewer);
+ createContextMenuFor(selectionViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_SelectionPage_label")); //$NON-NLS-1$
}
@@ -1057,12 +1057,12 @@ public class NattableaxisproviderEditor
};
viewerPane.createControl(getContainer());
- this.parentViewer = (TreeViewer)viewerPane.getViewer();
- this.parentViewer.setAutoExpandLevel(30);
- this.parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(this.adapterFactory));
- this.parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ parentViewer = (TreeViewer)viewerPane.getViewer();
+ parentViewer.setAutoExpandLevel(30);
+ parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
+ parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.parentViewer);
+ createContextMenuFor(parentViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_ParentPage_label")); //$NON-NLS-1$
}
@@ -1083,11 +1083,11 @@ public class NattableaxisproviderEditor
}
};
viewerPane.createControl(getContainer());
- this.listViewer = (ListViewer)viewerPane.getViewer();
- this.listViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.listViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ listViewer = (ListViewer)viewerPane.getViewer();
+ listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.listViewer);
+ createContextMenuFor(listViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_ListPage_label")); //$NON-NLS-1$
}
@@ -1108,13 +1108,13 @@ public class NattableaxisproviderEditor
}
};
viewerPane.createControl(getContainer());
- this.treeViewer = (TreeViewer)viewerPane.getViewer();
- this.treeViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ treeViewer = (TreeViewer)viewerPane.getViewer();
+ treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- new AdapterFactoryTreeEditor(this.treeViewer.getTree(), this.adapterFactory);
+ new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
- createContextMenuFor(this.treeViewer);
+ createContextMenuFor(treeViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TreePage_label")); //$NON-NLS-1$
}
@@ -1135,9 +1135,9 @@ public class NattableaxisproviderEditor
}
};
viewerPane.createControl(getContainer());
- this.tableViewer = (TableViewer)viewerPane.getViewer();
+ tableViewer = (TableViewer)viewerPane.getViewer();
- Table table = this.tableViewer.getTable();
+ Table table = tableViewer.getTable();
TableLayout layout = new TableLayout();
table.setLayout(layout);
table.setHeaderVisible(true);
@@ -1153,11 +1153,11 @@ public class NattableaxisproviderEditor
selfColumn.setText(getString("_UI_SelfColumn_label")); //$NON-NLS-1$
selfColumn.setResizable(true);
- this.tableViewer.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
- this.tableViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ tableViewer.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
+ tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.tableViewer);
+ createContextMenuFor(tableViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TablePage_label")); //$NON-NLS-1$
}
@@ -1179,9 +1179,9 @@ public class NattableaxisproviderEditor
};
viewerPane.createControl(getContainer());
- this.treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
+ treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
- Tree tree = this.treeViewerWithColumns.getTree();
+ Tree tree = treeViewerWithColumns.getTree();
tree.setLayoutData(new FillLayout());
tree.setHeaderVisible(true);
tree.setLinesVisible(true);
@@ -1196,11 +1196,11 @@ public class NattableaxisproviderEditor
selfColumn.setResizable(true);
selfColumn.setWidth(200);
- this.treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
- this.treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
+ treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.treeViewerWithColumns);
+ createContextMenuFor(treeViewerWithColumns);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label")); //$NON-NLS-1$
}
@@ -1221,10 +1221,10 @@ public class NattableaxisproviderEditor
boolean guard = false;
@Override
public void controlResized(ControlEvent event) {
- if (!this.guard) {
- this.guard = true;
+ if (!guard) {
+ guard = true;
hideTabs();
- this.guard = false;
+ guard = false;
}
}
});
@@ -1283,8 +1283,8 @@ public class NattableaxisproviderEditor
protected void pageChange(int pageIndex) {
super.pageChange(pageIndex);
- if (this.contentOutlinePage != null) {
- handleContentOutlineSelection(this.contentOutlinePage.getSelection());
+ if (contentOutlinePage != null) {
+ handleContentOutlineSelection(contentOutlinePage.getSelection());
}
}
@@ -1318,37 +1318,37 @@ public class NattableaxisproviderEditor
* @generated
*/
public IContentOutlinePage getContentOutlinePage() {
- if (this.contentOutlinePage == null) {
+ if (contentOutlinePage == null) {
// The content outline is just a tree.
//
class MyContentOutlinePage extends ContentOutlinePage {
@Override
public void createControl(Composite parent) {
super.createControl(parent);
- NattableaxisproviderEditor.this.contentOutlineViewer = getTreeViewer();
- NattableaxisproviderEditor.this.contentOutlineViewer.addSelectionChangedListener(this);
+ contentOutlineViewer = getTreeViewer();
+ contentOutlineViewer.addSelectionChangedListener(this);
// Set up the tree viewer.
//
- NattableaxisproviderEditor.this.contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(NattableaxisproviderEditor.this.adapterFactory));
- NattableaxisproviderEditor.this.contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(NattableaxisproviderEditor.this.adapterFactory));
- NattableaxisproviderEditor.this.contentOutlineViewer.setInput(NattableaxisproviderEditor.this.editingDomain.getResourceSet());
+ contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ contentOutlineViewer.setInput(editingDomain.getResourceSet());
// Make sure our popups work.
//
- createContextMenuFor(NattableaxisproviderEditor.this.contentOutlineViewer);
+ createContextMenuFor(contentOutlineViewer);
- if (!NattableaxisproviderEditor.this.editingDomain.getResourceSet().getResources().isEmpty()) {
+ if (!editingDomain.getResourceSet().getResources().isEmpty()) {
// Select the root object in the view.
//
- NattableaxisproviderEditor.this.contentOutlineViewer.setSelection(new StructuredSelection(NattableaxisproviderEditor.this.editingDomain.getResourceSet().getResources().get(0)), true);
+ contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
}
}
@Override
public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
super.makeContributions(menuManager, toolBarManager, statusLineManager);
- NattableaxisproviderEditor.this.contentOutlineStatusLineManager = statusLineManager;
+ contentOutlineStatusLineManager = statusLineManager;
}
@Override
@@ -1358,11 +1358,11 @@ public class NattableaxisproviderEditor
}
}
- this.contentOutlinePage = new MyContentOutlinePage();
+ contentOutlinePage = new MyContentOutlinePage();
// Listen to selection so that we can handle it is a special way.
//
- this.contentOutlinePage.addSelectionChangedListener
+ contentOutlinePage.addSelectionChangedListener
(new ISelectionChangedListener() {
// This ensures that we handle selections correctly.
//
@@ -1372,7 +1372,7 @@ public class NattableaxisproviderEditor
});
}
- return this.contentOutlinePage;
+ return contentOutlinePage;
}
/**
@@ -1383,7 +1383,7 @@ public class NattableaxisproviderEditor
*/
public IPropertySheetPage getPropertySheetPage() {
PropertySheetPage propertySheetPage =
- new ExtendedPropertySheetPage(this.editingDomain) {
+ new ExtendedPropertySheetPage(editingDomain) {
@Override
public void setSelectionToViewer(List<?> selection) {
NattableaxisproviderEditor.this.setSelectionToViewer(selection);
@@ -1396,8 +1396,8 @@ public class NattableaxisproviderEditor
getActionBarContributor().shareGlobalActions(this, actionBars);
}
};
- propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.propertySheetPages.add(propertySheetPage);
+ propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
+ propertySheetPages.add(propertySheetPage);
return propertySheetPage;
}
@@ -1409,7 +1409,7 @@ public class NattableaxisproviderEditor
* @generated
*/
public void handleContentOutlineSelection(ISelection selection) {
- if (this.currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
+ if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
if (selectedElements.hasNext()) {
// Get the first selected element.
@@ -1418,7 +1418,7 @@ public class NattableaxisproviderEditor
// If it's the selection viewer, then we want it to select the same selection as this selection.
//
- if (this.currentViewerPane.getViewer() == this.selectionViewer) {
+ if (currentViewerPane.getViewer() == selectionViewer) {
ArrayList<Object> selectionList = new ArrayList<Object>();
selectionList.add(selectedElement);
while (selectedElements.hasNext()) {
@@ -1427,14 +1427,14 @@ public class NattableaxisproviderEditor
// Set the selection to the widget.
//
- this.selectionViewer.setSelection(new StructuredSelection(selectionList));
+ selectionViewer.setSelection(new StructuredSelection(selectionList));
}
else {
// Set the input to the widget.
//
- if (this.currentViewerPane.getViewer().getInput() != selectedElement) {
- this.currentViewerPane.getViewer().setInput(selectedElement);
- this.currentViewerPane.setTitle(selectedElement);
+ if (currentViewerPane.getViewer().getInput() != selectedElement) {
+ currentViewerPane.getViewer().setInput(selectedElement);
+ currentViewerPane.setTitle(selectedElement);
}
}
}
@@ -1449,7 +1449,7 @@ public class NattableaxisproviderEditor
*/
@Override
public boolean isDirty() {
- return ((BasicCommandStack)this.editingDomain.getCommandStack()).isSaveNeeded();
+ return ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();
}
/**
@@ -1526,7 +1526,7 @@ public class NattableaxisproviderEditor
protected boolean isPersisted(Resource resource) {
boolean result = false;
try {
- InputStream stream = this.editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
+ InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
if (stream != null) {
result = true;
stream.close();
@@ -1574,7 +1574,7 @@ public class NattableaxisproviderEditor
* @generated
*/
protected void doSaveAs(URI uri, IEditorInput editorInput) {
- (this.editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
+ (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
setInputWithNotify(editorInput);
setPartName(editorInput.getName());
IProgressMonitor progressMonitor =
@@ -1590,7 +1590,7 @@ public class NattableaxisproviderEditor
* @generated
*/
public void gotoMarker(IMarker marker) {
- List<?> targetObjects = this.markerHelper.getTargetObjects(this.editingDomain, marker);
+ List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker);
if (!targetObjects.isEmpty()) {
setSelectionToViewer(targetObjects);
}
@@ -1608,8 +1608,8 @@ public class NattableaxisproviderEditor
setInputWithNotify(editorInput);
setPartName(editorInput.getName());
site.setSelectionProvider(this);
- site.getPage().addPartListener(this.partListener);
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this.resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+ site.getPage().addPartListener(partListener);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
}
/**
@@ -1619,8 +1619,8 @@ public class NattableaxisproviderEditor
*/
@Override
public void setFocus() {
- if (this.currentViewerPane != null) {
- this.currentViewerPane.setFocus();
+ if (currentViewerPane != null) {
+ currentViewerPane.setFocus();
}
else {
getControl(getActivePage()).setFocus();
@@ -1634,7 +1634,7 @@ public class NattableaxisproviderEditor
* @generated
*/
public void addSelectionChangedListener(ISelectionChangedListener listener) {
- this.selectionChangedListeners.add(listener);
+ selectionChangedListeners.add(listener);
}
/**
@@ -1644,7 +1644,7 @@ public class NattableaxisproviderEditor
* @generated
*/
public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- this.selectionChangedListeners.remove(listener);
+ selectionChangedListeners.remove(listener);
}
/**
@@ -1654,7 +1654,7 @@ public class NattableaxisproviderEditor
* @generated
*/
public ISelection getSelection() {
- return this.editorSelection;
+ return editorSelection;
}
/**
@@ -1665,9 +1665,9 @@ public class NattableaxisproviderEditor
* @generated
*/
public void setSelection(ISelection selection) {
- this.editorSelection = selection;
+ editorSelection = selection;
- for (ISelectionChangedListener listener : this.selectionChangedListeners) {
+ for (ISelectionChangedListener listener : selectionChangedListeners) {
listener.selectionChanged(new SelectionChangedEvent(this, selection));
}
setStatusLineManager(selection);
@@ -1679,8 +1679,8 @@ public class NattableaxisproviderEditor
* @generated
*/
public void setStatusLineManager(ISelection selection) {
- IStatusLineManager statusLineManager = this.currentViewer != null && this.currentViewer == this.contentOutlineViewer ?
- this.contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
+ IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
+ contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
if (statusLineManager != null) {
if (selection instanceof IStructuredSelection) {
@@ -1691,7 +1691,7 @@ public class NattableaxisproviderEditor
break;
}
case 1: {
- String text = new AdapterFactoryItemDelegator(this.adapterFactory).getText(collection.iterator().next());
+ String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); //$NON-NLS-1$
break;
}
@@ -1761,7 +1761,7 @@ public class NattableaxisproviderEditor
* @generated
*/
public AdapterFactory getAdapterFactory() {
- return this.adapterFactory;
+ return adapterFactory;
}
/**
@@ -1771,24 +1771,24 @@ public class NattableaxisproviderEditor
*/
@Override
public void dispose() {
- this.updateProblemIndication = false;
+ updateProblemIndication = false;
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(this.resourceChangeListener);
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
- getSite().getPage().removePartListener(this.partListener);
+ getSite().getPage().removePartListener(partListener);
- this.adapterFactory.dispose();
+ adapterFactory.dispose();
if (getActionBarContributor().getActiveEditor() == this) {
getActionBarContributor().setActiveEditor(null);
}
- for (PropertySheetPage propertySheetPage : this.propertySheetPages) {
+ for (PropertySheetPage propertySheetPage : propertySheetPages) {
propertySheetPage.dispose();
}
- if (this.contentOutlinePage != null) {
- this.contentOutlinePage.dispose();
+ if (contentOutlinePage != null) {
+ contentOutlinePage.dispose();
}
super.dispose();
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableconfiguration/presentation/NattableconfigurationEditor.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableconfiguration/presentation/NattableconfigurationEditor.java
index 24b18eab902..9d2f655e62c 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableconfiguration/presentation/NattableconfigurationEditor.java
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableconfiguration/presentation/NattableconfigurationEditor.java
@@ -306,14 +306,14 @@ public class NattableconfigurationEditor
new IPartListener() {
public void partActivated(IWorkbenchPart p) {
if (p instanceof ContentOutline) {
- if (((ContentOutline)p).getCurrentPage() == NattableconfigurationEditor.this.contentOutlinePage) {
+ if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) {
getActionBarContributor().setActiveEditor(NattableconfigurationEditor.this);
- setCurrentViewer(NattableconfigurationEditor.this.contentOutlineViewer);
+ setCurrentViewer(contentOutlineViewer);
}
}
else if (p instanceof PropertySheet) {
- if (NattableconfigurationEditor.this.propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
+ if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
getActionBarContributor().setActiveEditor(NattableconfigurationEditor.this);
handleActivate();
}
@@ -394,13 +394,13 @@ public class NattableconfigurationEditor
Resource resource = (Resource)notification.getNotifier();
Diagnostic diagnostic = analyzeResourceProblems(resource, null);
if (diagnostic.getSeverity() != Diagnostic.OK) {
- NattableconfigurationEditor.this.resourceToDiagnosticMap.put(resource, diagnostic);
+ resourceToDiagnosticMap.put(resource, diagnostic);
}
else {
- NattableconfigurationEditor.this.resourceToDiagnosticMap.remove(resource);
+ resourceToDiagnosticMap.remove(resource);
}
- if (NattableconfigurationEditor.this.updateProblemIndication) {
+ if (updateProblemIndication) {
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
@@ -425,8 +425,8 @@ public class NattableconfigurationEditor
@Override
protected void unsetTarget(Resource target) {
basicUnsetTarget(target);
- NattableconfigurationEditor.this.resourceToDiagnosticMap.remove(target);
- if (NattableconfigurationEditor.this.updateProblemIndication) {
+ resourceToDiagnosticMap.remove(target);
+ if (updateProblemIndication) {
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
@@ -449,7 +449,7 @@ public class NattableconfigurationEditor
IResourceDelta delta = event.getDelta();
try {
class ResourceDeltaVisitor implements IResourceDeltaVisitor {
- protected ResourceSet resourceSet = NattableconfigurationEditor.this.editingDomain.getResourceSet();
+ protected ResourceSet resourceSet = editingDomain.getResourceSet();
protected Collection<Resource> changedResources = new ArrayList<Resource>();
protected Collection<Resource> removedResources = new ArrayList<Resource>();
@@ -457,13 +457,13 @@ public class NattableconfigurationEditor
if (delta.getResource().getType() == IResource.FILE) {
if (delta.getKind() == IResourceDelta.REMOVED ||
delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
- Resource resource = this.resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
+ Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
if (resource != null) {
if (delta.getKind() == IResourceDelta.REMOVED) {
- this.removedResources.add(resource);
+ removedResources.add(resource);
}
- else if (!NattableconfigurationEditor.this.savedResources.remove(resource)) {
- this.changedResources.add(resource);
+ else if (!savedResources.remove(resource)) {
+ changedResources.add(resource);
}
}
}
@@ -474,11 +474,11 @@ public class NattableconfigurationEditor
}
public Collection<Resource> getChangedResources() {
- return this.changedResources;
+ return changedResources;
}
public Collection<Resource> getRemovedResources() {
- return this.removedResources;
+ return removedResources;
}
}
@@ -489,7 +489,7 @@ public class NattableconfigurationEditor
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
- NattableconfigurationEditor.this.removedResources.addAll(visitor.getRemovedResources());
+ removedResources.addAll(visitor.getRemovedResources());
if (!isDirty()) {
getSite().getPage().closeEditor(NattableconfigurationEditor.this, false);
}
@@ -501,7 +501,7 @@ public class NattableconfigurationEditor
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
- NattableconfigurationEditor.this.changedResources.addAll(visitor.getChangedResources());
+ changedResources.addAll(visitor.getChangedResources());
if (getSite().getPage().getActiveEditor() == NattableconfigurationEditor.this) {
handleActivate();
}
@@ -524,29 +524,29 @@ public class NattableconfigurationEditor
protected void handleActivate() {
// Recompute the read only state.
//
- if (this.editingDomain.getResourceToReadOnlyMap() != null) {
- this.editingDomain.getResourceToReadOnlyMap().clear();
+ if (editingDomain.getResourceToReadOnlyMap() != null) {
+ editingDomain.getResourceToReadOnlyMap().clear();
// Refresh any actions that may become enabled or disabled.
//
setSelection(getSelection());
}
- if (!this.removedResources.isEmpty()) {
+ if (!removedResources.isEmpty()) {
if (handleDirtyConflict()) {
getSite().getPage().closeEditor(NattableconfigurationEditor.this, false);
}
else {
- this.removedResources.clear();
- this.changedResources.clear();
- this.savedResources.clear();
+ removedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
}
}
- else if (!this.changedResources.isEmpty()) {
- this.changedResources.removeAll(this.savedResources);
+ else if (!changedResources.isEmpty()) {
+ changedResources.removeAll(savedResources);
handleChangedResources();
- this.changedResources.clear();
- this.savedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
}
}
@@ -557,32 +557,32 @@ public class NattableconfigurationEditor
* @generated
*/
protected void handleChangedResources() {
- if (!this.changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
+ if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
if (isDirty()) {
- this.changedResources.addAll(this.editingDomain.getResourceSet().getResources());
+ changedResources.addAll(editingDomain.getResourceSet().getResources());
}
- this.editingDomain.getCommandStack().flush();
+ editingDomain.getCommandStack().flush();
- this.updateProblemIndication = false;
- for (Resource resource : this.changedResources) {
+ updateProblemIndication = false;
+ for (Resource resource : changedResources) {
if (resource.isLoaded()) {
resource.unload();
try {
resource.load(Collections.EMPTY_MAP);
}
catch (IOException exception) {
- if (!this.resourceToDiagnosticMap.containsKey(resource)) {
- this.resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ if (!resourceToDiagnosticMap.containsKey(resource)) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
}
}
}
}
- if (AdapterFactoryEditingDomain.isStale(this.editorSelection)) {
+ if (AdapterFactoryEditingDomain.isStale(editorSelection)) {
setSelection(StructuredSelection.EMPTY);
}
- this.updateProblemIndication = true;
+ updateProblemIndication = true;
updateProblemIndication();
}
}
@@ -594,15 +594,15 @@ public class NattableconfigurationEditor
* @generated
*/
protected void updateProblemIndication() {
- if (this.updateProblemIndication) {
+ if (updateProblemIndication) {
BasicDiagnostic diagnostic =
new BasicDiagnostic
(Diagnostic.OK,
"org.eclipse.papyrus.infra.nattable.model.editor", //$NON-NLS-1$
0,
null,
- new Object [] { this.editingDomain.getResourceSet() });
- for (Diagnostic childDiagnostic : this.resourceToDiagnosticMap.values()) {
+ new Object [] { editingDomain.getResourceSet() });
+ for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) {
if (childDiagnostic.getSeverity() != Diagnostic.OK) {
diagnostic.add(childDiagnostic);
}
@@ -618,7 +618,7 @@ public class NattableconfigurationEditor
else if (diagnostic.getSeverity() != Diagnostic.OK) {
ProblemEditorPart problemEditorPart = new ProblemEditorPart();
problemEditorPart.setDiagnostic(diagnostic);
- problemEditorPart.setMarkerHelper(this.markerHelper);
+ problemEditorPart.setMarkerHelper(markerHelper);
try {
addPage(++lastEditorPage, problemEditorPart, getEditorInput());
setPageText(lastEditorPage, problemEditorPart.getPartName());
@@ -630,11 +630,11 @@ public class NattableconfigurationEditor
}
}
- if (this.markerHelper.hasMarkers(this.editingDomain.getResourceSet())) {
- this.markerHelper.deleteMarkers(this.editingDomain.getResourceSet());
+ if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
+ markerHelper.deleteMarkers(editingDomain.getResourceSet());
if (diagnostic.getSeverity() != Diagnostic.OK) {
try {
- this.markerHelper.createMarkers(diagnostic);
+ markerHelper.createMarkers(diagnostic);
}
catch (CoreException exception) {
NattableEditorPlugin.INSTANCE.log(exception);
@@ -678,18 +678,18 @@ public class NattableconfigurationEditor
protected void initializeEditingDomain() {
// Create an adapter factory that yields item providers.
//
- this.adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
-
- this.adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableconfigurationItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableaxisproviderItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattablelabelproviderItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableaxisconfigurationItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattabletesterItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableaxisItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableconfigurationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableaxisproviderItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattablelabelproviderItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableaxisconfigurationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattabletesterItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableaxisItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
// Create the command stack that will notify this editor as commands are executed.
//
@@ -711,7 +711,7 @@ public class NattableconfigurationEditor
if (mostRecentCommand != null) {
setSelectionToViewer(mostRecentCommand.getAffectedObjects());
}
- for (Iterator<PropertySheetPage> i = NattableconfigurationEditor.this.propertySheetPages.iterator(); i.hasNext(); ) {
+ for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) {
PropertySheetPage propertySheetPage = i.next();
if (propertySheetPage.getControl().isDisposed()) {
i.remove();
@@ -727,7 +727,7 @@ public class NattableconfigurationEditor
// Create the editing domain with a special command stack.
//
- this.editingDomain = new AdapterFactoryEditingDomain(this.adapterFactory, commandStack, new HashMap<Resource, Boolean>());
+ editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
}
/**
@@ -757,8 +757,8 @@ public class NattableconfigurationEditor
public void run() {
// Try to select the items in the current content viewer of the editor.
//
- if (NattableconfigurationEditor.this.currentViewer != null) {
- NattableconfigurationEditor.this.currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
+ if (currentViewer != null) {
+ currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
}
}
};
@@ -775,7 +775,7 @@ public class NattableconfigurationEditor
* @generated
*/
public EditingDomain getEditingDomain() {
- return this.editingDomain;
+ return editingDomain;
}
/**
@@ -843,13 +843,13 @@ public class NattableconfigurationEditor
* @generated
*/
public void setCurrentViewerPane(ViewerPane viewerPane) {
- if (this.currentViewerPane != viewerPane) {
- if (this.currentViewerPane != null) {
- this.currentViewerPane.showFocus(false);
+ if (currentViewerPane != viewerPane) {
+ if (currentViewerPane != null) {
+ currentViewerPane.showFocus(false);
}
- this.currentViewerPane = viewerPane;
+ currentViewerPane = viewerPane;
}
- setCurrentViewer(this.currentViewerPane.getViewer());
+ setCurrentViewer(currentViewerPane.getViewer());
}
/**
@@ -862,11 +862,11 @@ public class NattableconfigurationEditor
public void setCurrentViewer(Viewer viewer) {
// If it is changing...
//
- if (this.currentViewer != viewer) {
- if (this.selectionChangedListener == null) {
+ if (currentViewer != viewer) {
+ if (selectionChangedListener == null) {
// Create the listener on demand.
//
- this.selectionChangedListener =
+ selectionChangedListener =
new ISelectionChangedListener() {
// This just notifies those things that are affected by the section.
//
@@ -878,23 +878,23 @@ public class NattableconfigurationEditor
// Stop listening to the old one.
//
- if (this.currentViewer != null) {
- this.currentViewer.removeSelectionChangedListener(this.selectionChangedListener);
+ if (currentViewer != null) {
+ currentViewer.removeSelectionChangedListener(selectionChangedListener);
}
// Start listening to the new one.
//
if (viewer != null) {
- viewer.addSelectionChangedListener(this.selectionChangedListener);
+ viewer.addSelectionChangedListener(selectionChangedListener);
}
// Remember it.
//
- this.currentViewer = viewer;
+ currentViewer = viewer;
// Set the editors selection based on the current viewer's selection.
//
- setSelection(this.currentViewer == null ? StructuredSelection.EMPTY : this.currentViewer.getSelection());
+ setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection());
}
}
@@ -905,7 +905,7 @@ public class NattableconfigurationEditor
* @generated
*/
public Viewer getViewer() {
- return this.currentViewer;
+ return currentViewer;
}
/**
@@ -926,7 +926,7 @@ public class NattableconfigurationEditor
int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() };
viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
- viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(this.editingDomain, viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
}
/**
@@ -942,18 +942,18 @@ public class NattableconfigurationEditor
try {
// Load the resource through the editing domain.
//
- resource = this.editingDomain.getResourceSet().getResource(resourceURI, true);
+ resource = editingDomain.getResourceSet().getResource(resourceURI, true);
}
catch (Exception e) {
exception = e;
- resource = this.editingDomain.getResourceSet().getResource(resourceURI, false);
+ resource = editingDomain.getResourceSet().getResource(resourceURI, false);
}
Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
if (diagnostic.getSeverity() != Diagnostic.OK) {
- this.resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
}
- this.editingDomain.getResourceSet().eAdapters().add(this.problemIndicationAdapter);
+ editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
}
/**
@@ -1023,17 +1023,17 @@ public class NattableconfigurationEditor
};
viewerPane.createControl(getContainer());
- this.selectionViewer = (TreeViewer)viewerPane.getViewer();
- this.selectionViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
+ selectionViewer = (TreeViewer)viewerPane.getViewer();
+ selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
- this.selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
- this.selectionViewer.setInput(this.editingDomain.getResourceSet());
- this.selectionViewer.setSelection(new StructuredSelection(this.editingDomain.getResourceSet().getResources().get(0)), true);
- viewerPane.setTitle(this.editingDomain.getResourceSet());
+ selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ selectionViewer.setInput(editingDomain.getResourceSet());
+ selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ viewerPane.setTitle(editingDomain.getResourceSet());
- new AdapterFactoryTreeEditor(this.selectionViewer.getTree(), this.adapterFactory);
+ new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
- createContextMenuFor(this.selectionViewer);
+ createContextMenuFor(selectionViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_SelectionPage_label")); //$NON-NLS-1$
}
@@ -1057,12 +1057,12 @@ public class NattableconfigurationEditor
};
viewerPane.createControl(getContainer());
- this.parentViewer = (TreeViewer)viewerPane.getViewer();
- this.parentViewer.setAutoExpandLevel(30);
- this.parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(this.adapterFactory));
- this.parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ parentViewer = (TreeViewer)viewerPane.getViewer();
+ parentViewer.setAutoExpandLevel(30);
+ parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
+ parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.parentViewer);
+ createContextMenuFor(parentViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_ParentPage_label")); //$NON-NLS-1$
}
@@ -1083,11 +1083,11 @@ public class NattableconfigurationEditor
}
};
viewerPane.createControl(getContainer());
- this.listViewer = (ListViewer)viewerPane.getViewer();
- this.listViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.listViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ listViewer = (ListViewer)viewerPane.getViewer();
+ listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.listViewer);
+ createContextMenuFor(listViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_ListPage_label")); //$NON-NLS-1$
}
@@ -1108,13 +1108,13 @@ public class NattableconfigurationEditor
}
};
viewerPane.createControl(getContainer());
- this.treeViewer = (TreeViewer)viewerPane.getViewer();
- this.treeViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ treeViewer = (TreeViewer)viewerPane.getViewer();
+ treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- new AdapterFactoryTreeEditor(this.treeViewer.getTree(), this.adapterFactory);
+ new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
- createContextMenuFor(this.treeViewer);
+ createContextMenuFor(treeViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TreePage_label")); //$NON-NLS-1$
}
@@ -1135,9 +1135,9 @@ public class NattableconfigurationEditor
}
};
viewerPane.createControl(getContainer());
- this.tableViewer = (TableViewer)viewerPane.getViewer();
+ tableViewer = (TableViewer)viewerPane.getViewer();
- Table table = this.tableViewer.getTable();
+ Table table = tableViewer.getTable();
TableLayout layout = new TableLayout();
table.setLayout(layout);
table.setHeaderVisible(true);
@@ -1153,11 +1153,11 @@ public class NattableconfigurationEditor
selfColumn.setText(getString("_UI_SelfColumn_label")); //$NON-NLS-1$
selfColumn.setResizable(true);
- this.tableViewer.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
- this.tableViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ tableViewer.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
+ tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.tableViewer);
+ createContextMenuFor(tableViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TablePage_label")); //$NON-NLS-1$
}
@@ -1179,9 +1179,9 @@ public class NattableconfigurationEditor
};
viewerPane.createControl(getContainer());
- this.treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
+ treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
- Tree tree = this.treeViewerWithColumns.getTree();
+ Tree tree = treeViewerWithColumns.getTree();
tree.setLayoutData(new FillLayout());
tree.setHeaderVisible(true);
tree.setLinesVisible(true);
@@ -1196,11 +1196,11 @@ public class NattableconfigurationEditor
selfColumn.setResizable(true);
selfColumn.setWidth(200);
- this.treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
- this.treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
+ treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.treeViewerWithColumns);
+ createContextMenuFor(treeViewerWithColumns);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label")); //$NON-NLS-1$
}
@@ -1221,10 +1221,10 @@ public class NattableconfigurationEditor
boolean guard = false;
@Override
public void controlResized(ControlEvent event) {
- if (!this.guard) {
- this.guard = true;
+ if (!guard) {
+ guard = true;
hideTabs();
- this.guard = false;
+ guard = false;
}
}
});
@@ -1283,8 +1283,8 @@ public class NattableconfigurationEditor
protected void pageChange(int pageIndex) {
super.pageChange(pageIndex);
- if (this.contentOutlinePage != null) {
- handleContentOutlineSelection(this.contentOutlinePage.getSelection());
+ if (contentOutlinePage != null) {
+ handleContentOutlineSelection(contentOutlinePage.getSelection());
}
}
@@ -1318,37 +1318,37 @@ public class NattableconfigurationEditor
* @generated
*/
public IContentOutlinePage getContentOutlinePage() {
- if (this.contentOutlinePage == null) {
+ if (contentOutlinePage == null) {
// The content outline is just a tree.
//
class MyContentOutlinePage extends ContentOutlinePage {
@Override
public void createControl(Composite parent) {
super.createControl(parent);
- NattableconfigurationEditor.this.contentOutlineViewer = getTreeViewer();
- NattableconfigurationEditor.this.contentOutlineViewer.addSelectionChangedListener(this);
+ contentOutlineViewer = getTreeViewer();
+ contentOutlineViewer.addSelectionChangedListener(this);
// Set up the tree viewer.
//
- NattableconfigurationEditor.this.contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(NattableconfigurationEditor.this.adapterFactory));
- NattableconfigurationEditor.this.contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(NattableconfigurationEditor.this.adapterFactory));
- NattableconfigurationEditor.this.contentOutlineViewer.setInput(NattableconfigurationEditor.this.editingDomain.getResourceSet());
+ contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ contentOutlineViewer.setInput(editingDomain.getResourceSet());
// Make sure our popups work.
//
- createContextMenuFor(NattableconfigurationEditor.this.contentOutlineViewer);
+ createContextMenuFor(contentOutlineViewer);
- if (!NattableconfigurationEditor.this.editingDomain.getResourceSet().getResources().isEmpty()) {
+ if (!editingDomain.getResourceSet().getResources().isEmpty()) {
// Select the root object in the view.
//
- NattableconfigurationEditor.this.contentOutlineViewer.setSelection(new StructuredSelection(NattableconfigurationEditor.this.editingDomain.getResourceSet().getResources().get(0)), true);
+ contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
}
}
@Override
public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
super.makeContributions(menuManager, toolBarManager, statusLineManager);
- NattableconfigurationEditor.this.contentOutlineStatusLineManager = statusLineManager;
+ contentOutlineStatusLineManager = statusLineManager;
}
@Override
@@ -1358,11 +1358,11 @@ public class NattableconfigurationEditor
}
}
- this.contentOutlinePage = new MyContentOutlinePage();
+ contentOutlinePage = new MyContentOutlinePage();
// Listen to selection so that we can handle it is a special way.
//
- this.contentOutlinePage.addSelectionChangedListener
+ contentOutlinePage.addSelectionChangedListener
(new ISelectionChangedListener() {
// This ensures that we handle selections correctly.
//
@@ -1372,7 +1372,7 @@ public class NattableconfigurationEditor
});
}
- return this.contentOutlinePage;
+ return contentOutlinePage;
}
/**
@@ -1383,7 +1383,7 @@ public class NattableconfigurationEditor
*/
public IPropertySheetPage getPropertySheetPage() {
PropertySheetPage propertySheetPage =
- new ExtendedPropertySheetPage(this.editingDomain) {
+ new ExtendedPropertySheetPage(editingDomain) {
@Override
public void setSelectionToViewer(List<?> selection) {
NattableconfigurationEditor.this.setSelectionToViewer(selection);
@@ -1396,8 +1396,8 @@ public class NattableconfigurationEditor
getActionBarContributor().shareGlobalActions(this, actionBars);
}
};
- propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.propertySheetPages.add(propertySheetPage);
+ propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
+ propertySheetPages.add(propertySheetPage);
return propertySheetPage;
}
@@ -1409,7 +1409,7 @@ public class NattableconfigurationEditor
* @generated
*/
public void handleContentOutlineSelection(ISelection selection) {
- if (this.currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
+ if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
if (selectedElements.hasNext()) {
// Get the first selected element.
@@ -1418,7 +1418,7 @@ public class NattableconfigurationEditor
// If it's the selection viewer, then we want it to select the same selection as this selection.
//
- if (this.currentViewerPane.getViewer() == this.selectionViewer) {
+ if (currentViewerPane.getViewer() == selectionViewer) {
ArrayList<Object> selectionList = new ArrayList<Object>();
selectionList.add(selectedElement);
while (selectedElements.hasNext()) {
@@ -1427,14 +1427,14 @@ public class NattableconfigurationEditor
// Set the selection to the widget.
//
- this.selectionViewer.setSelection(new StructuredSelection(selectionList));
+ selectionViewer.setSelection(new StructuredSelection(selectionList));
}
else {
// Set the input to the widget.
//
- if (this.currentViewerPane.getViewer().getInput() != selectedElement) {
- this.currentViewerPane.getViewer().setInput(selectedElement);
- this.currentViewerPane.setTitle(selectedElement);
+ if (currentViewerPane.getViewer().getInput() != selectedElement) {
+ currentViewerPane.getViewer().setInput(selectedElement);
+ currentViewerPane.setTitle(selectedElement);
}
}
}
@@ -1449,7 +1449,7 @@ public class NattableconfigurationEditor
*/
@Override
public boolean isDirty() {
- return ((BasicCommandStack)this.editingDomain.getCommandStack()).isSaveNeeded();
+ return ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();
}
/**
@@ -1526,7 +1526,7 @@ public class NattableconfigurationEditor
protected boolean isPersisted(Resource resource) {
boolean result = false;
try {
- InputStream stream = this.editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
+ InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
if (stream != null) {
result = true;
stream.close();
@@ -1574,7 +1574,7 @@ public class NattableconfigurationEditor
* @generated
*/
protected void doSaveAs(URI uri, IEditorInput editorInput) {
- (this.editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
+ (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
setInputWithNotify(editorInput);
setPartName(editorInput.getName());
IProgressMonitor progressMonitor =
@@ -1590,7 +1590,7 @@ public class NattableconfigurationEditor
* @generated
*/
public void gotoMarker(IMarker marker) {
- List<?> targetObjects = this.markerHelper.getTargetObjects(this.editingDomain, marker);
+ List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker);
if (!targetObjects.isEmpty()) {
setSelectionToViewer(targetObjects);
}
@@ -1608,8 +1608,8 @@ public class NattableconfigurationEditor
setInputWithNotify(editorInput);
setPartName(editorInput.getName());
site.setSelectionProvider(this);
- site.getPage().addPartListener(this.partListener);
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this.resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+ site.getPage().addPartListener(partListener);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
}
/**
@@ -1619,8 +1619,8 @@ public class NattableconfigurationEditor
*/
@Override
public void setFocus() {
- if (this.currentViewerPane != null) {
- this.currentViewerPane.setFocus();
+ if (currentViewerPane != null) {
+ currentViewerPane.setFocus();
}
else {
getControl(getActivePage()).setFocus();
@@ -1634,7 +1634,7 @@ public class NattableconfigurationEditor
* @generated
*/
public void addSelectionChangedListener(ISelectionChangedListener listener) {
- this.selectionChangedListeners.add(listener);
+ selectionChangedListeners.add(listener);
}
/**
@@ -1644,7 +1644,7 @@ public class NattableconfigurationEditor
* @generated
*/
public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- this.selectionChangedListeners.remove(listener);
+ selectionChangedListeners.remove(listener);
}
/**
@@ -1654,7 +1654,7 @@ public class NattableconfigurationEditor
* @generated
*/
public ISelection getSelection() {
- return this.editorSelection;
+ return editorSelection;
}
/**
@@ -1665,9 +1665,9 @@ public class NattableconfigurationEditor
* @generated
*/
public void setSelection(ISelection selection) {
- this.editorSelection = selection;
+ editorSelection = selection;
- for (ISelectionChangedListener listener : this.selectionChangedListeners) {
+ for (ISelectionChangedListener listener : selectionChangedListeners) {
listener.selectionChanged(new SelectionChangedEvent(this, selection));
}
setStatusLineManager(selection);
@@ -1679,8 +1679,8 @@ public class NattableconfigurationEditor
* @generated
*/
public void setStatusLineManager(ISelection selection) {
- IStatusLineManager statusLineManager = this.currentViewer != null && this.currentViewer == this.contentOutlineViewer ?
- this.contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
+ IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
+ contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
if (statusLineManager != null) {
if (selection instanceof IStructuredSelection) {
@@ -1691,7 +1691,7 @@ public class NattableconfigurationEditor
break;
}
case 1: {
- String text = new AdapterFactoryItemDelegator(this.adapterFactory).getText(collection.iterator().next());
+ String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); //$NON-NLS-1$
break;
}
@@ -1761,7 +1761,7 @@ public class NattableconfigurationEditor
* @generated
*/
public AdapterFactory getAdapterFactory() {
- return this.adapterFactory;
+ return adapterFactory;
}
/**
@@ -1771,24 +1771,24 @@ public class NattableconfigurationEditor
*/
@Override
public void dispose() {
- this.updateProblemIndication = false;
+ updateProblemIndication = false;
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(this.resourceChangeListener);
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
- getSite().getPage().removePartListener(this.partListener);
+ getSite().getPage().removePartListener(partListener);
- this.adapterFactory.dispose();
+ adapterFactory.dispose();
if (getActionBarContributor().getActiveEditor() == this) {
getActionBarContributor().setActiveEditor(null);
}
- for (PropertySheetPage propertySheetPage : this.propertySheetPages) {
+ for (PropertySheetPage propertySheetPage : propertySheetPages) {
propertySheetPage.dispose();
}
- if (this.contentOutlinePage != null) {
- this.contentOutlinePage.dispose();
+ if (contentOutlinePage != null) {
+ contentOutlinePage.dispose();
}
super.dispose();
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattablelabelprovider/presentation/NattablelabelproviderEditor.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattablelabelprovider/presentation/NattablelabelproviderEditor.java
index 34f862a1ab6..f0a3de228af 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattablelabelprovider/presentation/NattablelabelproviderEditor.java
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattablelabelprovider/presentation/NattablelabelproviderEditor.java
@@ -306,14 +306,14 @@ public class NattablelabelproviderEditor
new IPartListener() {
public void partActivated(IWorkbenchPart p) {
if (p instanceof ContentOutline) {
- if (((ContentOutline)p).getCurrentPage() == NattablelabelproviderEditor.this.contentOutlinePage) {
+ if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) {
getActionBarContributor().setActiveEditor(NattablelabelproviderEditor.this);
- setCurrentViewer(NattablelabelproviderEditor.this.contentOutlineViewer);
+ setCurrentViewer(contentOutlineViewer);
}
}
else if (p instanceof PropertySheet) {
- if (NattablelabelproviderEditor.this.propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
+ if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
getActionBarContributor().setActiveEditor(NattablelabelproviderEditor.this);
handleActivate();
}
@@ -394,13 +394,13 @@ public class NattablelabelproviderEditor
Resource resource = (Resource)notification.getNotifier();
Diagnostic diagnostic = analyzeResourceProblems(resource, null);
if (diagnostic.getSeverity() != Diagnostic.OK) {
- NattablelabelproviderEditor.this.resourceToDiagnosticMap.put(resource, diagnostic);
+ resourceToDiagnosticMap.put(resource, diagnostic);
}
else {
- NattablelabelproviderEditor.this.resourceToDiagnosticMap.remove(resource);
+ resourceToDiagnosticMap.remove(resource);
}
- if (NattablelabelproviderEditor.this.updateProblemIndication) {
+ if (updateProblemIndication) {
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
@@ -425,8 +425,8 @@ public class NattablelabelproviderEditor
@Override
protected void unsetTarget(Resource target) {
basicUnsetTarget(target);
- NattablelabelproviderEditor.this.resourceToDiagnosticMap.remove(target);
- if (NattablelabelproviderEditor.this.updateProblemIndication) {
+ resourceToDiagnosticMap.remove(target);
+ if (updateProblemIndication) {
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
@@ -449,7 +449,7 @@ public class NattablelabelproviderEditor
IResourceDelta delta = event.getDelta();
try {
class ResourceDeltaVisitor implements IResourceDeltaVisitor {
- protected ResourceSet resourceSet = NattablelabelproviderEditor.this.editingDomain.getResourceSet();
+ protected ResourceSet resourceSet = editingDomain.getResourceSet();
protected Collection<Resource> changedResources = new ArrayList<Resource>();
protected Collection<Resource> removedResources = new ArrayList<Resource>();
@@ -457,13 +457,13 @@ public class NattablelabelproviderEditor
if (delta.getResource().getType() == IResource.FILE) {
if (delta.getKind() == IResourceDelta.REMOVED ||
delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
- Resource resource = this.resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
+ Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
if (resource != null) {
if (delta.getKind() == IResourceDelta.REMOVED) {
- this.removedResources.add(resource);
+ removedResources.add(resource);
}
- else if (!NattablelabelproviderEditor.this.savedResources.remove(resource)) {
- this.changedResources.add(resource);
+ else if (!savedResources.remove(resource)) {
+ changedResources.add(resource);
}
}
}
@@ -474,11 +474,11 @@ public class NattablelabelproviderEditor
}
public Collection<Resource> getChangedResources() {
- return this.changedResources;
+ return changedResources;
}
public Collection<Resource> getRemovedResources() {
- return this.removedResources;
+ return removedResources;
}
}
@@ -489,7 +489,7 @@ public class NattablelabelproviderEditor
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
- NattablelabelproviderEditor.this.removedResources.addAll(visitor.getRemovedResources());
+ removedResources.addAll(visitor.getRemovedResources());
if (!isDirty()) {
getSite().getPage().closeEditor(NattablelabelproviderEditor.this, false);
}
@@ -501,7 +501,7 @@ public class NattablelabelproviderEditor
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
- NattablelabelproviderEditor.this.changedResources.addAll(visitor.getChangedResources());
+ changedResources.addAll(visitor.getChangedResources());
if (getSite().getPage().getActiveEditor() == NattablelabelproviderEditor.this) {
handleActivate();
}
@@ -524,29 +524,29 @@ public class NattablelabelproviderEditor
protected void handleActivate() {
// Recompute the read only state.
//
- if (this.editingDomain.getResourceToReadOnlyMap() != null) {
- this.editingDomain.getResourceToReadOnlyMap().clear();
+ if (editingDomain.getResourceToReadOnlyMap() != null) {
+ editingDomain.getResourceToReadOnlyMap().clear();
// Refresh any actions that may become enabled or disabled.
//
setSelection(getSelection());
}
- if (!this.removedResources.isEmpty()) {
+ if (!removedResources.isEmpty()) {
if (handleDirtyConflict()) {
getSite().getPage().closeEditor(NattablelabelproviderEditor.this, false);
}
else {
- this.removedResources.clear();
- this.changedResources.clear();
- this.savedResources.clear();
+ removedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
}
}
- else if (!this.changedResources.isEmpty()) {
- this.changedResources.removeAll(this.savedResources);
+ else if (!changedResources.isEmpty()) {
+ changedResources.removeAll(savedResources);
handleChangedResources();
- this.changedResources.clear();
- this.savedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
}
}
@@ -557,32 +557,32 @@ public class NattablelabelproviderEditor
* @generated
*/
protected void handleChangedResources() {
- if (!this.changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
+ if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
if (isDirty()) {
- this.changedResources.addAll(this.editingDomain.getResourceSet().getResources());
+ changedResources.addAll(editingDomain.getResourceSet().getResources());
}
- this.editingDomain.getCommandStack().flush();
+ editingDomain.getCommandStack().flush();
- this.updateProblemIndication = false;
- for (Resource resource : this.changedResources) {
+ updateProblemIndication = false;
+ for (Resource resource : changedResources) {
if (resource.isLoaded()) {
resource.unload();
try {
resource.load(Collections.EMPTY_MAP);
}
catch (IOException exception) {
- if (!this.resourceToDiagnosticMap.containsKey(resource)) {
- this.resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ if (!resourceToDiagnosticMap.containsKey(resource)) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
}
}
}
}
- if (AdapterFactoryEditingDomain.isStale(this.editorSelection)) {
+ if (AdapterFactoryEditingDomain.isStale(editorSelection)) {
setSelection(StructuredSelection.EMPTY);
}
- this.updateProblemIndication = true;
+ updateProblemIndication = true;
updateProblemIndication();
}
}
@@ -594,15 +594,15 @@ public class NattablelabelproviderEditor
* @generated
*/
protected void updateProblemIndication() {
- if (this.updateProblemIndication) {
+ if (updateProblemIndication) {
BasicDiagnostic diagnostic =
new BasicDiagnostic
(Diagnostic.OK,
"org.eclipse.papyrus.infra.nattable.model.editor", //$NON-NLS-1$
0,
null,
- new Object [] { this.editingDomain.getResourceSet() });
- for (Diagnostic childDiagnostic : this.resourceToDiagnosticMap.values()) {
+ new Object [] { editingDomain.getResourceSet() });
+ for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) {
if (childDiagnostic.getSeverity() != Diagnostic.OK) {
diagnostic.add(childDiagnostic);
}
@@ -618,7 +618,7 @@ public class NattablelabelproviderEditor
else if (diagnostic.getSeverity() != Diagnostic.OK) {
ProblemEditorPart problemEditorPart = new ProblemEditorPart();
problemEditorPart.setDiagnostic(diagnostic);
- problemEditorPart.setMarkerHelper(this.markerHelper);
+ problemEditorPart.setMarkerHelper(markerHelper);
try {
addPage(++lastEditorPage, problemEditorPart, getEditorInput());
setPageText(lastEditorPage, problemEditorPart.getPartName());
@@ -630,11 +630,11 @@ public class NattablelabelproviderEditor
}
}
- if (this.markerHelper.hasMarkers(this.editingDomain.getResourceSet())) {
- this.markerHelper.deleteMarkers(this.editingDomain.getResourceSet());
+ if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
+ markerHelper.deleteMarkers(editingDomain.getResourceSet());
if (diagnostic.getSeverity() != Diagnostic.OK) {
try {
- this.markerHelper.createMarkers(diagnostic);
+ markerHelper.createMarkers(diagnostic);
}
catch (CoreException exception) {
NattableEditorPlugin.INSTANCE.log(exception);
@@ -678,18 +678,18 @@ public class NattablelabelproviderEditor
protected void initializeEditingDomain() {
// Create an adapter factory that yields item providers.
//
- this.adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
-
- this.adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableconfigurationItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableaxisproviderItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattablelabelproviderItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableaxisconfigurationItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattabletesterItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableaxisItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableconfigurationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableaxisproviderItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattablelabelproviderItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableaxisconfigurationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattabletesterItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableaxisItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
// Create the command stack that will notify this editor as commands are executed.
//
@@ -711,7 +711,7 @@ public class NattablelabelproviderEditor
if (mostRecentCommand != null) {
setSelectionToViewer(mostRecentCommand.getAffectedObjects());
}
- for (Iterator<PropertySheetPage> i = NattablelabelproviderEditor.this.propertySheetPages.iterator(); i.hasNext(); ) {
+ for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) {
PropertySheetPage propertySheetPage = i.next();
if (propertySheetPage.getControl().isDisposed()) {
i.remove();
@@ -727,7 +727,7 @@ public class NattablelabelproviderEditor
// Create the editing domain with a special command stack.
//
- this.editingDomain = new AdapterFactoryEditingDomain(this.adapterFactory, commandStack, new HashMap<Resource, Boolean>());
+ editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
}
/**
@@ -757,8 +757,8 @@ public class NattablelabelproviderEditor
public void run() {
// Try to select the items in the current content viewer of the editor.
//
- if (NattablelabelproviderEditor.this.currentViewer != null) {
- NattablelabelproviderEditor.this.currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
+ if (currentViewer != null) {
+ currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
}
}
};
@@ -775,7 +775,7 @@ public class NattablelabelproviderEditor
* @generated
*/
public EditingDomain getEditingDomain() {
- return this.editingDomain;
+ return editingDomain;
}
/**
@@ -843,13 +843,13 @@ public class NattablelabelproviderEditor
* @generated
*/
public void setCurrentViewerPane(ViewerPane viewerPane) {
- if (this.currentViewerPane != viewerPane) {
- if (this.currentViewerPane != null) {
- this.currentViewerPane.showFocus(false);
+ if (currentViewerPane != viewerPane) {
+ if (currentViewerPane != null) {
+ currentViewerPane.showFocus(false);
}
- this.currentViewerPane = viewerPane;
+ currentViewerPane = viewerPane;
}
- setCurrentViewer(this.currentViewerPane.getViewer());
+ setCurrentViewer(currentViewerPane.getViewer());
}
/**
@@ -862,11 +862,11 @@ public class NattablelabelproviderEditor
public void setCurrentViewer(Viewer viewer) {
// If it is changing...
//
- if (this.currentViewer != viewer) {
- if (this.selectionChangedListener == null) {
+ if (currentViewer != viewer) {
+ if (selectionChangedListener == null) {
// Create the listener on demand.
//
- this.selectionChangedListener =
+ selectionChangedListener =
new ISelectionChangedListener() {
// This just notifies those things that are affected by the section.
//
@@ -878,23 +878,23 @@ public class NattablelabelproviderEditor
// Stop listening to the old one.
//
- if (this.currentViewer != null) {
- this.currentViewer.removeSelectionChangedListener(this.selectionChangedListener);
+ if (currentViewer != null) {
+ currentViewer.removeSelectionChangedListener(selectionChangedListener);
}
// Start listening to the new one.
//
if (viewer != null) {
- viewer.addSelectionChangedListener(this.selectionChangedListener);
+ viewer.addSelectionChangedListener(selectionChangedListener);
}
// Remember it.
//
- this.currentViewer = viewer;
+ currentViewer = viewer;
// Set the editors selection based on the current viewer's selection.
//
- setSelection(this.currentViewer == null ? StructuredSelection.EMPTY : this.currentViewer.getSelection());
+ setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection());
}
}
@@ -905,7 +905,7 @@ public class NattablelabelproviderEditor
* @generated
*/
public Viewer getViewer() {
- return this.currentViewer;
+ return currentViewer;
}
/**
@@ -926,7 +926,7 @@ public class NattablelabelproviderEditor
int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() };
viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
- viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(this.editingDomain, viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
}
/**
@@ -942,18 +942,18 @@ public class NattablelabelproviderEditor
try {
// Load the resource through the editing domain.
//
- resource = this.editingDomain.getResourceSet().getResource(resourceURI, true);
+ resource = editingDomain.getResourceSet().getResource(resourceURI, true);
}
catch (Exception e) {
exception = e;
- resource = this.editingDomain.getResourceSet().getResource(resourceURI, false);
+ resource = editingDomain.getResourceSet().getResource(resourceURI, false);
}
Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
if (diagnostic.getSeverity() != Diagnostic.OK) {
- this.resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
}
- this.editingDomain.getResourceSet().eAdapters().add(this.problemIndicationAdapter);
+ editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
}
/**
@@ -1023,17 +1023,17 @@ public class NattablelabelproviderEditor
};
viewerPane.createControl(getContainer());
- this.selectionViewer = (TreeViewer)viewerPane.getViewer();
- this.selectionViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
+ selectionViewer = (TreeViewer)viewerPane.getViewer();
+ selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
- this.selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
- this.selectionViewer.setInput(this.editingDomain.getResourceSet());
- this.selectionViewer.setSelection(new StructuredSelection(this.editingDomain.getResourceSet().getResources().get(0)), true);
- viewerPane.setTitle(this.editingDomain.getResourceSet());
+ selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ selectionViewer.setInput(editingDomain.getResourceSet());
+ selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ viewerPane.setTitle(editingDomain.getResourceSet());
- new AdapterFactoryTreeEditor(this.selectionViewer.getTree(), this.adapterFactory);
+ new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
- createContextMenuFor(this.selectionViewer);
+ createContextMenuFor(selectionViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_SelectionPage_label")); //$NON-NLS-1$
}
@@ -1057,12 +1057,12 @@ public class NattablelabelproviderEditor
};
viewerPane.createControl(getContainer());
- this.parentViewer = (TreeViewer)viewerPane.getViewer();
- this.parentViewer.setAutoExpandLevel(30);
- this.parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(this.adapterFactory));
- this.parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ parentViewer = (TreeViewer)viewerPane.getViewer();
+ parentViewer.setAutoExpandLevel(30);
+ parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
+ parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.parentViewer);
+ createContextMenuFor(parentViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_ParentPage_label")); //$NON-NLS-1$
}
@@ -1083,11 +1083,11 @@ public class NattablelabelproviderEditor
}
};
viewerPane.createControl(getContainer());
- this.listViewer = (ListViewer)viewerPane.getViewer();
- this.listViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.listViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ listViewer = (ListViewer)viewerPane.getViewer();
+ listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.listViewer);
+ createContextMenuFor(listViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_ListPage_label")); //$NON-NLS-1$
}
@@ -1108,13 +1108,13 @@ public class NattablelabelproviderEditor
}
};
viewerPane.createControl(getContainer());
- this.treeViewer = (TreeViewer)viewerPane.getViewer();
- this.treeViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ treeViewer = (TreeViewer)viewerPane.getViewer();
+ treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- new AdapterFactoryTreeEditor(this.treeViewer.getTree(), this.adapterFactory);
+ new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
- createContextMenuFor(this.treeViewer);
+ createContextMenuFor(treeViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TreePage_label")); //$NON-NLS-1$
}
@@ -1135,9 +1135,9 @@ public class NattablelabelproviderEditor
}
};
viewerPane.createControl(getContainer());
- this.tableViewer = (TableViewer)viewerPane.getViewer();
+ tableViewer = (TableViewer)viewerPane.getViewer();
- Table table = this.tableViewer.getTable();
+ Table table = tableViewer.getTable();
TableLayout layout = new TableLayout();
table.setLayout(layout);
table.setHeaderVisible(true);
@@ -1153,11 +1153,11 @@ public class NattablelabelproviderEditor
selfColumn.setText(getString("_UI_SelfColumn_label")); //$NON-NLS-1$
selfColumn.setResizable(true);
- this.tableViewer.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
- this.tableViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ tableViewer.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
+ tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.tableViewer);
+ createContextMenuFor(tableViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TablePage_label")); //$NON-NLS-1$
}
@@ -1179,9 +1179,9 @@ public class NattablelabelproviderEditor
};
viewerPane.createControl(getContainer());
- this.treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
+ treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
- Tree tree = this.treeViewerWithColumns.getTree();
+ Tree tree = treeViewerWithColumns.getTree();
tree.setLayoutData(new FillLayout());
tree.setHeaderVisible(true);
tree.setLinesVisible(true);
@@ -1196,11 +1196,11 @@ public class NattablelabelproviderEditor
selfColumn.setResizable(true);
selfColumn.setWidth(200);
- this.treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
- this.treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
+ treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.treeViewerWithColumns);
+ createContextMenuFor(treeViewerWithColumns);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label")); //$NON-NLS-1$
}
@@ -1221,10 +1221,10 @@ public class NattablelabelproviderEditor
boolean guard = false;
@Override
public void controlResized(ControlEvent event) {
- if (!this.guard) {
- this.guard = true;
+ if (!guard) {
+ guard = true;
hideTabs();
- this.guard = false;
+ guard = false;
}
}
});
@@ -1283,8 +1283,8 @@ public class NattablelabelproviderEditor
protected void pageChange(int pageIndex) {
super.pageChange(pageIndex);
- if (this.contentOutlinePage != null) {
- handleContentOutlineSelection(this.contentOutlinePage.getSelection());
+ if (contentOutlinePage != null) {
+ handleContentOutlineSelection(contentOutlinePage.getSelection());
}
}
@@ -1318,37 +1318,37 @@ public class NattablelabelproviderEditor
* @generated
*/
public IContentOutlinePage getContentOutlinePage() {
- if (this.contentOutlinePage == null) {
+ if (contentOutlinePage == null) {
// The content outline is just a tree.
//
class MyContentOutlinePage extends ContentOutlinePage {
@Override
public void createControl(Composite parent) {
super.createControl(parent);
- NattablelabelproviderEditor.this.contentOutlineViewer = getTreeViewer();
- NattablelabelproviderEditor.this.contentOutlineViewer.addSelectionChangedListener(this);
+ contentOutlineViewer = getTreeViewer();
+ contentOutlineViewer.addSelectionChangedListener(this);
// Set up the tree viewer.
//
- NattablelabelproviderEditor.this.contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(NattablelabelproviderEditor.this.adapterFactory));
- NattablelabelproviderEditor.this.contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(NattablelabelproviderEditor.this.adapterFactory));
- NattablelabelproviderEditor.this.contentOutlineViewer.setInput(NattablelabelproviderEditor.this.editingDomain.getResourceSet());
+ contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ contentOutlineViewer.setInput(editingDomain.getResourceSet());
// Make sure our popups work.
//
- createContextMenuFor(NattablelabelproviderEditor.this.contentOutlineViewer);
+ createContextMenuFor(contentOutlineViewer);
- if (!NattablelabelproviderEditor.this.editingDomain.getResourceSet().getResources().isEmpty()) {
+ if (!editingDomain.getResourceSet().getResources().isEmpty()) {
// Select the root object in the view.
//
- NattablelabelproviderEditor.this.contentOutlineViewer.setSelection(new StructuredSelection(NattablelabelproviderEditor.this.editingDomain.getResourceSet().getResources().get(0)), true);
+ contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
}
}
@Override
public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
super.makeContributions(menuManager, toolBarManager, statusLineManager);
- NattablelabelproviderEditor.this.contentOutlineStatusLineManager = statusLineManager;
+ contentOutlineStatusLineManager = statusLineManager;
}
@Override
@@ -1358,11 +1358,11 @@ public class NattablelabelproviderEditor
}
}
- this.contentOutlinePage = new MyContentOutlinePage();
+ contentOutlinePage = new MyContentOutlinePage();
// Listen to selection so that we can handle it is a special way.
//
- this.contentOutlinePage.addSelectionChangedListener
+ contentOutlinePage.addSelectionChangedListener
(new ISelectionChangedListener() {
// This ensures that we handle selections correctly.
//
@@ -1372,7 +1372,7 @@ public class NattablelabelproviderEditor
});
}
- return this.contentOutlinePage;
+ return contentOutlinePage;
}
/**
@@ -1383,7 +1383,7 @@ public class NattablelabelproviderEditor
*/
public IPropertySheetPage getPropertySheetPage() {
PropertySheetPage propertySheetPage =
- new ExtendedPropertySheetPage(this.editingDomain) {
+ new ExtendedPropertySheetPage(editingDomain) {
@Override
public void setSelectionToViewer(List<?> selection) {
NattablelabelproviderEditor.this.setSelectionToViewer(selection);
@@ -1396,8 +1396,8 @@ public class NattablelabelproviderEditor
getActionBarContributor().shareGlobalActions(this, actionBars);
}
};
- propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.propertySheetPages.add(propertySheetPage);
+ propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
+ propertySheetPages.add(propertySheetPage);
return propertySheetPage;
}
@@ -1409,7 +1409,7 @@ public class NattablelabelproviderEditor
* @generated
*/
public void handleContentOutlineSelection(ISelection selection) {
- if (this.currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
+ if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
if (selectedElements.hasNext()) {
// Get the first selected element.
@@ -1418,7 +1418,7 @@ public class NattablelabelproviderEditor
// If it's the selection viewer, then we want it to select the same selection as this selection.
//
- if (this.currentViewerPane.getViewer() == this.selectionViewer) {
+ if (currentViewerPane.getViewer() == selectionViewer) {
ArrayList<Object> selectionList = new ArrayList<Object>();
selectionList.add(selectedElement);
while (selectedElements.hasNext()) {
@@ -1427,14 +1427,14 @@ public class NattablelabelproviderEditor
// Set the selection to the widget.
//
- this.selectionViewer.setSelection(new StructuredSelection(selectionList));
+ selectionViewer.setSelection(new StructuredSelection(selectionList));
}
else {
// Set the input to the widget.
//
- if (this.currentViewerPane.getViewer().getInput() != selectedElement) {
- this.currentViewerPane.getViewer().setInput(selectedElement);
- this.currentViewerPane.setTitle(selectedElement);
+ if (currentViewerPane.getViewer().getInput() != selectedElement) {
+ currentViewerPane.getViewer().setInput(selectedElement);
+ currentViewerPane.setTitle(selectedElement);
}
}
}
@@ -1449,7 +1449,7 @@ public class NattablelabelproviderEditor
*/
@Override
public boolean isDirty() {
- return ((BasicCommandStack)this.editingDomain.getCommandStack()).isSaveNeeded();
+ return ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();
}
/**
@@ -1526,7 +1526,7 @@ public class NattablelabelproviderEditor
protected boolean isPersisted(Resource resource) {
boolean result = false;
try {
- InputStream stream = this.editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
+ InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
if (stream != null) {
result = true;
stream.close();
@@ -1574,7 +1574,7 @@ public class NattablelabelproviderEditor
* @generated
*/
protected void doSaveAs(URI uri, IEditorInput editorInput) {
- (this.editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
+ (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
setInputWithNotify(editorInput);
setPartName(editorInput.getName());
IProgressMonitor progressMonitor =
@@ -1590,7 +1590,7 @@ public class NattablelabelproviderEditor
* @generated
*/
public void gotoMarker(IMarker marker) {
- List<?> targetObjects = this.markerHelper.getTargetObjects(this.editingDomain, marker);
+ List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker);
if (!targetObjects.isEmpty()) {
setSelectionToViewer(targetObjects);
}
@@ -1608,8 +1608,8 @@ public class NattablelabelproviderEditor
setInputWithNotify(editorInput);
setPartName(editorInput.getName());
site.setSelectionProvider(this);
- site.getPage().addPartListener(this.partListener);
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this.resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+ site.getPage().addPartListener(partListener);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
}
/**
@@ -1619,8 +1619,8 @@ public class NattablelabelproviderEditor
*/
@Override
public void setFocus() {
- if (this.currentViewerPane != null) {
- this.currentViewerPane.setFocus();
+ if (currentViewerPane != null) {
+ currentViewerPane.setFocus();
}
else {
getControl(getActivePage()).setFocus();
@@ -1634,7 +1634,7 @@ public class NattablelabelproviderEditor
* @generated
*/
public void addSelectionChangedListener(ISelectionChangedListener listener) {
- this.selectionChangedListeners.add(listener);
+ selectionChangedListeners.add(listener);
}
/**
@@ -1644,7 +1644,7 @@ public class NattablelabelproviderEditor
* @generated
*/
public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- this.selectionChangedListeners.remove(listener);
+ selectionChangedListeners.remove(listener);
}
/**
@@ -1654,7 +1654,7 @@ public class NattablelabelproviderEditor
* @generated
*/
public ISelection getSelection() {
- return this.editorSelection;
+ return editorSelection;
}
/**
@@ -1665,9 +1665,9 @@ public class NattablelabelproviderEditor
* @generated
*/
public void setSelection(ISelection selection) {
- this.editorSelection = selection;
+ editorSelection = selection;
- for (ISelectionChangedListener listener : this.selectionChangedListeners) {
+ for (ISelectionChangedListener listener : selectionChangedListeners) {
listener.selectionChanged(new SelectionChangedEvent(this, selection));
}
setStatusLineManager(selection);
@@ -1679,8 +1679,8 @@ public class NattablelabelproviderEditor
* @generated
*/
public void setStatusLineManager(ISelection selection) {
- IStatusLineManager statusLineManager = this.currentViewer != null && this.currentViewer == this.contentOutlineViewer ?
- this.contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
+ IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
+ contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
if (statusLineManager != null) {
if (selection instanceof IStructuredSelection) {
@@ -1691,7 +1691,7 @@ public class NattablelabelproviderEditor
break;
}
case 1: {
- String text = new AdapterFactoryItemDelegator(this.adapterFactory).getText(collection.iterator().next());
+ String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); //$NON-NLS-1$
break;
}
@@ -1761,7 +1761,7 @@ public class NattablelabelproviderEditor
* @generated
*/
public AdapterFactory getAdapterFactory() {
- return this.adapterFactory;
+ return adapterFactory;
}
/**
@@ -1771,24 +1771,24 @@ public class NattablelabelproviderEditor
*/
@Override
public void dispose() {
- this.updateProblemIndication = false;
+ updateProblemIndication = false;
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(this.resourceChangeListener);
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
- getSite().getPage().removePartListener(this.partListener);
+ getSite().getPage().removePartListener(partListener);
- this.adapterFactory.dispose();
+ adapterFactory.dispose();
if (getActionBarContributor().getActiveEditor() == this) {
getActionBarContributor().setActiveEditor(null);
}
- for (PropertySheetPage propertySheetPage : this.propertySheetPages) {
+ for (PropertySheetPage propertySheetPage : propertySheetPages) {
propertySheetPage.dispose();
}
- if (this.contentOutlinePage != null) {
- this.contentOutlinePage.dispose();
+ if (contentOutlinePage != null) {
+ contentOutlinePage.dispose();
}
super.dispose();
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattabletester/presentation/NattabletesterEditor.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattabletester/presentation/NattabletesterEditor.java
index a9c21ee308a..da56817950c 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattabletester/presentation/NattabletesterEditor.java
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattabletester/presentation/NattabletesterEditor.java
@@ -306,14 +306,14 @@ public class NattabletesterEditor
new IPartListener() {
public void partActivated(IWorkbenchPart p) {
if (p instanceof ContentOutline) {
- if (((ContentOutline)p).getCurrentPage() == NattabletesterEditor.this.contentOutlinePage) {
+ if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) {
getActionBarContributor().setActiveEditor(NattabletesterEditor.this);
- setCurrentViewer(NattabletesterEditor.this.contentOutlineViewer);
+ setCurrentViewer(contentOutlineViewer);
}
}
else if (p instanceof PropertySheet) {
- if (NattabletesterEditor.this.propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
+ if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
getActionBarContributor().setActiveEditor(NattabletesterEditor.this);
handleActivate();
}
@@ -394,13 +394,13 @@ public class NattabletesterEditor
Resource resource = (Resource)notification.getNotifier();
Diagnostic diagnostic = analyzeResourceProblems(resource, null);
if (diagnostic.getSeverity() != Diagnostic.OK) {
- NattabletesterEditor.this.resourceToDiagnosticMap.put(resource, diagnostic);
+ resourceToDiagnosticMap.put(resource, diagnostic);
}
else {
- NattabletesterEditor.this.resourceToDiagnosticMap.remove(resource);
+ resourceToDiagnosticMap.remove(resource);
}
- if (NattabletesterEditor.this.updateProblemIndication) {
+ if (updateProblemIndication) {
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
@@ -425,8 +425,8 @@ public class NattabletesterEditor
@Override
protected void unsetTarget(Resource target) {
basicUnsetTarget(target);
- NattabletesterEditor.this.resourceToDiagnosticMap.remove(target);
- if (NattabletesterEditor.this.updateProblemIndication) {
+ resourceToDiagnosticMap.remove(target);
+ if (updateProblemIndication) {
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
@@ -449,7 +449,7 @@ public class NattabletesterEditor
IResourceDelta delta = event.getDelta();
try {
class ResourceDeltaVisitor implements IResourceDeltaVisitor {
- protected ResourceSet resourceSet = NattabletesterEditor.this.editingDomain.getResourceSet();
+ protected ResourceSet resourceSet = editingDomain.getResourceSet();
protected Collection<Resource> changedResources = new ArrayList<Resource>();
protected Collection<Resource> removedResources = new ArrayList<Resource>();
@@ -457,13 +457,13 @@ public class NattabletesterEditor
if (delta.getResource().getType() == IResource.FILE) {
if (delta.getKind() == IResourceDelta.REMOVED ||
delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
- Resource resource = this.resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
+ Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
if (resource != null) {
if (delta.getKind() == IResourceDelta.REMOVED) {
- this.removedResources.add(resource);
+ removedResources.add(resource);
}
- else if (!NattabletesterEditor.this.savedResources.remove(resource)) {
- this.changedResources.add(resource);
+ else if (!savedResources.remove(resource)) {
+ changedResources.add(resource);
}
}
}
@@ -474,11 +474,11 @@ public class NattabletesterEditor
}
public Collection<Resource> getChangedResources() {
- return this.changedResources;
+ return changedResources;
}
public Collection<Resource> getRemovedResources() {
- return this.removedResources;
+ return removedResources;
}
}
@@ -489,7 +489,7 @@ public class NattabletesterEditor
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
- NattabletesterEditor.this.removedResources.addAll(visitor.getRemovedResources());
+ removedResources.addAll(visitor.getRemovedResources());
if (!isDirty()) {
getSite().getPage().closeEditor(NattabletesterEditor.this, false);
}
@@ -501,7 +501,7 @@ public class NattabletesterEditor
getSite().getShell().getDisplay().asyncExec
(new Runnable() {
public void run() {
- NattabletesterEditor.this.changedResources.addAll(visitor.getChangedResources());
+ changedResources.addAll(visitor.getChangedResources());
if (getSite().getPage().getActiveEditor() == NattabletesterEditor.this) {
handleActivate();
}
@@ -524,29 +524,29 @@ public class NattabletesterEditor
protected void handleActivate() {
// Recompute the read only state.
//
- if (this.editingDomain.getResourceToReadOnlyMap() != null) {
- this.editingDomain.getResourceToReadOnlyMap().clear();
+ if (editingDomain.getResourceToReadOnlyMap() != null) {
+ editingDomain.getResourceToReadOnlyMap().clear();
// Refresh any actions that may become enabled or disabled.
//
setSelection(getSelection());
}
- if (!this.removedResources.isEmpty()) {
+ if (!removedResources.isEmpty()) {
if (handleDirtyConflict()) {
getSite().getPage().closeEditor(NattabletesterEditor.this, false);
}
else {
- this.removedResources.clear();
- this.changedResources.clear();
- this.savedResources.clear();
+ removedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
}
}
- else if (!this.changedResources.isEmpty()) {
- this.changedResources.removeAll(this.savedResources);
+ else if (!changedResources.isEmpty()) {
+ changedResources.removeAll(savedResources);
handleChangedResources();
- this.changedResources.clear();
- this.savedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
}
}
@@ -557,32 +557,32 @@ public class NattabletesterEditor
* @generated
*/
protected void handleChangedResources() {
- if (!this.changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
+ if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
if (isDirty()) {
- this.changedResources.addAll(this.editingDomain.getResourceSet().getResources());
+ changedResources.addAll(editingDomain.getResourceSet().getResources());
}
- this.editingDomain.getCommandStack().flush();
+ editingDomain.getCommandStack().flush();
- this.updateProblemIndication = false;
- for (Resource resource : this.changedResources) {
+ updateProblemIndication = false;
+ for (Resource resource : changedResources) {
if (resource.isLoaded()) {
resource.unload();
try {
resource.load(Collections.EMPTY_MAP);
}
catch (IOException exception) {
- if (!this.resourceToDiagnosticMap.containsKey(resource)) {
- this.resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ if (!resourceToDiagnosticMap.containsKey(resource)) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
}
}
}
}
- if (AdapterFactoryEditingDomain.isStale(this.editorSelection)) {
+ if (AdapterFactoryEditingDomain.isStale(editorSelection)) {
setSelection(StructuredSelection.EMPTY);
}
- this.updateProblemIndication = true;
+ updateProblemIndication = true;
updateProblemIndication();
}
}
@@ -594,15 +594,15 @@ public class NattabletesterEditor
* @generated
*/
protected void updateProblemIndication() {
- if (this.updateProblemIndication) {
+ if (updateProblemIndication) {
BasicDiagnostic diagnostic =
new BasicDiagnostic
(Diagnostic.OK,
"org.eclipse.papyrus.infra.nattable.model.editor", //$NON-NLS-1$
0,
null,
- new Object [] { this.editingDomain.getResourceSet() });
- for (Diagnostic childDiagnostic : this.resourceToDiagnosticMap.values()) {
+ new Object [] { editingDomain.getResourceSet() });
+ for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) {
if (childDiagnostic.getSeverity() != Diagnostic.OK) {
diagnostic.add(childDiagnostic);
}
@@ -618,7 +618,7 @@ public class NattabletesterEditor
else if (diagnostic.getSeverity() != Diagnostic.OK) {
ProblemEditorPart problemEditorPart = new ProblemEditorPart();
problemEditorPart.setDiagnostic(diagnostic);
- problemEditorPart.setMarkerHelper(this.markerHelper);
+ problemEditorPart.setMarkerHelper(markerHelper);
try {
addPage(++lastEditorPage, problemEditorPart, getEditorInput());
setPageText(lastEditorPage, problemEditorPart.getPartName());
@@ -630,11 +630,11 @@ public class NattabletesterEditor
}
}
- if (this.markerHelper.hasMarkers(this.editingDomain.getResourceSet())) {
- this.markerHelper.deleteMarkers(this.editingDomain.getResourceSet());
+ if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
+ markerHelper.deleteMarkers(editingDomain.getResourceSet());
if (diagnostic.getSeverity() != Diagnostic.OK) {
try {
- this.markerHelper.createMarkers(diagnostic);
+ markerHelper.createMarkers(diagnostic);
}
catch (CoreException exception) {
NattableEditorPlugin.INSTANCE.log(exception);
@@ -678,18 +678,18 @@ public class NattabletesterEditor
protected void initializeEditingDomain() {
// Create an adapter factory that yields item providers.
//
- this.adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
-
- this.adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableconfigurationItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableaxisproviderItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattablelabelproviderItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableaxisconfigurationItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattabletesterItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableaxisItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableconfigurationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableaxisproviderItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattablelabelproviderItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableaxisconfigurationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattabletesterItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableaxisItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
// Create the command stack that will notify this editor as commands are executed.
//
@@ -711,7 +711,7 @@ public class NattabletesterEditor
if (mostRecentCommand != null) {
setSelectionToViewer(mostRecentCommand.getAffectedObjects());
}
- for (Iterator<PropertySheetPage> i = NattabletesterEditor.this.propertySheetPages.iterator(); i.hasNext(); ) {
+ for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) {
PropertySheetPage propertySheetPage = i.next();
if (propertySheetPage.getControl().isDisposed()) {
i.remove();
@@ -727,7 +727,7 @@ public class NattabletesterEditor
// Create the editing domain with a special command stack.
//
- this.editingDomain = new AdapterFactoryEditingDomain(this.adapterFactory, commandStack, new HashMap<Resource, Boolean>());
+ editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
}
/**
@@ -757,8 +757,8 @@ public class NattabletesterEditor
public void run() {
// Try to select the items in the current content viewer of the editor.
//
- if (NattabletesterEditor.this.currentViewer != null) {
- NattabletesterEditor.this.currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
+ if (currentViewer != null) {
+ currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
}
}
};
@@ -775,7 +775,7 @@ public class NattabletesterEditor
* @generated
*/
public EditingDomain getEditingDomain() {
- return this.editingDomain;
+ return editingDomain;
}
/**
@@ -843,13 +843,13 @@ public class NattabletesterEditor
* @generated
*/
public void setCurrentViewerPane(ViewerPane viewerPane) {
- if (this.currentViewerPane != viewerPane) {
- if (this.currentViewerPane != null) {
- this.currentViewerPane.showFocus(false);
+ if (currentViewerPane != viewerPane) {
+ if (currentViewerPane != null) {
+ currentViewerPane.showFocus(false);
}
- this.currentViewerPane = viewerPane;
+ currentViewerPane = viewerPane;
}
- setCurrentViewer(this.currentViewerPane.getViewer());
+ setCurrentViewer(currentViewerPane.getViewer());
}
/**
@@ -862,11 +862,11 @@ public class NattabletesterEditor
public void setCurrentViewer(Viewer viewer) {
// If it is changing...
//
- if (this.currentViewer != viewer) {
- if (this.selectionChangedListener == null) {
+ if (currentViewer != viewer) {
+ if (selectionChangedListener == null) {
// Create the listener on demand.
//
- this.selectionChangedListener =
+ selectionChangedListener =
new ISelectionChangedListener() {
// This just notifies those things that are affected by the section.
//
@@ -878,23 +878,23 @@ public class NattabletesterEditor
// Stop listening to the old one.
//
- if (this.currentViewer != null) {
- this.currentViewer.removeSelectionChangedListener(this.selectionChangedListener);
+ if (currentViewer != null) {
+ currentViewer.removeSelectionChangedListener(selectionChangedListener);
}
// Start listening to the new one.
//
if (viewer != null) {
- viewer.addSelectionChangedListener(this.selectionChangedListener);
+ viewer.addSelectionChangedListener(selectionChangedListener);
}
// Remember it.
//
- this.currentViewer = viewer;
+ currentViewer = viewer;
// Set the editors selection based on the current viewer's selection.
//
- setSelection(this.currentViewer == null ? StructuredSelection.EMPTY : this.currentViewer.getSelection());
+ setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection());
}
}
@@ -905,7 +905,7 @@ public class NattabletesterEditor
* @generated
*/
public Viewer getViewer() {
- return this.currentViewer;
+ return currentViewer;
}
/**
@@ -926,7 +926,7 @@ public class NattabletesterEditor
int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() };
viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
- viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(this.editingDomain, viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
}
/**
@@ -942,18 +942,18 @@ public class NattabletesterEditor
try {
// Load the resource through the editing domain.
//
- resource = this.editingDomain.getResourceSet().getResource(resourceURI, true);
+ resource = editingDomain.getResourceSet().getResource(resourceURI, true);
}
catch (Exception e) {
exception = e;
- resource = this.editingDomain.getResourceSet().getResource(resourceURI, false);
+ resource = editingDomain.getResourceSet().getResource(resourceURI, false);
}
Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
if (diagnostic.getSeverity() != Diagnostic.OK) {
- this.resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
}
- this.editingDomain.getResourceSet().eAdapters().add(this.problemIndicationAdapter);
+ editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
}
/**
@@ -1023,17 +1023,17 @@ public class NattabletesterEditor
};
viewerPane.createControl(getContainer());
- this.selectionViewer = (TreeViewer)viewerPane.getViewer();
- this.selectionViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
+ selectionViewer = (TreeViewer)viewerPane.getViewer();
+ selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
- this.selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
- this.selectionViewer.setInput(this.editingDomain.getResourceSet());
- this.selectionViewer.setSelection(new StructuredSelection(this.editingDomain.getResourceSet().getResources().get(0)), true);
- viewerPane.setTitle(this.editingDomain.getResourceSet());
+ selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ selectionViewer.setInput(editingDomain.getResourceSet());
+ selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ viewerPane.setTitle(editingDomain.getResourceSet());
- new AdapterFactoryTreeEditor(this.selectionViewer.getTree(), this.adapterFactory);
+ new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
- createContextMenuFor(this.selectionViewer);
+ createContextMenuFor(selectionViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_SelectionPage_label")); //$NON-NLS-1$
}
@@ -1057,12 +1057,12 @@ public class NattabletesterEditor
};
viewerPane.createControl(getContainer());
- this.parentViewer = (TreeViewer)viewerPane.getViewer();
- this.parentViewer.setAutoExpandLevel(30);
- this.parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(this.adapterFactory));
- this.parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ parentViewer = (TreeViewer)viewerPane.getViewer();
+ parentViewer.setAutoExpandLevel(30);
+ parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
+ parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.parentViewer);
+ createContextMenuFor(parentViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_ParentPage_label")); //$NON-NLS-1$
}
@@ -1083,11 +1083,11 @@ public class NattabletesterEditor
}
};
viewerPane.createControl(getContainer());
- this.listViewer = (ListViewer)viewerPane.getViewer();
- this.listViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.listViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ listViewer = (ListViewer)viewerPane.getViewer();
+ listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.listViewer);
+ createContextMenuFor(listViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_ListPage_label")); //$NON-NLS-1$
}
@@ -1108,13 +1108,13 @@ public class NattabletesterEditor
}
};
viewerPane.createControl(getContainer());
- this.treeViewer = (TreeViewer)viewerPane.getViewer();
- this.treeViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ treeViewer = (TreeViewer)viewerPane.getViewer();
+ treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- new AdapterFactoryTreeEditor(this.treeViewer.getTree(), this.adapterFactory);
+ new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
- createContextMenuFor(this.treeViewer);
+ createContextMenuFor(treeViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TreePage_label")); //$NON-NLS-1$
}
@@ -1135,9 +1135,9 @@ public class NattabletesterEditor
}
};
viewerPane.createControl(getContainer());
- this.tableViewer = (TableViewer)viewerPane.getViewer();
+ tableViewer = (TableViewer)viewerPane.getViewer();
- Table table = this.tableViewer.getTable();
+ Table table = tableViewer.getTable();
TableLayout layout = new TableLayout();
table.setLayout(layout);
table.setHeaderVisible(true);
@@ -1153,11 +1153,11 @@ public class NattabletesterEditor
selfColumn.setText(getString("_UI_SelfColumn_label")); //$NON-NLS-1$
selfColumn.setResizable(true);
- this.tableViewer.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
- this.tableViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ tableViewer.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
+ tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.tableViewer);
+ createContextMenuFor(tableViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TablePage_label")); //$NON-NLS-1$
}
@@ -1179,9 +1179,9 @@ public class NattabletesterEditor
};
viewerPane.createControl(getContainer());
- this.treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
+ treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
- Tree tree = this.treeViewerWithColumns.getTree();
+ Tree tree = treeViewerWithColumns.getTree();
tree.setLayoutData(new FillLayout());
tree.setHeaderVisible(true);
tree.setLinesVisible(true);
@@ -1196,11 +1196,11 @@ public class NattabletesterEditor
selfColumn.setResizable(true);
selfColumn.setWidth(200);
- this.treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
- this.treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
+ treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.treeViewerWithColumns);
+ createContextMenuFor(treeViewerWithColumns);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label")); //$NON-NLS-1$
}
@@ -1221,10 +1221,10 @@ public class NattabletesterEditor
boolean guard = false;
@Override
public void controlResized(ControlEvent event) {
- if (!this.guard) {
- this.guard = true;
+ if (!guard) {
+ guard = true;
hideTabs();
- this.guard = false;
+ guard = false;
}
}
});
@@ -1283,8 +1283,8 @@ public class NattabletesterEditor
protected void pageChange(int pageIndex) {
super.pageChange(pageIndex);
- if (this.contentOutlinePage != null) {
- handleContentOutlineSelection(this.contentOutlinePage.getSelection());
+ if (contentOutlinePage != null) {
+ handleContentOutlineSelection(contentOutlinePage.getSelection());
}
}
@@ -1318,37 +1318,37 @@ public class NattabletesterEditor
* @generated
*/
public IContentOutlinePage getContentOutlinePage() {
- if (this.contentOutlinePage == null) {
+ if (contentOutlinePage == null) {
// The content outline is just a tree.
//
class MyContentOutlinePage extends ContentOutlinePage {
@Override
public void createControl(Composite parent) {
super.createControl(parent);
- NattabletesterEditor.this.contentOutlineViewer = getTreeViewer();
- NattabletesterEditor.this.contentOutlineViewer.addSelectionChangedListener(this);
+ contentOutlineViewer = getTreeViewer();
+ contentOutlineViewer.addSelectionChangedListener(this);
// Set up the tree viewer.
//
- NattabletesterEditor.this.contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(NattabletesterEditor.this.adapterFactory));
- NattabletesterEditor.this.contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(NattabletesterEditor.this.adapterFactory));
- NattabletesterEditor.this.contentOutlineViewer.setInput(NattabletesterEditor.this.editingDomain.getResourceSet());
+ contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ contentOutlineViewer.setInput(editingDomain.getResourceSet());
// Make sure our popups work.
//
- createContextMenuFor(NattabletesterEditor.this.contentOutlineViewer);
+ createContextMenuFor(contentOutlineViewer);
- if (!NattabletesterEditor.this.editingDomain.getResourceSet().getResources().isEmpty()) {
+ if (!editingDomain.getResourceSet().getResources().isEmpty()) {
// Select the root object in the view.
//
- NattabletesterEditor.this.contentOutlineViewer.setSelection(new StructuredSelection(NattabletesterEditor.this.editingDomain.getResourceSet().getResources().get(0)), true);
+ contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
}
}
@Override
public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
super.makeContributions(menuManager, toolBarManager, statusLineManager);
- NattabletesterEditor.this.contentOutlineStatusLineManager = statusLineManager;
+ contentOutlineStatusLineManager = statusLineManager;
}
@Override
@@ -1358,11 +1358,11 @@ public class NattabletesterEditor
}
}
- this.contentOutlinePage = new MyContentOutlinePage();
+ contentOutlinePage = new MyContentOutlinePage();
// Listen to selection so that we can handle it is a special way.
//
- this.contentOutlinePage.addSelectionChangedListener
+ contentOutlinePage.addSelectionChangedListener
(new ISelectionChangedListener() {
// This ensures that we handle selections correctly.
//
@@ -1372,7 +1372,7 @@ public class NattabletesterEditor
});
}
- return this.contentOutlinePage;
+ return contentOutlinePage;
}
/**
@@ -1383,7 +1383,7 @@ public class NattabletesterEditor
*/
public IPropertySheetPage getPropertySheetPage() {
PropertySheetPage propertySheetPage =
- new ExtendedPropertySheetPage(this.editingDomain) {
+ new ExtendedPropertySheetPage(editingDomain) {
@Override
public void setSelectionToViewer(List<?> selection) {
NattabletesterEditor.this.setSelectionToViewer(selection);
@@ -1396,8 +1396,8 @@ public class NattabletesterEditor
getActionBarContributor().shareGlobalActions(this, actionBars);
}
};
- propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.propertySheetPages.add(propertySheetPage);
+ propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
+ propertySheetPages.add(propertySheetPage);
return propertySheetPage;
}
@@ -1409,7 +1409,7 @@ public class NattabletesterEditor
* @generated
*/
public void handleContentOutlineSelection(ISelection selection) {
- if (this.currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
+ if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
if (selectedElements.hasNext()) {
// Get the first selected element.
@@ -1418,7 +1418,7 @@ public class NattabletesterEditor
// If it's the selection viewer, then we want it to select the same selection as this selection.
//
- if (this.currentViewerPane.getViewer() == this.selectionViewer) {
+ if (currentViewerPane.getViewer() == selectionViewer) {
ArrayList<Object> selectionList = new ArrayList<Object>();
selectionList.add(selectedElement);
while (selectedElements.hasNext()) {
@@ -1427,14 +1427,14 @@ public class NattabletesterEditor
// Set the selection to the widget.
//
- this.selectionViewer.setSelection(new StructuredSelection(selectionList));
+ selectionViewer.setSelection(new StructuredSelection(selectionList));
}
else {
// Set the input to the widget.
//
- if (this.currentViewerPane.getViewer().getInput() != selectedElement) {
- this.currentViewerPane.getViewer().setInput(selectedElement);
- this.currentViewerPane.setTitle(selectedElement);
+ if (currentViewerPane.getViewer().getInput() != selectedElement) {
+ currentViewerPane.getViewer().setInput(selectedElement);
+ currentViewerPane.setTitle(selectedElement);
}
}
}
@@ -1449,7 +1449,7 @@ public class NattabletesterEditor
*/
@Override
public boolean isDirty() {
- return ((BasicCommandStack)this.editingDomain.getCommandStack()).isSaveNeeded();
+ return ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();
}
/**
@@ -1526,7 +1526,7 @@ public class NattabletesterEditor
protected boolean isPersisted(Resource resource) {
boolean result = false;
try {
- InputStream stream = this.editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
+ InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
if (stream != null) {
result = true;
stream.close();
@@ -1574,7 +1574,7 @@ public class NattabletesterEditor
* @generated
*/
protected void doSaveAs(URI uri, IEditorInput editorInput) {
- (this.editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
+ (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
setInputWithNotify(editorInput);
setPartName(editorInput.getName());
IProgressMonitor progressMonitor =
@@ -1590,7 +1590,7 @@ public class NattabletesterEditor
* @generated
*/
public void gotoMarker(IMarker marker) {
- List<?> targetObjects = this.markerHelper.getTargetObjects(this.editingDomain, marker);
+ List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker);
if (!targetObjects.isEmpty()) {
setSelectionToViewer(targetObjects);
}
@@ -1608,8 +1608,8 @@ public class NattabletesterEditor
setInputWithNotify(editorInput);
setPartName(editorInput.getName());
site.setSelectionProvider(this);
- site.getPage().addPartListener(this.partListener);
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this.resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+ site.getPage().addPartListener(partListener);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
}
/**
@@ -1619,8 +1619,8 @@ public class NattabletesterEditor
*/
@Override
public void setFocus() {
- if (this.currentViewerPane != null) {
- this.currentViewerPane.setFocus();
+ if (currentViewerPane != null) {
+ currentViewerPane.setFocus();
}
else {
getControl(getActivePage()).setFocus();
@@ -1634,7 +1634,7 @@ public class NattabletesterEditor
* @generated
*/
public void addSelectionChangedListener(ISelectionChangedListener listener) {
- this.selectionChangedListeners.add(listener);
+ selectionChangedListeners.add(listener);
}
/**
@@ -1644,7 +1644,7 @@ public class NattabletesterEditor
* @generated
*/
public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- this.selectionChangedListeners.remove(listener);
+ selectionChangedListeners.remove(listener);
}
/**
@@ -1654,7 +1654,7 @@ public class NattabletesterEditor
* @generated
*/
public ISelection getSelection() {
- return this.editorSelection;
+ return editorSelection;
}
/**
@@ -1665,9 +1665,9 @@ public class NattabletesterEditor
* @generated
*/
public void setSelection(ISelection selection) {
- this.editorSelection = selection;
+ editorSelection = selection;
- for (ISelectionChangedListener listener : this.selectionChangedListeners) {
+ for (ISelectionChangedListener listener : selectionChangedListeners) {
listener.selectionChanged(new SelectionChangedEvent(this, selection));
}
setStatusLineManager(selection);
@@ -1679,8 +1679,8 @@ public class NattabletesterEditor
* @generated
*/
public void setStatusLineManager(ISelection selection) {
- IStatusLineManager statusLineManager = this.currentViewer != null && this.currentViewer == this.contentOutlineViewer ?
- this.contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
+ IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
+ contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
if (statusLineManager != null) {
if (selection instanceof IStructuredSelection) {
@@ -1691,7 +1691,7 @@ public class NattabletesterEditor
break;
}
case 1: {
- String text = new AdapterFactoryItemDelegator(this.adapterFactory).getText(collection.iterator().next());
+ String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); //$NON-NLS-1$
break;
}
@@ -1761,7 +1761,7 @@ public class NattabletesterEditor
* @generated
*/
public AdapterFactory getAdapterFactory() {
- return this.adapterFactory;
+ return adapterFactory;
}
/**
@@ -1771,24 +1771,24 @@ public class NattabletesterEditor
*/
@Override
public void dispose() {
- this.updateProblemIndication = false;
+ updateProblemIndication = false;
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(this.resourceChangeListener);
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
- getSite().getPage().removePartListener(this.partListener);
+ getSite().getPage().removePartListener(partListener);
- this.adapterFactory.dispose();
+ adapterFactory.dispose();
if (getActionBarContributor().getActiveEditor() == this) {
getActionBarContributor().setActiveEditor(null);
}
- for (PropertySheetPage propertySheetPage : this.propertySheetPages) {
+ for (PropertySheetPage propertySheetPage : propertySheetPages) {
propertySheetPage.dispose();
}
- if (this.contentOutlinePage != null) {
- this.contentOutlinePage.dispose();
+ if (contentOutlinePage != null) {
+ contentOutlinePage.dispose();
}
super.dispose();
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/presentation/NattableEditor.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/presentation/NattableEditor.java
index 94c2437a16d..839d8527333 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/presentation/NattableEditor.java
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/presentation/NattableEditor.java
@@ -142,7 +142,6 @@ import org.eclipse.ui.views.properties.PropertySheetPage;
* This is an example of a Nattable model editor.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public class NattableEditor extends MultiPageEditorPart implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker {
@@ -151,7 +150,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This keeps track of the editing domain that is used to track all changes to the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected AdapterFactoryEditingDomain editingDomain;
@@ -160,7 +158,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This is the one adapter factory used for providing views of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected ComposedAdapterFactory adapterFactory;
@@ -169,7 +166,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This is the content outline page.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected IContentOutlinePage contentOutlinePage;
@@ -178,7 +174,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This is a kludge...
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected IStatusLineManager contentOutlineStatusLineManager;
@@ -187,7 +182,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This is the content outline page's viewer.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected TreeViewer contentOutlineViewer;
@@ -196,7 +190,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This is the property sheet page.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected List<PropertySheetPage> propertySheetPages = new ArrayList<PropertySheetPage>();
@@ -206,7 +199,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* The parent relation must be correctly defined for this to work.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected TreeViewer selectionViewer;
@@ -215,7 +207,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This inverts the roll of parent and child in the content provider and show parents as a tree.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected TreeViewer parentViewer;
@@ -224,7 +215,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This shows how a tree view works.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected TreeViewer treeViewer;
@@ -234,7 +224,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* A list viewer doesn't support icons.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected ListViewer listViewer;
@@ -244,7 +233,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* A table can be used as a list with icons.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected TableViewer tableViewer;
@@ -253,7 +241,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This shows how a tree view with columns works.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected TreeViewer treeViewerWithColumns;
@@ -262,7 +249,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This keeps track of the active viewer pane, in the book.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected ViewerPane currentViewerPane;
@@ -271,7 +257,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected Viewer currentViewer;
@@ -280,7 +265,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This listens to which ever viewer is active.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected ISelectionChangedListener selectionChangedListener;
@@ -289,7 +273,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected Collection<ISelectionChangedListener> selectionChangedListeners = new ArrayList<ISelectionChangedListener>();
@@ -298,7 +281,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This keeps track of the selection of the editor as a whole.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected ISelection editorSelection = StructuredSelection.EMPTY;
@@ -308,7 +290,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* in Eclipse's Problems View.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected MarkerHelper markerHelper = new EditUIMarkerHelper();
@@ -317,50 +298,45 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This listens for when the outline becomes active
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected IPartListener partListener = new IPartListener() {
+ public void partActivated(IWorkbenchPart p) {
+ if (p instanceof ContentOutline) {
+ if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) {
+ getActionBarContributor().setActiveEditor(NattableEditor.this);
- public void partActivated(IWorkbenchPart p) {
- if(p instanceof ContentOutline) {
- if(((ContentOutline)p).getCurrentPage() == NattableEditor.this.contentOutlinePage) {
- getActionBarContributor().setActiveEditor(NattableEditor.this);
-
- setCurrentViewer(NattableEditor.this.contentOutlineViewer);
+ setCurrentViewer(contentOutlineViewer);
+ }
+ }
+ else if (p instanceof PropertySheet) {
+ if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
+ getActionBarContributor().setActiveEditor(NattableEditor.this);
+ handleActivate();
+ }
}
- } else if(p instanceof PropertySheet) {
- if(NattableEditor.this.propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
- getActionBarContributor().setActiveEditor(NattableEditor.this);
+ else if (p == NattableEditor.this) {
handleActivate();
}
- } else if(p == NattableEditor.this) {
- handleActivate();
}
- }
-
- public void partBroughtToTop(IWorkbenchPart p) {
- // Ignore.
- }
-
- public void partClosed(IWorkbenchPart p) {
- // Ignore.
- }
-
- public void partDeactivated(IWorkbenchPart p) {
- // Ignore.
- }
-
- public void partOpened(IWorkbenchPart p) {
- // Ignore.
- }
- };
+ public void partBroughtToTop(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partClosed(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partDeactivated(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partOpened(IWorkbenchPart p) {
+ // Ignore.
+ }
+ };
/**
* Resources that have been removed since last activation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected Collection<Resource> removedResources = new ArrayList<Resource>();
@@ -369,7 +345,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* Resources that have been changed since last activation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected Collection<Resource> changedResources = new ArrayList<Resource>();
@@ -378,7 +353,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* Resources that have been saved.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected Collection<Resource> savedResources = new ArrayList<Resource>();
@@ -387,7 +361,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* Map to store the diagnostic associated with a resource.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected Map<Resource, Diagnostic> resourceToDiagnosticMap = new LinkedHashMap<Resource, Diagnostic>();
@@ -396,7 +369,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* Controls whether the problem indication should be updated.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected boolean updateProblemIndication = true;
@@ -405,173 +377,171 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* Adapter used to update the problem indication when resources are demanded loaded.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected EContentAdapter problemIndicationAdapter = new EContentAdapter() {
+ @Override
+ public void notifyChanged(Notification notification) {
+ if (notification.getNotifier() instanceof Resource) {
+ switch (notification.getFeatureID(Resource.class)) {
+ case Resource.RESOURCE__IS_LOADED:
+ case Resource.RESOURCE__ERRORS:
+ case Resource.RESOURCE__WARNINGS: {
+ Resource resource = (Resource)notification.getNotifier();
+ Diagnostic diagnostic = analyzeResourceProblems(resource, null);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, diagnostic);
+ }
+ else {
+ resourceToDiagnosticMap.remove(resource);
+ }
- @Override
- public void notifyChanged(Notification notification) {
- if(notification.getNotifier() instanceof Resource) {
- switch(notification.getFeatureID(Resource.class)) {
- case Resource.RESOURCE__IS_LOADED:
- case Resource.RESOURCE__ERRORS:
- case Resource.RESOURCE__WARNINGS:
- {
- Resource resource = (Resource)notification.getNotifier();
- Diagnostic diagnostic = analyzeResourceProblems(resource, null);
- if(diagnostic.getSeverity() != Diagnostic.OK) {
- NattableEditor.this.resourceToDiagnosticMap.put(resource, diagnostic);
- } else {
- NattableEditor.this.resourceToDiagnosticMap.remove(resource);
- }
-
- if(NattableEditor.this.updateProblemIndication) {
- getSite().getShell().getDisplay().asyncExec(new Runnable() {
-
- public void run() {
- updateProblemIndication();
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
}
- });
+ break;
+ }
}
- break;
}
+ else {
+ super.notifyChanged(notification);
}
- } else {
- super.notifyChanged(notification);
}
- }
-
- @Override
- protected void setTarget(Resource target) {
- basicSetTarget(target);
- }
- @Override
- protected void unsetTarget(Resource target) {
- basicUnsetTarget(target);
- NattableEditor.this.resourceToDiagnosticMap.remove(target);
- if(NattableEditor.this.updateProblemIndication) {
- getSite().getShell().getDisplay().asyncExec(new Runnable() {
+ @Override
+ protected void setTarget(Resource target) {
+ basicSetTarget(target);
+ }
- public void run() {
- updateProblemIndication();
- }
- });
+ @Override
+ protected void unsetTarget(Resource target) {
+ basicUnsetTarget(target);
+ resourceToDiagnosticMap.remove(target);
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
}
- }
- };
+ };
/**
* This listens for workspace changes.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected IResourceChangeListener resourceChangeListener = new IResourceChangeListener() {
-
- public void resourceChanged(IResourceChangeEvent event) {
- IResourceDelta delta = event.getDelta();
- try {
- class ResourceDeltaVisitor implements IResourceDeltaVisitor {
-
- protected ResourceSet resourceSet = NattableEditor.this.editingDomain.getResourceSet();
-
- protected Collection<Resource> changedResources = new ArrayList<Resource>();
-
- protected Collection<Resource> removedResources = new ArrayList<Resource>();
-
- public boolean visit(IResourceDelta delta) {
- if(delta.getResource().getType() == IResource.FILE) {
- if(delta.getKind() == IResourceDelta.REMOVED || delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
- Resource resource = this.resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
- if(resource != null) {
- if(delta.getKind() == IResourceDelta.REMOVED) {
- this.removedResources.add(resource);
- } else if(!NattableEditor.this.savedResources.remove(resource)) {
- this.changedResources.add(resource);
+ public void resourceChanged(IResourceChangeEvent event) {
+ IResourceDelta delta = event.getDelta();
+ try {
+ class ResourceDeltaVisitor implements IResourceDeltaVisitor {
+ protected ResourceSet resourceSet = editingDomain.getResourceSet();
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ public boolean visit(IResourceDelta delta) {
+ if (delta.getResource().getType() == IResource.FILE) {
+ if (delta.getKind() == IResourceDelta.REMOVED ||
+ delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
+ Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
+ if (resource != null) {
+ if (delta.getKind() == IResourceDelta.REMOVED) {
+ removedResources.add(resource);
+ }
+ else if (!savedResources.remove(resource)) {
+ changedResources.add(resource);
+ }
}
}
+ return false;
}
- return false;
+
+ return true;
}
- return true;
- }
+ public Collection<Resource> getChangedResources() {
+ return changedResources;
+ }
- public Collection<Resource> getChangedResources() {
- return this.changedResources;
+ public Collection<Resource> getRemovedResources() {
+ return removedResources;
+ }
}
- public Collection<Resource> getRemovedResources() {
- return this.removedResources;
+ final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
+ delta.accept(visitor);
+
+ if (!visitor.getRemovedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ removedResources.addAll(visitor.getRemovedResources());
+ if (!isDirty()) {
+ getSite().getPage().closeEditor(NattableEditor.this, false);
+ }
+ }
+ });
}
- }
-
- final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
- delta.accept(visitor);
- if(!visitor.getRemovedResources().isEmpty()) {
- getSite().getShell().getDisplay().asyncExec(new Runnable() {
-
- public void run() {
- NattableEditor.this.removedResources.addAll(visitor.getRemovedResources());
- if(!isDirty()) {
- getSite().getPage().closeEditor(NattableEditor.this, false);
- }
- }
- });
+ if (!visitor.getChangedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ changedResources.addAll(visitor.getChangedResources());
+ if (getSite().getPage().getActiveEditor() == NattableEditor.this) {
+ handleActivate();
+ }
+ }
+ });
+ }
}
-
- if(!visitor.getChangedResources().isEmpty()) {
- getSite().getShell().getDisplay().asyncExec(new Runnable() {
-
- public void run() {
- NattableEditor.this.changedResources.addAll(visitor.getChangedResources());
- if(getSite().getPage().getActiveEditor() == NattableEditor.this) {
- handleActivate();
- }
- }
- });
+ catch (CoreException exception) {
+ NattableEditorPlugin.INSTANCE.log(exception);
}
- } catch (CoreException exception) {
- NattableEditorPlugin.INSTANCE.log(exception);
}
- }
- };
+ };
/**
* Handles activation of the editor or it's associated views.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected void handleActivate() {
// Recompute the read only state.
//
- if(this.editingDomain.getResourceToReadOnlyMap() != null) {
- this.editingDomain.getResourceToReadOnlyMap().clear();
+ if (editingDomain.getResourceToReadOnlyMap() != null) {
+ editingDomain.getResourceToReadOnlyMap().clear();
- // Refresh any actions that may become enabled or disabled.
- //
- setSelection(getSelection());
+ // Refresh any actions that may become enabled or disabled.
+ //
+ setSelection(getSelection());
}
- if(!this.removedResources.isEmpty()) {
- if(handleDirtyConflict()) {
+ if (!removedResources.isEmpty()) {
+ if (handleDirtyConflict()) {
getSite().getPage().closeEditor(NattableEditor.this, false);
- } else {
- this.removedResources.clear();
- this.changedResources.clear();
- this.savedResources.clear();
}
- } else if(!this.changedResources.isEmpty()) {
- this.changedResources.removeAll(this.savedResources);
+ else {
+ removedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+ else if (!changedResources.isEmpty()) {
+ changedResources.removeAll(savedResources);
handleChangedResources();
- this.changedResources.clear();
- this.savedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
}
}
@@ -579,35 +549,35 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* Handles what to do with changed resources on activation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected void handleChangedResources() {
- if(!this.changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
- if(isDirty()) {
- this.changedResources.addAll(this.editingDomain.getResourceSet().getResources());
+ if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
+ if (isDirty()) {
+ changedResources.addAll(editingDomain.getResourceSet().getResources());
}
- this.editingDomain.getCommandStack().flush();
+ editingDomain.getCommandStack().flush();
- this.updateProblemIndication = false;
- for(Resource resource : this.changedResources) {
- if(resource.isLoaded()) {
+ updateProblemIndication = false;
+ for (Resource resource : changedResources) {
+ if (resource.isLoaded()) {
resource.unload();
try {
resource.load(Collections.EMPTY_MAP);
- } catch (IOException exception) {
- if(!this.resourceToDiagnosticMap.containsKey(resource)) {
- this.resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ catch (IOException exception) {
+ if (!resourceToDiagnosticMap.containsKey(resource)) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
}
}
}
}
- if(AdapterFactoryEditingDomain.isStale(this.editorSelection)) {
+ if (AdapterFactoryEditingDomain.isStale(editorSelection)) {
setSelection(StructuredSelection.EMPTY);
}
- this.updateProblemIndication = true;
+ updateProblemIndication = true;
updateProblemIndication();
}
}
@@ -616,45 +586,52 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* Updates the problems indication with the information described in the specified diagnostic.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected void updateProblemIndication() {
- if(this.updateProblemIndication) {
- BasicDiagnostic diagnostic = new BasicDiagnostic(Diagnostic.OK, "org.eclipse.papyrus.infra.nattable.model.editor", //$NON-NLS-1$
- 0, null, new Object[]{ this.editingDomain.getResourceSet() });
- for(Diagnostic childDiagnostic : this.resourceToDiagnosticMap.values()) {
- if(childDiagnostic.getSeverity() != Diagnostic.OK) {
+ if (updateProblemIndication) {
+ BasicDiagnostic diagnostic =
+ new BasicDiagnostic
+ (Diagnostic.OK,
+ "org.eclipse.papyrus.infra.nattable.model.editor", //$NON-NLS-1$
+ 0,
+ null,
+ new Object [] { editingDomain.getResourceSet() });
+ for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) {
+ if (childDiagnostic.getSeverity() != Diagnostic.OK) {
diagnostic.add(childDiagnostic);
}
}
int lastEditorPage = getPageCount() - 1;
- if(lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) {
+ if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) {
((ProblemEditorPart)getEditor(lastEditorPage)).setDiagnostic(diagnostic);
- if(diagnostic.getSeverity() != Diagnostic.OK) {
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
setActivePage(lastEditorPage);
}
- } else if(diagnostic.getSeverity() != Diagnostic.OK) {
+ }
+ else if (diagnostic.getSeverity() != Diagnostic.OK) {
ProblemEditorPart problemEditorPart = new ProblemEditorPart();
problemEditorPart.setDiagnostic(diagnostic);
- problemEditorPart.setMarkerHelper(this.markerHelper);
+ problemEditorPart.setMarkerHelper(markerHelper);
try {
addPage(++lastEditorPage, problemEditorPart, getEditorInput());
setPageText(lastEditorPage, problemEditorPart.getPartName());
setActivePage(lastEditorPage);
showTabs();
- } catch (PartInitException exception) {
+ }
+ catch (PartInitException exception) {
NattableEditorPlugin.INSTANCE.log(exception);
}
}
- if(this.markerHelper.hasMarkers(this.editingDomain.getResourceSet())) {
- this.markerHelper.deleteMarkers(this.editingDomain.getResourceSet());
- if(diagnostic.getSeverity() != Diagnostic.OK) {
+ if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
+ markerHelper.deleteMarkers(editingDomain.getResourceSet());
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
try {
- this.markerHelper.createMarkers(diagnostic);
- } catch (CoreException exception) {
+ markerHelper.createMarkers(diagnostic);
+ }
+ catch (CoreException exception) {
NattableEditorPlugin.INSTANCE.log(exception);
}
}
@@ -666,19 +643,20 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* Shows a dialog that asks if conflicting changes should be discarded.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected boolean handleDirtyConflict() {
- return MessageDialog.openQuestion(getSite().getShell(), getString("_UI_FileConflict_label"), //$NON-NLS-1$
- getString("_WARN_FileConflict")); //$NON-NLS-1$
+ return
+ MessageDialog.openQuestion
+ (getSite().getShell(),
+ getString("_UI_FileConflict_label"), //$NON-NLS-1$
+ getString("_WARN_FileConflict")); //$NON-NLS-1$
}
/**
* This creates a model editor.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public NattableEditor() {
@@ -690,24 +668,23 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This sets up the editing domain for the model editor.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected void initializeEditingDomain() {
// Create an adapter factory that yields item providers.
//
- this.adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
-
- this.adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableconfigurationItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableaxisproviderItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattablelabelproviderItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableaxisconfigurationItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattabletesterItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new NattableaxisItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
- this.adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableconfigurationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableaxisproviderItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattablelabelproviderItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableaxisconfigurationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattabletesterItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattableaxisItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
// Create the command stack that will notify this editor as commands are executed.
//
@@ -715,43 +692,43 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
// Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus.
//
- commandStack.addCommandStackListener(new CommandStackListener() {
-
- public void commandStackChanged(final EventObject event) {
- getContainer().getDisplay().asyncExec(new Runnable() {
-
- public void run() {
- firePropertyChange(IEditorPart.PROP_DIRTY);
-
- // Try to select the affected objects.
- //
- Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
- if(mostRecentCommand != null) {
- setSelectionToViewer(mostRecentCommand.getAffectedObjects());
- }
- for(Iterator<PropertySheetPage> i = NattableEditor.this.propertySheetPages.iterator(); i.hasNext();) {
- PropertySheetPage propertySheetPage = i.next();
- if(propertySheetPage.getControl().isDisposed()) {
- i.remove();
- } else {
- propertySheetPage.refresh();
- }
- }
- }
- });
- }
- });
+ commandStack.addCommandStackListener
+ (new CommandStackListener() {
+ public void commandStackChanged(final EventObject event) {
+ getContainer().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+
+ // Try to select the affected objects.
+ //
+ Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
+ if (mostRecentCommand != null) {
+ setSelectionToViewer(mostRecentCommand.getAffectedObjects());
+ }
+ for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) {
+ PropertySheetPage propertySheetPage = i.next();
+ if (propertySheetPage.getControl().isDisposed()) {
+ i.remove();
+ }
+ else {
+ propertySheetPage.refresh();
+ }
+ }
+ }
+ });
+ }
+ });
// Create the editing domain with a special command stack.
//
- this.editingDomain = new AdapterFactoryEditingDomain(this.adapterFactory, commandStack, new HashMap<Resource, Boolean>());
+ editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
}
/**
* This is here for the listener to be able to call it.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
@@ -763,45 +740,42 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This sets the selection into whichever viewer is active.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public void setSelectionToViewer(Collection<?> collection) {
final Collection<?> theSelection = collection;
// Make sure it's okay.
//
- if(theSelection != null && !theSelection.isEmpty()) {
- Runnable runnable = new Runnable() {
-
- public void run() {
- // Try to select the items in the current content viewer of the editor.
- //
- if(NattableEditor.this.currentViewer != null) {
- NattableEditor.this.currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
+ if (theSelection != null && !theSelection.isEmpty()) {
+ Runnable runnable =
+ new Runnable() {
+ public void run() {
+ // Try to select the items in the current content viewer of the editor.
+ //
+ if (currentViewer != null) {
+ currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
+ }
}
- }
- };
+ };
getSite().getShell().getDisplay().asyncExec(runnable);
}
}
/**
* This returns the editing domain as required by the {@link IEditingDomainProvider} interface.
- * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain} and for supporting
- * {@link org.eclipse.emf.edit.ui.action.CommandAction}.
+ * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain}
+ * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public EditingDomain getEditingDomain() {
- return this.editingDomain;
+ return editingDomain;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider {
@@ -809,7 +783,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) {
@@ -819,11 +792,10 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
- public Object[] getElements(Object object) {
+ public Object [] getElements(Object object) {
Object parent = super.getParent(object);
return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
}
@@ -831,11 +803,10 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
- public Object[] getChildren(Object object) {
+ public Object [] getChildren(Object object) {
Object parent = super.getParent(object);
return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
}
@@ -843,7 +814,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
@@ -855,7 +825,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
@@ -867,17 +836,16 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public void setCurrentViewerPane(ViewerPane viewerPane) {
- if(this.currentViewerPane != viewerPane) {
- if(this.currentViewerPane != null) {
- this.currentViewerPane.showFocus(false);
+ if (currentViewerPane != viewerPane) {
+ if (currentViewerPane != null) {
+ currentViewerPane.showFocus(false);
}
- this.currentViewerPane = viewerPane;
+ currentViewerPane = viewerPane;
}
- setCurrentViewer(this.currentViewerPane.getViewer());
+ setCurrentViewer(currentViewerPane.getViewer());
}
/**
@@ -885,45 +853,44 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* is the current one.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public void setCurrentViewer(Viewer viewer) {
// If it is changing...
//
- if(this.currentViewer != viewer) {
- if(this.selectionChangedListener == null) {
+ if (currentViewer != viewer) {
+ if (selectionChangedListener == null) {
// Create the listener on demand.
//
- this.selectionChangedListener = new ISelectionChangedListener() {
-
- // This just notifies those things that are affected by the section.
- //
- public void selectionChanged(SelectionChangedEvent selectionChangedEvent) {
- setSelection(selectionChangedEvent.getSelection());
- }
- };
+ selectionChangedListener =
+ new ISelectionChangedListener() {
+ // This just notifies those things that are affected by the section.
+ //
+ public void selectionChanged(SelectionChangedEvent selectionChangedEvent) {
+ setSelection(selectionChangedEvent.getSelection());
+ }
+ };
}
// Stop listening to the old one.
//
- if(this.currentViewer != null) {
- this.currentViewer.removeSelectionChangedListener(this.selectionChangedListener);
+ if (currentViewer != null) {
+ currentViewer.removeSelectionChangedListener(selectionChangedListener);
}
// Start listening to the new one.
//
- if(viewer != null) {
- viewer.addSelectionChangedListener(this.selectionChangedListener);
+ if (viewer != null) {
+ viewer.addSelectionChangedListener(selectionChangedListener);
}
// Remember it.
//
- this.currentViewer = viewer;
+ currentViewer = viewer;
// Set the editors selection based on the current viewer's selection.
//
- setSelection(this.currentViewer == null ? StructuredSelection.EMPTY : this.currentViewer.getSelection());
+ setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection());
}
}
@@ -931,18 +898,16 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This returns the viewer as required by the {@link IViewerProvider} interface.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public Viewer getViewer() {
- return this.currentViewer;
+ return currentViewer;
}
/**
* This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected void createContextMenuFor(StructuredViewer viewer) {
@@ -950,21 +915,20 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
contextMenu.add(new Separator("additions")); //$NON-NLS-1$
contextMenu.setRemoveAllWhenShown(true);
contextMenu.addMenuListener(this);
- Menu menu = contextMenu.createContextMenu(viewer.getControl());
+ Menu menu= contextMenu.createContextMenu(viewer.getControl());
viewer.getControl().setMenu(menu);
getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));
int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
- Transfer[] transfers = new Transfer[]{ LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() };
+ Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() };
viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
- viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(this.editingDomain, viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
}
/**
* This is the method called to load a resource into the editing domain's resource set based on the editor's input.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public void createModel() {
@@ -974,17 +938,18 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
try {
// Load the resource through the editing domain.
//
- resource = this.editingDomain.getResourceSet().getResource(resourceURI, true);
- } catch (Exception e) {
+ resource = editingDomain.getResourceSet().getResource(resourceURI, true);
+ }
+ catch (Exception e) {
exception = e;
- resource = this.editingDomain.getResourceSet().getResource(resourceURI, false);
+ resource = editingDomain.getResourceSet().getResource(resourceURI, false);
}
Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
- if(diagnostic.getSeverity() != Diagnostic.OK) {
- this.resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
}
- this.editingDomain.getResourceSet().eAdapters().add(this.problemIndicationAdapter);
+ editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
}
/**
@@ -992,21 +957,30 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* and the specified exception (if any).
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
- if(!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
- BasicDiagnostic basicDiagnostic = new BasicDiagnostic(Diagnostic.ERROR, "org.eclipse.papyrus.infra.nattable.model.editor", //$NON-NLS-1$
- 0, getString("_UI_CreateModelError_message", resource.getURI()), //$NON-NLS-1$
- new Object[]{ exception == null ? (Object)resource : exception });
+ if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
+ BasicDiagnostic basicDiagnostic =
+ new BasicDiagnostic
+ (Diagnostic.ERROR,
+ "org.eclipse.papyrus.infra.nattable.model.editor", //$NON-NLS-1$
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()), //$NON-NLS-1$
+ new Object [] { exception == null ? (Object)resource : exception });
basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
return basicDiagnostic;
- } else if(exception != null) {
- return new BasicDiagnostic(Diagnostic.ERROR, "org.eclipse.papyrus.infra.nattable.model.editor", //$NON-NLS-1$
- 0, getString("_UI_CreateModelError_message", resource.getURI()), //$NON-NLS-1$
- new Object[]{ exception });
- } else {
+ }
+ else if (exception != null) {
+ return
+ new BasicDiagnostic
+ (Diagnostic.ERROR,
+ "org.eclipse.papyrus.infra.nattable.model.editor", //$NON-NLS-1$
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()), //$NON-NLS-1$
+ new Object[] { exception });
+ }
+ else {
return Diagnostic.OK_INSTANCE;
}
}
@@ -1015,7 +989,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This is the method used by the framework to install your own controls.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
@@ -1026,38 +999,37 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
// Only creates the other pages if there is something that can be edited
//
- if(!getEditingDomain().getResourceSet().getResources().isEmpty()) {
+ if (!getEditingDomain().getResourceSet().getResources().isEmpty()) {
// Create a page for the selection tree view.
//
{
- ViewerPane viewerPane = new ViewerPane(getSite().getPage(), NattableEditor.this) {
-
- @Override
- public Viewer createViewer(Composite composite) {
- Tree tree = new Tree(composite, SWT.MULTI);
- TreeViewer newTreeViewer = new TreeViewer(tree);
- return newTreeViewer;
- }
-
- @Override
- public void requestActivation() {
- super.requestActivation();
- setCurrentViewerPane(this);
- }
- };
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NattableEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
viewerPane.createControl(getContainer());
- this.selectionViewer = (TreeViewer)viewerPane.getViewer();
- this.selectionViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
+ selectionViewer = (TreeViewer)viewerPane.getViewer();
+ selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
- this.selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
- this.selectionViewer.setInput(this.editingDomain.getResourceSet());
- this.selectionViewer.setSelection(new StructuredSelection(this.editingDomain.getResourceSet().getResources().get(0)), true);
- viewerPane.setTitle(this.editingDomain.getResourceSet());
+ selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ selectionViewer.setInput(editingDomain.getResourceSet());
+ selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ viewerPane.setTitle(editingDomain.getResourceSet());
- new AdapterFactoryTreeEditor(this.selectionViewer.getTree(), this.adapterFactory);
+ new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
- createContextMenuFor(this.selectionViewer);
+ createContextMenuFor(selectionViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_SelectionPage_label")); //$NON-NLS-1$
}
@@ -1065,29 +1037,28 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
// Create a page for the parent tree view.
//
{
- ViewerPane viewerPane = new ViewerPane(getSite().getPage(), NattableEditor.this) {
-
- @Override
- public Viewer createViewer(Composite composite) {
- Tree tree = new Tree(composite, SWT.MULTI);
- TreeViewer newTreeViewer = new TreeViewer(tree);
- return newTreeViewer;
- }
-
- @Override
- public void requestActivation() {
- super.requestActivation();
- setCurrentViewerPane(this);
- }
- };
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NattableEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
viewerPane.createControl(getContainer());
- this.parentViewer = (TreeViewer)viewerPane.getViewer();
- this.parentViewer.setAutoExpandLevel(30);
- this.parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(this.adapterFactory));
- this.parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ parentViewer = (TreeViewer)viewerPane.getViewer();
+ parentViewer.setAutoExpandLevel(30);
+ parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
+ parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.parentViewer);
+ createContextMenuFor(parentViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_ParentPage_label")); //$NON-NLS-1$
}
@@ -1095,25 +1066,24 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
// This is the page for the list viewer
//
{
- ViewerPane viewerPane = new ViewerPane(getSite().getPage(), NattableEditor.this) {
-
- @Override
- public Viewer createViewer(Composite composite) {
- return new ListViewer(composite);
- }
-
- @Override
- public void requestActivation() {
- super.requestActivation();
- setCurrentViewerPane(this);
- }
- };
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NattableEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new ListViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
viewerPane.createControl(getContainer());
- this.listViewer = (ListViewer)viewerPane.getViewer();
- this.listViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.listViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ listViewer = (ListViewer)viewerPane.getViewer();
+ listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.listViewer);
+ createContextMenuFor(listViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_ListPage_label")); //$NON-NLS-1$
}
@@ -1121,27 +1091,26 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
// This is the page for the tree viewer
//
{
- ViewerPane viewerPane = new ViewerPane(getSite().getPage(), NattableEditor.this) {
-
- @Override
- public Viewer createViewer(Composite composite) {
- return new TreeViewer(composite);
- }
-
- @Override
- public void requestActivation() {
- super.requestActivation();
- setCurrentViewerPane(this);
- }
- };
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NattableEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
viewerPane.createControl(getContainer());
- this.treeViewer = (TreeViewer)viewerPane.getViewer();
- this.treeViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ treeViewer = (TreeViewer)viewerPane.getViewer();
+ treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- new AdapterFactoryTreeEditor(this.treeViewer.getTree(), this.adapterFactory);
+ new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
- createContextMenuFor(this.treeViewer);
+ createContextMenuFor(treeViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TreePage_label")); //$NON-NLS-1$
}
@@ -1149,23 +1118,22 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
// This is the page for the table viewer.
//
{
- ViewerPane viewerPane = new ViewerPane(getSite().getPage(), NattableEditor.this) {
-
- @Override
- public Viewer createViewer(Composite composite) {
- return new TableViewer(composite);
- }
-
- @Override
- public void requestActivation() {
- super.requestActivation();
- setCurrentViewerPane(this);
- }
- };
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NattableEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TableViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
viewerPane.createControl(getContainer());
- this.tableViewer = (TableViewer)viewerPane.getViewer();
+ tableViewer = (TableViewer)viewerPane.getViewer();
- Table table = this.tableViewer.getTable();
+ Table table = tableViewer.getTable();
TableLayout layout = new TableLayout();
table.setLayout(layout);
table.setHeaderVisible(true);
@@ -1181,11 +1149,11 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
selfColumn.setText(getString("_UI_SelfColumn_label")); //$NON-NLS-1$
selfColumn.setResizable(true);
- this.tableViewer.setColumnProperties(new String[]{ "a", "b" }); //$NON-NLS-1$ //$NON-NLS-2$
- this.tableViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ tableViewer.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
+ tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.tableViewer);
+ createContextMenuFor(tableViewer);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TablePage_label")); //$NON-NLS-1$
}
@@ -1193,24 +1161,23 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
// This is the page for the table tree viewer.
//
{
- ViewerPane viewerPane = new ViewerPane(getSite().getPage(), NattableEditor.this) {
-
- @Override
- public Viewer createViewer(Composite composite) {
- return new TreeViewer(composite);
- }
-
- @Override
- public void requestActivation() {
- super.requestActivation();
- setCurrentViewerPane(this);
- }
- };
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NattableEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
viewerPane.createControl(getContainer());
- this.treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
+ treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
- Tree tree = this.treeViewerWithColumns.getTree();
+ Tree tree = treeViewerWithColumns.getTree();
tree.setLayoutData(new FillLayout());
tree.setHeaderVisible(true);
tree.setLinesVisible(true);
@@ -1225,46 +1192,45 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
selfColumn.setResizable(true);
selfColumn.setWidth(200);
- this.treeViewerWithColumns.setColumnProperties(new String[]{ "a", "b" }); //$NON-NLS-1$ //$NON-NLS-2$
- this.treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
+ treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- createContextMenuFor(this.treeViewerWithColumns);
+ createContextMenuFor(treeViewerWithColumns);
int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label")); //$NON-NLS-1$
}
- getSite().getShell().getDisplay().asyncExec(new Runnable() {
-
- public void run() {
- setActivePage(0);
- }
- });
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ setActivePage(0);
+ }
+ });
}
// Ensures that this editor will only display the page's tab
// area if there are more than one page
//
- getContainer().addControlListener(new ControlAdapter() {
-
- boolean guard = false;
-
- @Override
- public void controlResized(ControlEvent event) {
- if(!this.guard) {
- this.guard = true;
- hideTabs();
- this.guard = false;
+ getContainer().addControlListener
+ (new ControlAdapter() {
+ boolean guard = false;
+ @Override
+ public void controlResized(ControlEvent event) {
+ if (!guard) {
+ guard = true;
+ hideTabs();
+ guard = false;
+ }
}
- }
- });
-
- getSite().getShell().getDisplay().asyncExec(new Runnable() {
-
- public void run() {
- updateProblemIndication();
- }
- });
+ });
+
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
}
/**
@@ -1272,13 +1238,12 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* this hides the single tab at the bottom.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected void hideTabs() {
- if(getPageCount() <= 1) {
+ if (getPageCount() <= 1) {
setPageText(0, ""); //$NON-NLS-1$
- if(getContainer() instanceof CTabFolder) {
+ if (getContainer() instanceof CTabFolder) {
((CTabFolder)getContainer()).setTabHeight(1);
Point point = getContainer().getSize();
getContainer().setSize(point.x, point.y + 6);
@@ -1291,13 +1256,12 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* this shows the tabs at the bottom.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected void showTabs() {
- if(getPageCount() > 1) {
+ if (getPageCount() > 1) {
setPageText(0, getString("_UI_SelectionPage_label")); //$NON-NLS-1$
- if(getContainer() instanceof CTabFolder) {
+ if (getContainer() instanceof CTabFolder) {
((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT);
Point point = getContainer().getSize();
getContainer().setSize(point.x, point.y - 6);
@@ -1309,15 +1273,14 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This is used to track the active viewer.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
protected void pageChange(int pageIndex) {
super.pageChange(pageIndex);
- if(this.contentOutlinePage != null) {
- handleContentOutlineSelection(this.contentOutlinePage.getSelection());
+ if (contentOutlinePage != null) {
+ handleContentOutlineSelection(contentOutlinePage.getSelection());
}
}
@@ -1325,19 +1288,21 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This is how the framework determines which interfaces we implement.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@SuppressWarnings("rawtypes")
@Override
public Object getAdapter(Class key) {
- if(key.equals(IContentOutlinePage.class)) {
+ if (key.equals(IContentOutlinePage.class)) {
return showOutlineView() ? getContentOutlinePage() : null;
- } else if(key.equals(IPropertySheetPage.class)) {
+ }
+ else if (key.equals(IPropertySheetPage.class)) {
return getPropertySheetPage();
- } else if(key.equals(IGotoMarker.class)) {
+ }
+ else if (key.equals(IGotoMarker.class)) {
return this;
- } else {
+ }
+ else {
return super.getAdapter(key);
}
}
@@ -1346,42 +1311,40 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This accesses a cached version of the content outliner.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public IContentOutlinePage getContentOutlinePage() {
- if(this.contentOutlinePage == null) {
+ if (contentOutlinePage == null) {
// The content outline is just a tree.
//
class MyContentOutlinePage extends ContentOutlinePage {
-
@Override
public void createControl(Composite parent) {
super.createControl(parent);
- NattableEditor.this.contentOutlineViewer = getTreeViewer();
- NattableEditor.this.contentOutlineViewer.addSelectionChangedListener(this);
+ contentOutlineViewer = getTreeViewer();
+ contentOutlineViewer.addSelectionChangedListener(this);
// Set up the tree viewer.
//
- NattableEditor.this.contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(NattableEditor.this.adapterFactory));
- NattableEditor.this.contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(NattableEditor.this.adapterFactory));
- NattableEditor.this.contentOutlineViewer.setInput(NattableEditor.this.editingDomain.getResourceSet());
+ contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ contentOutlineViewer.setInput(editingDomain.getResourceSet());
// Make sure our popups work.
//
- createContextMenuFor(NattableEditor.this.contentOutlineViewer);
+ createContextMenuFor(contentOutlineViewer);
- if(!NattableEditor.this.editingDomain.getResourceSet().getResources().isEmpty()) {
- // Select the root object in the view.
- //
- NattableEditor.this.contentOutlineViewer.setSelection(new StructuredSelection(NattableEditor.this.editingDomain.getResourceSet().getResources().get(0)), true);
+ if (!editingDomain.getResourceSet().getResources().isEmpty()) {
+ // Select the root object in the view.
+ //
+ contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
}
}
@Override
public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
super.makeContributions(menuManager, toolBarManager, statusLineManager);
- NattableEditor.this.contentOutlineStatusLineManager = statusLineManager;
+ contentOutlineStatusLineManager = statusLineManager;
}
@Override
@@ -1391,47 +1354,46 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
}
}
- this.contentOutlinePage = new MyContentOutlinePage();
+ contentOutlinePage = new MyContentOutlinePage();
// Listen to selection so that we can handle it is a special way.
//
- this.contentOutlinePage.addSelectionChangedListener(new ISelectionChangedListener() {
-
- // This ensures that we handle selections correctly.
- //
- public void selectionChanged(SelectionChangedEvent event) {
- handleContentOutlineSelection(event.getSelection());
- }
- });
+ contentOutlinePage.addSelectionChangedListener
+ (new ISelectionChangedListener() {
+ // This ensures that we handle selections correctly.
+ //
+ public void selectionChanged(SelectionChangedEvent event) {
+ handleContentOutlineSelection(event.getSelection());
+ }
+ });
}
- return this.contentOutlinePage;
+ return contentOutlinePage;
}
/**
* This accesses a cached version of the property sheet.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public IPropertySheetPage getPropertySheetPage() {
- PropertySheetPage propertySheetPage = new ExtendedPropertySheetPage(this.editingDomain) {
-
- @Override
- public void setSelectionToViewer(List<?> selection) {
- NattableEditor.this.setSelectionToViewer(selection);
- NattableEditor.this.setFocus();
- }
+ PropertySheetPage propertySheetPage =
+ new ExtendedPropertySheetPage(editingDomain) {
+ @Override
+ public void setSelectionToViewer(List<?> selection) {
+ NattableEditor.this.setSelectionToViewer(selection);
+ NattableEditor.this.setFocus();
+ }
- @Override
- public void setActionBars(IActionBars actionBars) {
- super.setActionBars(actionBars);
- getActionBarContributor().shareGlobalActions(this, actionBars);
- }
- };
- propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- this.propertySheetPages.add(propertySheetPage);
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ };
+ propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
+ propertySheetPages.add(propertySheetPage);
return propertySheetPage;
}
@@ -1440,35 +1402,35 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This deals with how we want selection in the outliner to affect the other views.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public void handleContentOutlineSelection(ISelection selection) {
- if(this.currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
+ if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
- if(selectedElements.hasNext()) {
+ if (selectedElements.hasNext()) {
// Get the first selected element.
//
Object selectedElement = selectedElements.next();
// If it's the selection viewer, then we want it to select the same selection as this selection.
//
- if(this.currentViewerPane.getViewer() == this.selectionViewer) {
+ if (currentViewerPane.getViewer() == selectionViewer) {
ArrayList<Object> selectionList = new ArrayList<Object>();
selectionList.add(selectedElement);
- while(selectedElements.hasNext()) {
+ while (selectedElements.hasNext()) {
selectionList.add(selectedElements.next());
}
// Set the selection to the widget.
//
- this.selectionViewer.setSelection(new StructuredSelection(selectionList));
- } else {
+ selectionViewer.setSelection(new StructuredSelection(selectionList));
+ }
+ else {
// Set the input to the widget.
//
- if(this.currentViewerPane.getViewer().getInput() != selectedElement) {
- this.currentViewerPane.getViewer().setInput(selectedElement);
- this.currentViewerPane.setTitle(selectedElement);
+ if (currentViewerPane.getViewer().getInput() != selectedElement) {
+ currentViewerPane.getViewer().setInput(selectedElement);
+ currentViewerPane.setTitle(selectedElement);
}
}
}
@@ -1479,12 +1441,11 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This is for implementing {@link IEditorPart} and simply tests the command stack.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
public boolean isDirty() {
- return ((BasicCommandStack)this.editingDomain.getCommandStack()).isSaveNeeded();
+ return ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();
}
/**
@@ -1554,18 +1515,18 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* The implementation uses the URI converter from the editor's resource set to try to open an input stream.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected boolean isPersisted(Resource resource) {
boolean result = false;
try {
- InputStream stream = this.editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
- if(stream != null) {
+ InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
+ if (stream != null) {
result = true;
stream.close();
}
- } catch (IOException e) {
+ }
+ catch (IOException e) {
// Ignore
}
return result;
@@ -1575,7 +1536,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This always returns true because it is not currently supported.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
@@ -1587,7 +1547,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This also changes the editor's input.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
@@ -1595,9 +1554,9 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
saveAsDialog.open();
IPath path = saveAsDialog.getResult();
- if(path != null) {
+ if (path != null) {
IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- if(file != null) {
+ if (file != null) {
doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));
}
}
@@ -1606,26 +1565,27 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected void doSaveAs(URI uri, IEditorInput editorInput) {
- (this.editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
+ (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
setInputWithNotify(editorInput);
setPartName(editorInput.getName());
- IProgressMonitor progressMonitor = getActionBars().getStatusLineManager() != null ? getActionBars().getStatusLineManager().getProgressMonitor() : new NullProgressMonitor();
+ IProgressMonitor progressMonitor =
+ getActionBars().getStatusLineManager() != null ?
+ getActionBars().getStatusLineManager().getProgressMonitor() :
+ new NullProgressMonitor();
doSave(progressMonitor);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public void gotoMarker(IMarker marker) {
- List<?> targetObjects = this.markerHelper.getTargetObjects(this.editingDomain, marker);
- if(!targetObjects.isEmpty()) {
+ List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker);
+ if (!targetObjects.isEmpty()) {
setSelectionToViewer(targetObjects);
}
}
@@ -1634,7 +1594,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This is called during startup.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
@@ -1643,21 +1602,21 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
setInputWithNotify(editorInput);
setPartName(editorInput.getName());
site.setSelectionProvider(this);
- site.getPage().addPartListener(this.partListener);
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this.resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+ site.getPage().addPartListener(partListener);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
public void setFocus() {
- if(this.currentViewerPane != null) {
- this.currentViewerPane.setFocus();
- } else {
+ if (currentViewerPane != null) {
+ currentViewerPane.setFocus();
+ }
+ else {
getControl(getActivePage()).setFocus();
}
}
@@ -1666,33 +1625,30 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public void addSelectionChangedListener(ISelectionChangedListener listener) {
- this.selectionChangedListeners.add(listener);
+ selectionChangedListeners.add(listener);
}
/**
* This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- this.selectionChangedListeners.remove(listener);
+ selectionChangedListeners.remove(listener);
}
/**
* This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public ISelection getSelection() {
- return this.editorSelection;
+ return editorSelection;
}
/**
@@ -1700,13 +1656,12 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* Calling this result will notify the listeners.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public void setSelection(ISelection selection) {
- this.editorSelection = selection;
+ editorSelection = selection;
- for(ISelectionChangedListener listener : this.selectionChangedListeners) {
+ for (ISelectionChangedListener listener : selectionChangedListeners) {
listener.selectionChanged(new SelectionChangedEvent(this, selection));
}
setStatusLineManager(selection);
@@ -1715,34 +1670,32 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public void setStatusLineManager(ISelection selection) {
- IStatusLineManager statusLineManager = this.currentViewer != null && this.currentViewer == this.contentOutlineViewer ? this.contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
+ IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
+ contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
- if(statusLineManager != null) {
- if(selection instanceof IStructuredSelection) {
+ if (statusLineManager != null) {
+ if (selection instanceof IStructuredSelection) {
Collection<?> collection = ((IStructuredSelection)selection).toList();
- switch(collection.size()) {
- case 0:
- {
- statusLineManager.setMessage(getString("_UI_NoObjectSelected")); //$NON-NLS-1$
- break;
- }
- case 1:
- {
- String text = new AdapterFactoryItemDelegator(this.adapterFactory).getText(collection.iterator().next());
- statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); //$NON-NLS-1$
- break;
- }
- default:
- {
- statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size()))); //$NON-NLS-1$
- break;
- }
+ switch (collection.size()) {
+ case 0: {
+ statusLineManager.setMessage(getString("_UI_NoObjectSelected")); //$NON-NLS-1$
+ break;
+ }
+ case 1: {
+ String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
+ statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); //$NON-NLS-1$
+ break;
+ }
+ default: {
+ statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size()))); //$NON-NLS-1$
+ break;
+ }
}
- } else {
+ }
+ else {
statusLineManager.setMessage(""); //$NON-NLS-1$
}
}
@@ -1752,7 +1705,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This looks up a string in the plugin's plugin.properties file.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
private static String getString(String key) {
@@ -1763,18 +1715,16 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* This looks up a string in plugin.properties, making a substitution.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
private static String getString(String key, Object s1) {
- return NattableEditorPlugin.INSTANCE.getString(key, new Object[]{ s1 });
+ return NattableEditorPlugin.INSTANCE.getString(key, new Object [] { s1 });
}
/**
* This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public void menuAboutToShow(IMenuManager menuManager) {
@@ -1784,7 +1734,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public EditingDomainActionBarContributor getActionBarContributor() {
@@ -1794,7 +1743,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public IActionBars getActionBars() {
@@ -1804,39 +1752,37 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public AdapterFactory getAdapterFactory() {
- return this.adapterFactory;
+ return adapterFactory;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
public void dispose() {
- this.updateProblemIndication = false;
+ updateProblemIndication = false;
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(this.resourceChangeListener);
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
- getSite().getPage().removePartListener(this.partListener);
+ getSite().getPage().removePartListener(partListener);
- this.adapterFactory.dispose();
+ adapterFactory.dispose();
- if(getActionBarContributor().getActiveEditor() == this) {
+ if (getActionBarContributor().getActiveEditor() == this) {
getActionBarContributor().setActiveEditor(null);
}
- for(PropertySheetPage propertySheetPage : this.propertySheetPages) {
+ for (PropertySheetPage propertySheetPage : propertySheetPages) {
propertySheetPage.dispose();
}
- if(this.contentOutlinePage != null) {
- this.contentOutlinePage.dispose();
+ if (contentOutlinePage != null) {
+ contentOutlinePage.dispose();
}
super.dispose();
@@ -1846,7 +1792,6 @@ public class NattableEditor extends MultiPageEditorPart implements IEditingDomai
* Returns whether the outline view should be presented to the user.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected boolean showOutlineView() {

Back to the top