Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlorenzo2012-08-03 11:45:07 +0000
committervlorenzo2012-08-03 11:45:07 +0000
commit640d53f022589099e10a4d3d4785c832812254bb (patch)
treea314228a76d1ac94dcd9f4fb0328b1d798572bab /incoming
parent9ca1b4307e70d5199d11d6c057c42a9ebdee2140 (diff)
downloadorg.eclipse.papyrus-640d53f022589099e10a4d3d4785c832812254bb.tar.gz
org.eclipse.papyrus-640d53f022589099e10a4d3d4785c832812254bb.tar.xz
org.eclipse.papyrus-640d53f022589099e10a4d3d4785c832812254bb.zip
A save of my work on the new tables
Rename feature into ContextFeature
Diffstat (limited to 'incoming')
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/AbstractCreateTableEditorHandler.java2
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/presentation/PapyrustableconfigurationEditor.java1217
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/presentation/PapyrustableconfigurationEditorPlugin.java11
3 files changed, 643 insertions, 587 deletions
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/AbstractCreateTableEditorHandler.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/AbstractCreateTableEditorHandler.java
index 6761edf2011..cca568fee2d 100644
--- a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/AbstractCreateTableEditorHandler.java
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/AbstractCreateTableEditorHandler.java
@@ -185,7 +185,7 @@ public abstract class AbstractCreateTableEditorHandler extends AbstractHandler {
final PapyrusTableConfiguration configuration = getPapyrusTableConfiguration();
if(configuration != null) {
papyrusTable.setFillingMode(configuration.getFillingMode());
- papyrusTable.setFeature(configuration.getListenFeature());
+ papyrusTable.setContextFeature(configuration.getListenContextFeature());
papyrusTable.getQueries().addAll(configuration.getFillingQueries());
}
//TODO
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/presentation/PapyrustableconfigurationEditor.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/presentation/PapyrustableconfigurationEditor.java
index cc48dab9eb4..e69a4e62aed 100644
--- a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/presentation/PapyrustableconfigurationEditor.java
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/presentation/PapyrustableconfigurationEditor.java
@@ -82,8 +82,6 @@ import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.query.provider.Query
import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.runtime.provider.RuntimeItemProviderAdapterFactory;
import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.serialization.provider.SerializationItemProviderAdapterFactory;
import org.eclipse.emf.facet.widgets.celleditors.modelCellEditor.provider.ModelCellEditorItemProviderAdapterFactory;
-import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.provider.TableItemProviderAdapterFactory;
-import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.tableconfiguration.provider.TableconfigurationItemProviderAdapterFactory;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IStatusLineManager;
@@ -145,6 +143,7 @@ import org.eclipse.ui.views.properties.PropertySheetPage;
* This is an example of a Papyrustableconfiguration model editor.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public class PapyrustableconfigurationEditor extends MultiPageEditorPart implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker {
@@ -153,6 +152,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* 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;
@@ -161,6 +161,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* This is the one adapter factory used for providing views of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected ComposedAdapterFactory adapterFactory;
@@ -169,6 +170,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* This is the content outline page.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected IContentOutlinePage contentOutlinePage;
@@ -177,6 +179,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* This is a kludge...
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected IStatusLineManager contentOutlineStatusLineManager;
@@ -185,6 +188,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* This is the content outline page's viewer.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected TreeViewer contentOutlineViewer;
@@ -193,6 +197,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* This is the property sheet page.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected PropertySheetPage propertySheetPage;
@@ -202,6 +207,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* The parent relation must be correctly defined for this to work.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected TreeViewer selectionViewer;
@@ -210,6 +216,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* 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;
@@ -218,6 +225,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* This shows how a tree view works.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected TreeViewer treeViewer;
@@ -227,6 +235,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* A list viewer doesn't support icons.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected ListViewer listViewer;
@@ -236,6 +245,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* A table can be used as a list with icons.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected TableViewer tableViewer;
@@ -244,6 +254,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* This shows how a tree view with columns works.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected TreeViewer treeViewerWithColumns;
@@ -252,6 +263,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* This keeps track of the active viewer pane, in the book.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected ViewerPane currentViewerPane;
@@ -260,6 +272,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* 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;
@@ -268,6 +281,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* This listens to which ever viewer is active.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected ISelectionChangedListener selectionChangedListener;
@@ -276,6 +290,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* 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>();
@@ -284,6 +299,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* This keeps track of the selection of the editor as a whole.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected ISelection editorSelection = StructuredSelection.EMPTY;
@@ -293,6 +309,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* in Eclipse's Problems View.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected MarkerHelper markerHelper = new EditUIMarkerHelper();
@@ -301,45 +318,50 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* 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(PapyrustableconfigurationEditor.this);
- setCurrentViewer(contentOutlineViewer);
- }
- }
- else if (p instanceof PropertySheet) {
- if (((PropertySheet)p).getCurrentPage() == propertySheetPage) {
- getActionBarContributor().setActiveEditor(PapyrustableconfigurationEditor.this);
- handleActivate();
- }
+ public void partActivated(final IWorkbenchPart p) {
+ if(p instanceof ContentOutline) {
+ if(((ContentOutline)p).getCurrentPage() == PapyrustableconfigurationEditor.this.contentOutlinePage) {
+ getActionBarContributor().setActiveEditor(PapyrustableconfigurationEditor.this);
+
+ setCurrentViewer(PapyrustableconfigurationEditor.this.contentOutlineViewer);
}
- else if (p == PapyrustableconfigurationEditor.this) {
+ } else if(p instanceof PropertySheet) {
+ if(((PropertySheet)p).getCurrentPage() == PapyrustableconfigurationEditor.this.propertySheetPage) {
+ getActionBarContributor().setActiveEditor(PapyrustableconfigurationEditor.this);
handleActivate();
}
+ } else if(p == PapyrustableconfigurationEditor.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(final IWorkbenchPart p) {
+ // Ignore.
+ }
+
+ public void partClosed(final IWorkbenchPart p) {
+ // Ignore.
+ }
+
+ public void partDeactivated(final IWorkbenchPart p) {
+ // Ignore.
+ }
+
+ public void partOpened(final 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>();
@@ -348,6 +370,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* Resources that have been changed since last activation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected Collection<Resource> changedResources = new ArrayList<Resource>();
@@ -356,6 +379,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* Resources that have been saved.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected Collection<Resource> savedResources = new ArrayList<Resource>();
@@ -364,6 +388,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* 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>();
@@ -372,6 +397,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* Controls whether the problem indication should be updated.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected boolean updateProblemIndication = true;
@@ -380,161 +406,163 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* 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);
- }
- if (updateProblemIndication) {
- getSite().getShell().getDisplay().asyncExec
- (new Runnable() {
- public void run() {
- updateProblemIndication();
- }
- });
+ @Override
+ public void notifyChanged(final 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:
+ {
+ final Resource resource = (Resource)notification.getNotifier();
+ final Diagnostic diagnostic = analyzeResourceProblems(resource, null);
+ if(diagnostic.getSeverity() != Diagnostic.OK) {
+ PapyrustableconfigurationEditor.this.resourceToDiagnosticMap.put(resource, diagnostic);
+ } else {
+ PapyrustableconfigurationEditor.this.resourceToDiagnosticMap.remove(resource);
+ }
+
+ if(PapyrustableconfigurationEditor.this.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 setTarget(final Resource target) {
+ basicSetTarget(target);
+ }
- @Override
- protected void unsetTarget(Resource target) {
- basicUnsetTarget(target);
- }
- };
+ @Override
+ protected void unsetTarget(final Resource target) {
+ basicUnsetTarget(target);
+ }
+ };
/**
* 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 = 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);
- }
+
+ public void resourceChanged(final IResourceChangeEvent event) {
+ final IResourceDelta delta = event.getDelta();
+ try {
+ class ResourceDeltaVisitor implements IResourceDeltaVisitor {
+
+ protected ResourceSet resourceSet = PapyrustableconfigurationEditor.this.editingDomain.getResourceSet();
+
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ public boolean visit(final IResourceDelta delta) {
+ if(delta.getResource().getType() == IResource.FILE) {
+ if(delta.getKind() == IResourceDelta.REMOVED || delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
+ final 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(!PapyrustableconfigurationEditor.this.savedResources.remove(resource)) {
+ this.changedResources.add(resource);
}
}
}
-
- return true;
- }
-
- public Collection<Resource> getChangedResources() {
- return changedResources;
}
- public Collection<Resource> getRemovedResources() {
- return removedResources;
- }
+ return true;
}
- 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(PapyrustableconfigurationEditor.this, false);
- }
- }
- });
+ public Collection<Resource> getChangedResources() {
+ return this.changedResources;
}
- if (!visitor.getChangedResources().isEmpty()) {
- getSite().getShell().getDisplay().asyncExec
- (new Runnable() {
- public void run() {
- changedResources.addAll(visitor.getChangedResources());
- if (getSite().getPage().getActiveEditor() == PapyrustableconfigurationEditor.this) {
- handleActivate();
- }
- }
- });
+ public Collection<Resource> getRemovedResources() {
+ return this.removedResources;
}
}
- catch (CoreException exception) {
- PapyrustableconfigurationEditorPlugin.INSTANCE.log(exception);
+
+ final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
+ delta.accept(visitor);
+
+ if(!visitor.getRemovedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec(new Runnable() {
+
+ public void run() {
+ PapyrustableconfigurationEditor.this.removedResources.addAll(visitor.getRemovedResources());
+ if(!isDirty()) {
+ getSite().getPage().closeEditor(PapyrustableconfigurationEditor.this, false);
+ }
+ }
+ });
+ }
+
+ if(!visitor.getChangedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec(new Runnable() {
+
+ public void run() {
+ PapyrustableconfigurationEditor.this.changedResources.addAll(visitor.getChangedResources());
+ if(getSite().getPage().getActiveEditor() == PapyrustableconfigurationEditor.this) {
+ handleActivate();
+ }
+ }
+ });
}
+ } catch (final CoreException exception) {
+ PapyrustableconfigurationEditorPlugin.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 (editingDomain.getResourceToReadOnlyMap() != null) {
- editingDomain.getResourceToReadOnlyMap().clear();
+ if(this.editingDomain.getResourceToReadOnlyMap() != null) {
+ this.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 (!removedResources.isEmpty()) {
- if (handleDirtyConflict()) {
+ if(!this.removedResources.isEmpty()) {
+ if(handleDirtyConflict()) {
getSite().getPage().closeEditor(PapyrustableconfigurationEditor.this, false);
+ } else {
+ this.removedResources.clear();
+ this.changedResources.clear();
+ this.savedResources.clear();
}
- else {
- removedResources.clear();
- changedResources.clear();
- savedResources.clear();
- }
- }
- else if (!changedResources.isEmpty()) {
- changedResources.removeAll(savedResources);
+ } else if(!this.changedResources.isEmpty()) {
+ this.changedResources.removeAll(this.savedResources);
handleChangedResources();
- changedResources.clear();
- savedResources.clear();
+ this.changedResources.clear();
+ this.savedResources.clear();
}
}
@@ -542,35 +570,35 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* Handles what to do with changed resources on activation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected void handleChangedResources() {
- if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
- if (isDirty()) {
- changedResources.addAll(editingDomain.getResourceSet().getResources());
+ if(!this.changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
+ if(isDirty()) {
+ this.changedResources.addAll(this.editingDomain.getResourceSet().getResources());
}
- editingDomain.getCommandStack().flush();
+ this.editingDomain.getCommandStack().flush();
- updateProblemIndication = false;
- for (Resource resource : changedResources) {
- if (resource.isLoaded()) {
+ this.updateProblemIndication = false;
+ for(final Resource resource : this.changedResources) {
+ if(resource.isLoaded()) {
resource.unload();
try {
resource.load(Collections.EMPTY_MAP);
- }
- catch (IOException exception) {
- if (!resourceToDiagnosticMap.containsKey(resource)) {
- resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ } catch (final IOException exception) {
+ if(!this.resourceToDiagnosticMap.containsKey(resource)) {
+ this.resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
}
}
}
}
- if (AdapterFactoryEditingDomain.isStale(editorSelection)) {
+ if(AdapterFactoryEditingDomain.isStale(this.editorSelection)) {
setSelection(StructuredSelection.EMPTY);
}
- updateProblemIndication = true;
+ this.updateProblemIndication = true;
updateProblemIndication();
}
}
@@ -579,52 +607,45 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* Updates the problems indication with the information described in the specified diagnostic.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected void updateProblemIndication() {
- if (updateProblemIndication) {
- BasicDiagnostic diagnostic =
- new BasicDiagnostic
- (Diagnostic.OK,
- "org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor", //$NON-NLS-1$
- 0,
- null,
- new Object [] { editingDomain.getResourceSet() });
- for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) {
- if (childDiagnostic.getSeverity() != Diagnostic.OK) {
+ if(this.updateProblemIndication) {
+ final BasicDiagnostic diagnostic = new BasicDiagnostic(Diagnostic.OK, "org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor", //$NON-NLS-1$
+ 0, null, new Object[]{ this.editingDomain.getResourceSet() });
+ for(final Diagnostic childDiagnostic : this.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) {
- ProblemEditorPart problemEditorPart = new ProblemEditorPart();
+ } else if(diagnostic.getSeverity() != Diagnostic.OK) {
+ final ProblemEditorPart problemEditorPart = new ProblemEditorPart();
problemEditorPart.setDiagnostic(diagnostic);
- problemEditorPart.setMarkerHelper(markerHelper);
+ problemEditorPart.setMarkerHelper(this.markerHelper);
try {
addPage(++lastEditorPage, problemEditorPart, getEditorInput());
setPageText(lastEditorPage, problemEditorPart.getPartName());
setActivePage(lastEditorPage);
showTabs();
- }
- catch (PartInitException exception) {
+ } catch (final PartInitException exception) {
PapyrustableconfigurationEditorPlugin.INSTANCE.log(exception);
}
}
- if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
- markerHelper.deleteMarkers(editingDomain.getResourceSet());
- if (diagnostic.getSeverity() != Diagnostic.OK) {
+ if(this.markerHelper.hasMarkers(this.editingDomain.getResourceSet())) {
+ this.markerHelper.deleteMarkers(this.editingDomain.getResourceSet());
+ if(diagnostic.getSeverity() != Diagnostic.OK) {
try {
- markerHelper.createMarkers(diagnostic);
- }
- catch (CoreException exception) {
+ this.markerHelper.createMarkers(diagnostic);
+ } catch (final CoreException exception) {
PapyrustableconfigurationEditorPlugin.INSTANCE.log(exception);
}
}
@@ -636,20 +657,19 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* 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 PapyrustableconfigurationEditor() {
@@ -719,10 +739,11 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* This is here for the listener to be able to call it.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
- protected void firePropertyChange(int action) {
+ protected void firePropertyChange(final int action) {
super.firePropertyChange(action);
}
@@ -730,42 +751,45 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* This sets the selection into whichever viewer is active.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
- public void setSelectionToViewer(Collection<?> collection) {
+ public void setSelectionToViewer(final 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 (currentViewer != null) {
- currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
- }
+ if(theSelection != null && !theSelection.isEmpty()) {
+ final Runnable runnable = new Runnable() {
+
+ public void run() {
+ // Try to select the items in the current content viewer of the editor.
+ //
+ if(PapyrustableconfigurationEditor.this.currentViewer != null) {
+ PapyrustableconfigurationEditor.this.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 editingDomain;
+ return this.editingDomain;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider {
@@ -773,52 +797,57 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
- public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) {
+ public ReverseAdapterFactoryContentProvider(final AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
- public Object [] getElements(Object object) {
- Object parent = super.getParent(object);
+ public Object[] getElements(final Object object) {
+ final Object parent = super.getParent(object);
return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
- public Object [] getChildren(Object object) {
- Object parent = super.getParent(object);
+ public Object[] getChildren(final Object object) {
+ final Object parent = super.getParent(object);
return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
- public boolean hasChildren(Object object) {
- Object parent = super.getParent(object);
+ public boolean hasChildren(final Object object) {
+ final Object parent = super.getParent(object);
return parent != null;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
- public Object getParent(Object object) {
+ public Object getParent(final Object object) {
return null;
}
}
@@ -826,16 +855,17 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
- public void setCurrentViewerPane(ViewerPane viewerPane) {
- if (currentViewerPane != viewerPane) {
- if (currentViewerPane != null) {
- currentViewerPane.showFocus(false);
+ public void setCurrentViewerPane(final ViewerPane viewerPane) {
+ if(this.currentViewerPane != viewerPane) {
+ if(this.currentViewerPane != null) {
+ this.currentViewerPane.showFocus(false);
}
- currentViewerPane = viewerPane;
+ this.currentViewerPane = viewerPane;
}
- setCurrentViewer(currentViewerPane.getViewer());
+ setCurrentViewer(this.currentViewerPane.getViewer());
}
/**
@@ -843,44 +873,45 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* is the current one.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
- public void setCurrentViewer(Viewer viewer) {
+ public void setCurrentViewer(final Viewer viewer) {
// If it is changing...
//
- if (currentViewer != viewer) {
- if (selectionChangedListener == null) {
+ if(this.currentViewer != viewer) {
+ if(this.selectionChangedListener == null) {
// Create the listener on demand.
//
- selectionChangedListener =
- new ISelectionChangedListener() {
- // This just notifies those things that are affected by the section.
- //
- public void selectionChanged(SelectionChangedEvent selectionChangedEvent) {
- setSelection(selectionChangedEvent.getSelection());
- }
- };
+ this.selectionChangedListener = new ISelectionChangedListener() {
+
+ // This just notifies those things that are affected by the section.
+ //
+ public void selectionChanged(final SelectionChangedEvent selectionChangedEvent) {
+ setSelection(selectionChangedEvent.getSelection());
+ }
+ };
}
// Stop listening to the old one.
//
- if (currentViewer != null) {
- currentViewer.removeSelectionChangedListener(selectionChangedListener);
+ if(this.currentViewer != null) {
+ this.currentViewer.removeSelectionChangedListener(this.selectionChangedListener);
}
// Start listening to the new one.
//
- if (viewer != null) {
- viewer.addSelectionChangedListener(selectionChangedListener);
+ if(viewer != null) {
+ viewer.addSelectionChangedListener(this.selectionChangedListener);
}
// Remember it.
//
- currentViewer = viewer;
+ this.currentViewer = viewer;
// Set the editors selection based on the current viewer's selection.
//
- setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection());
+ setSelection(this.currentViewer == null ? StructuredSelection.EMPTY : this.currentViewer.getSelection());
}
}
@@ -888,58 +919,60 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* This returns the viewer as required by the {@link IViewerProvider} interface.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public Viewer getViewer() {
- return currentViewer;
+ return this.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) {
- MenuManager contextMenu = new MenuManager("#PopUp"); //$NON-NLS-1$
+ protected void createContextMenuFor(final StructuredViewer viewer) {
+ final MenuManager contextMenu = new MenuManager("#PopUp"); //$NON-NLS-1$
contextMenu.add(new Separator("additions")); //$NON-NLS-1$
contextMenu.setRemoveAllWhenShown(true);
contextMenu.addMenuListener(this);
- Menu menu= contextMenu.createContextMenu(viewer.getControl());
+ final 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() };
+ final int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
+ final Transfer[] transfers = new Transfer[]{ LocalTransfer.getInstance() };
viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
- viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(this.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() {
- URI resourceURI = EditUIUtil.getURI(getEditorInput());
+ final URI resourceURI = EditUIUtil.getURI(getEditorInput());
Exception exception = null;
Resource resource = null;
try {
// Load the resource through the editing domain.
//
- resource = editingDomain.getResourceSet().getResource(resourceURI, true);
- }
- catch (Exception e) {
+ resource = this.editingDomain.getResourceSet().getResource(resourceURI, true);
+ } catch (final Exception e) {
exception = e;
- resource = editingDomain.getResourceSet().getResource(resourceURI, false);
+ resource = this.editingDomain.getResourceSet().getResource(resourceURI, false);
}
- Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
- if (diagnostic.getSeverity() != Diagnostic.OK) {
- resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ final Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
+ if(diagnostic.getSeverity() != Diagnostic.OK) {
+ this.resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
}
- editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
+ this.editingDomain.getResourceSet().eAdapters().add(this.problemIndicationAdapter);
}
/**
@@ -947,30 +980,21 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* 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.table.efacet.papyrustableconfiguration.metamodel.editor", //$NON-NLS-1$
- 0,
- getString("_UI_CreateModelError_message", resource.getURI()), //$NON-NLS-1$
- new Object [] { exception == null ? (Object)resource : exception });
+ public Diagnostic analyzeResourceProblems(final Resource resource, final Exception exception) {
+ if(!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
+ final BasicDiagnostic basicDiagnostic = new BasicDiagnostic(Diagnostic.ERROR, "org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.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.table.efacet.papyrustableconfiguration.metamodel.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.table.efacet.papyrustableconfiguration.metamodel.editor", //$NON-NLS-1$
+ 0, getString("_UI_CreateModelError_message", resource.getURI()), //$NON-NLS-1$
+ new Object[]{ exception });
+ } else {
return Diagnostic.OK_INSTANCE;
}
}
@@ -979,6 +1003,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* This is the method used by the framework to install your own controls.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
@@ -989,238 +1014,245 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
// 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(), PapyrustableconfigurationEditor.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);
- }
- };
+ final ViewerPane viewerPane = new ViewerPane(getSite().getPage(), PapyrustableconfigurationEditor.this) {
+
+ @Override
+ public Viewer createViewer(final Composite composite) {
+ final Tree tree = new Tree(composite, SWT.MULTI);
+ final TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
viewerPane.createControl(getContainer());
- selectionViewer = (TreeViewer)viewerPane.getViewer();
- selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ this.selectionViewer = (TreeViewer)viewerPane.getViewer();
+ this.selectionViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
- selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- selectionViewer.setInput(editingDomain.getResourceSet());
- selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
- viewerPane.setTitle(editingDomain.getResourceSet());
+ 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());
- new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
+ new AdapterFactoryTreeEditor(this.selectionViewer.getTree(), this.adapterFactory);
- createContextMenuFor(selectionViewer);
- int pageIndex = addPage(viewerPane.getControl());
+ createContextMenuFor(this.selectionViewer);
+ final int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_SelectionPage_label")); //$NON-NLS-1$
}
// Create a page for the parent tree view.
//
{
- ViewerPane viewerPane =
- new ViewerPane(getSite().getPage(), PapyrustableconfigurationEditor.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);
- }
- };
+ final ViewerPane viewerPane = new ViewerPane(getSite().getPage(), PapyrustableconfigurationEditor.this) {
+
+ @Override
+ public Viewer createViewer(final Composite composite) {
+ final Tree tree = new Tree(composite, SWT.MULTI);
+ final TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
viewerPane.createControl(getContainer());
- parentViewer = (TreeViewer)viewerPane.getViewer();
- parentViewer.setAutoExpandLevel(30);
- parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
- parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ this.parentViewer = (TreeViewer)viewerPane.getViewer();
+ this.parentViewer.setAutoExpandLevel(30);
+ this.parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(this.adapterFactory));
+ this.parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
- createContextMenuFor(parentViewer);
- int pageIndex = addPage(viewerPane.getControl());
+ createContextMenuFor(this.parentViewer);
+ final int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_ParentPage_label")); //$NON-NLS-1$
}
// This is the page for the list viewer
//
{
- ViewerPane viewerPane =
- new ViewerPane(getSite().getPage(), PapyrustableconfigurationEditor.this) {
- @Override
- public Viewer createViewer(Composite composite) {
- return new ListViewer(composite);
- }
- @Override
- public void requestActivation() {
- super.requestActivation();
- setCurrentViewerPane(this);
- }
- };
+ final ViewerPane viewerPane = new ViewerPane(getSite().getPage(), PapyrustableconfigurationEditor.this) {
+
+ @Override
+ public Viewer createViewer(final Composite composite) {
+ return new ListViewer(composite);
+ }
+
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
viewerPane.createControl(getContainer());
- listViewer = (ListViewer)viewerPane.getViewer();
- listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
- listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ this.listViewer = (ListViewer)viewerPane.getViewer();
+ this.listViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
+ this.listViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
- createContextMenuFor(listViewer);
- int pageIndex = addPage(viewerPane.getControl());
+ createContextMenuFor(this.listViewer);
+ final int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_ListPage_label")); //$NON-NLS-1$
}
// This is the page for the tree viewer
//
{
- ViewerPane viewerPane =
- new ViewerPane(getSite().getPage(), PapyrustableconfigurationEditor.this) {
- @Override
- public Viewer createViewer(Composite composite) {
- return new TreeViewer(composite);
- }
- @Override
- public void requestActivation() {
- super.requestActivation();
- setCurrentViewerPane(this);
- }
- };
+ final ViewerPane viewerPane = new ViewerPane(getSite().getPage(), PapyrustableconfigurationEditor.this) {
+
+ @Override
+ public Viewer createViewer(final Composite composite) {
+ return new TreeViewer(composite);
+ }
+
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
viewerPane.createControl(getContainer());
- treeViewer = (TreeViewer)viewerPane.getViewer();
- treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
- treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ this.treeViewer = (TreeViewer)viewerPane.getViewer();
+ this.treeViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
+ this.treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
- new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
+ new AdapterFactoryTreeEditor(this.treeViewer.getTree(), this.adapterFactory);
- createContextMenuFor(treeViewer);
- int pageIndex = addPage(viewerPane.getControl());
+ createContextMenuFor(this.treeViewer);
+ final int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TreePage_label")); //$NON-NLS-1$
}
// This is the page for the table viewer.
//
{
- ViewerPane viewerPane =
- new ViewerPane(getSite().getPage(), PapyrustableconfigurationEditor.this) {
- @Override
- public Viewer createViewer(Composite composite) {
- return new TableViewer(composite);
- }
- @Override
- public void requestActivation() {
- super.requestActivation();
- setCurrentViewerPane(this);
- }
- };
+ final ViewerPane viewerPane = new ViewerPane(getSite().getPage(), PapyrustableconfigurationEditor.this) {
+
+ @Override
+ public Viewer createViewer(final Composite composite) {
+ return new TableViewer(composite);
+ }
+
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
viewerPane.createControl(getContainer());
- tableViewer = (TableViewer)viewerPane.getViewer();
+ this.tableViewer = (TableViewer)viewerPane.getViewer();
- Table table = tableViewer.getTable();
- TableLayout layout = new TableLayout();
+ final Table table = this.tableViewer.getTable();
+ final TableLayout layout = new TableLayout();
table.setLayout(layout);
table.setHeaderVisible(true);
table.setLinesVisible(true);
- TableColumn objectColumn = new TableColumn(table, SWT.NONE);
+ final TableColumn objectColumn = new TableColumn(table, SWT.NONE);
layout.addColumnData(new ColumnWeightData(3, 100, true));
objectColumn.setText(getString("_UI_ObjectColumn_label")); //$NON-NLS-1$
objectColumn.setResizable(true);
- TableColumn selfColumn = new TableColumn(table, SWT.NONE);
+ final TableColumn selfColumn = new TableColumn(table, SWT.NONE);
layout.addColumnData(new ColumnWeightData(2, 100, true));
selfColumn.setText(getString("_UI_SelfColumn_label")); //$NON-NLS-1$
selfColumn.setResizable(true);
- tableViewer.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
- tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
- tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ 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));
- createContextMenuFor(tableViewer);
- int pageIndex = addPage(viewerPane.getControl());
+ createContextMenuFor(this.tableViewer);
+ final int pageIndex = addPage(viewerPane.getControl());
setPageText(pageIndex, getString("_UI_TablePage_label")); //$NON-NLS-1$
}
// This is the page for the table tree viewer.
//
{
- ViewerPane viewerPane =
- new ViewerPane(getSite().getPage(), PapyrustableconfigurationEditor.this) {
- @Override
- public Viewer createViewer(Composite composite) {
- return new TreeViewer(composite);
- }
- @Override
- public void requestActivation() {
- super.requestActivation();
- setCurrentViewerPane(this);
- }
- };
+ final ViewerPane viewerPane = new ViewerPane(getSite().getPage(), PapyrustableconfigurationEditor.this) {
+
+ @Override
+ public Viewer createViewer(final Composite composite) {
+ return new TreeViewer(composite);
+ }
+
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
viewerPane.createControl(getContainer());
- treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
+ this.treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
- Tree tree = treeViewerWithColumns.getTree();
+ final Tree tree = this.treeViewerWithColumns.getTree();
tree.setLayoutData(new FillLayout());
tree.setHeaderVisible(true);
tree.setLinesVisible(true);
- TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE);
+ final TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE);
objectColumn.setText(getString("_UI_ObjectColumn_label")); //$NON-NLS-1$
objectColumn.setResizable(true);
objectColumn.setWidth(250);
- TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE);
+ final TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE);
selfColumn.setText(getString("_UI_SelfColumn_label")); //$NON-NLS-1$
selfColumn.setResizable(true);
selfColumn.setWidth(200);
- treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"}); //$NON-NLS-1$ //$NON-NLS-2$
- treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
- treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ 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));
- createContextMenuFor(treeViewerWithColumns);
- int pageIndex = addPage(viewerPane.getControl());
+ createContextMenuFor(this.treeViewerWithColumns);
+ final 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 (!guard) {
- guard = true;
- hideTabs();
- guard = false;
- }
+ getContainer().addControlListener(new ControlAdapter() {
+
+ boolean guard = false;
+
+ @Override
+ public void controlResized(final ControlEvent event) {
+ if(!this.guard) {
+ this.guard = true;
+ hideTabs();
+ this.guard = false;
}
- });
-
- getSite().getShell().getDisplay().asyncExec
- (new Runnable() {
- public void run() {
- updateProblemIndication();
- }
- });
+ }
+ });
+
+ getSite().getShell().getDisplay().asyncExec(new Runnable() {
+
+ public void run() {
+ updateProblemIndication();
+ }
+ });
}
/**
@@ -1228,14 +1260,15 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* 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();
+ final Point point = getContainer().getSize();
getContainer().setSize(point.x, point.y + 6);
}
}
@@ -1246,14 +1279,15 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* 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();
+ final Point point = getContainer().getSize();
getContainer().setSize(point.x, point.y - 6);
}
}
@@ -1263,14 +1297,15 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* This is used to track the active viewer.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
- protected void pageChange(int pageIndex) {
+ protected void pageChange(final int pageIndex) {
super.pageChange(pageIndex);
- if (contentOutlinePage != null) {
- handleContentOutlineSelection(contentOutlinePage.getSelection());
+ if(this.contentOutlinePage != null) {
+ handleContentOutlineSelection(this.contentOutlinePage.getSelection());
}
}
@@ -1278,21 +1313,19 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* 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)) {
+ public Object getAdapter(final Class key) {
+ 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);
}
}
@@ -1301,127 +1334,130 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* This accesses a cached version of the content outliner.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public IContentOutlinePage getContentOutlinePage() {
- if (contentOutlinePage == null) {
+ if(this.contentOutlinePage == null) {
// The content outline is just a tree.
//
class MyContentOutlinePage extends ContentOutlinePage {
+
@Override
- public void createControl(Composite parent) {
+ public void createControl(final Composite parent) {
super.createControl(parent);
- contentOutlineViewer = getTreeViewer();
- contentOutlineViewer.addSelectionChangedListener(this);
+ PapyrustableconfigurationEditor.this.contentOutlineViewer = getTreeViewer();
+ PapyrustableconfigurationEditor.this.contentOutlineViewer.addSelectionChangedListener(this);
// Set up the tree viewer.
//
- contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
- contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- contentOutlineViewer.setInput(editingDomain.getResourceSet());
+ PapyrustableconfigurationEditor.this.contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(PapyrustableconfigurationEditor.this.adapterFactory));
+ PapyrustableconfigurationEditor.this.contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(PapyrustableconfigurationEditor.this.adapterFactory));
+ PapyrustableconfigurationEditor.this.contentOutlineViewer.setInput(PapyrustableconfigurationEditor.this.editingDomain.getResourceSet());
// Make sure our popups work.
//
- createContextMenuFor(contentOutlineViewer);
+ createContextMenuFor(PapyrustableconfigurationEditor.this.contentOutlineViewer);
- if (!editingDomain.getResourceSet().getResources().isEmpty()) {
- // Select the root object in the view.
- //
- contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ if(!PapyrustableconfigurationEditor.this.editingDomain.getResourceSet().getResources().isEmpty()) {
+ // Select the root object in the view.
+ //
+ PapyrustableconfigurationEditor.this.contentOutlineViewer.setSelection(new StructuredSelection(PapyrustableconfigurationEditor.this.editingDomain.getResourceSet().getResources().get(0)), true);
}
}
@Override
- public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
+ public void makeContributions(final IMenuManager menuManager, final IToolBarManager toolBarManager, final IStatusLineManager statusLineManager) {
super.makeContributions(menuManager, toolBarManager, statusLineManager);
- contentOutlineStatusLineManager = statusLineManager;
+ PapyrustableconfigurationEditor.this.contentOutlineStatusLineManager = statusLineManager;
}
@Override
- public void setActionBars(IActionBars actionBars) {
+ public void setActionBars(final IActionBars actionBars) {
super.setActionBars(actionBars);
getActionBarContributor().shareGlobalActions(this, actionBars);
}
}
- contentOutlinePage = new MyContentOutlinePage();
+ this.contentOutlinePage = new MyContentOutlinePage();
// Listen to selection so that we can handle it is a special way.
//
- contentOutlinePage.addSelectionChangedListener
- (new ISelectionChangedListener() {
- // This ensures that we handle selections correctly.
- //
- public void selectionChanged(SelectionChangedEvent event) {
- handleContentOutlineSelection(event.getSelection());
- }
- });
+ this.contentOutlinePage.addSelectionChangedListener(new ISelectionChangedListener() {
+
+ // This ensures that we handle selections correctly.
+ //
+ public void selectionChanged(final SelectionChangedEvent event) {
+ handleContentOutlineSelection(event.getSelection());
+ }
+ });
}
- return contentOutlinePage;
+ return this.contentOutlinePage;
}
/**
* This accesses a cached version of the property sheet.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public IPropertySheetPage getPropertySheetPage() {
- if (propertySheetPage == null) {
- propertySheetPage =
- new ExtendedPropertySheetPage(editingDomain) {
- @Override
- public void setSelectionToViewer(List<?> selection) {
- PapyrustableconfigurationEditor.this.setSelectionToViewer(selection);
- PapyrustableconfigurationEditor.this.setFocus();
- }
+ if(this.propertySheetPage == null) {
+ this.propertySheetPage = new ExtendedPropertySheetPage(this.editingDomain) {
- @Override
- public void setActionBars(IActionBars actionBars) {
- super.setActionBars(actionBars);
- getActionBarContributor().shareGlobalActions(this, actionBars);
- }
- };
- propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
+ @Override
+ public void setSelectionToViewer(final List<?> selection) {
+ PapyrustableconfigurationEditor.this.setSelectionToViewer(selection);
+ PapyrustableconfigurationEditor.this.setFocus();
+ }
+
+ @Override
+ public void setActionBars(final IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ };
+ this.propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(this.adapterFactory));
}
- return propertySheetPage;
+ return this.propertySheetPage;
}
/**
* 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 (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
- Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
- if (selectedElements.hasNext()) {
+ public void handleContentOutlineSelection(final ISelection selection) {
+ if(this.currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
+ final Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
+ if(selectedElements.hasNext()) {
// Get the first selected element.
//
- Object selectedElement = selectedElements.next();
+ final Object selectedElement = selectedElements.next();
// If it's the selection viewer, then we want it to select the same selection as this selection.
//
- if (currentViewerPane.getViewer() == selectionViewer) {
- ArrayList<Object> selectionList = new ArrayList<Object>();
+ if(this.currentViewerPane.getViewer() == this.selectionViewer) {
+ final 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.
//
- selectionViewer.setSelection(new StructuredSelection(selectionList));
- }
- else {
+ this.selectionViewer.setSelection(new StructuredSelection(selectionList));
+ } else {
// Set the input to the widget.
//
- if (currentViewerPane.getViewer().getInput() != selectedElement) {
- currentViewerPane.getViewer().setInput(selectedElement);
- currentViewerPane.setTitle(selectedElement);
+ if(this.currentViewerPane.getViewer().getInput() != selectedElement) {
+ this.currentViewerPane.getViewer().setInput(selectedElement);
+ this.currentViewerPane.setTitle(selectedElement);
}
}
}
@@ -1432,21 +1468,23 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* 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)editingDomain.getCommandStack()).isSaveNeeded();
+ return ((BasicCommandStack)this.editingDomain.getCommandStack()).isSaveNeeded();
}
/**
* This is for implementing {@link IEditorPart} and simply saves the model file.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
- public void doSave(IProgressMonitor progressMonitor) {
+ public void doSave(final IProgressMonitor progressMonitor) {
// Save only resources that have actually changed.
//
final Map<Object, Object> saveOptions = new HashMap<Object, Object>();
@@ -1454,34 +1492,33 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
// Do the work within an operation because this is a long running activity that modifies the workbench.
//
- WorkspaceModifyOperation operation =
- new WorkspaceModifyOperation() {
- // This is the method that gets invoked when the operation runs.
+ final WorkspaceModifyOperation operation = new WorkspaceModifyOperation() {
+
+ // This is the method that gets invoked when the operation runs.
+ //
+ @Override
+ public void execute(final IProgressMonitor monitor) {
+ // Save the resources to the file system.
//
- @Override
- public void execute(IProgressMonitor monitor) {
- // Save the resources to the file system.
- //
- boolean first = true;
- for (Resource resource : editingDomain.getResourceSet().getResources()) {
- if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) {
- try {
- long timeStamp = resource.getTimeStamp();
- resource.save(saveOptions);
- if (resource.getTimeStamp() != timeStamp) {
- savedResources.add(resource);
- }
+ boolean first = true;
+ for(final Resource resource : PapyrustableconfigurationEditor.this.editingDomain.getResourceSet().getResources()) {
+ if((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !PapyrustableconfigurationEditor.this.editingDomain.isReadOnly(resource)) {
+ try {
+ final long timeStamp = resource.getTimeStamp();
+ resource.save(saveOptions);
+ if(resource.getTimeStamp() != timeStamp) {
+ PapyrustableconfigurationEditor.this.savedResources.add(resource);
}
- catch (Exception exception) {
- resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
- }
- first = false;
+ } catch (final Exception exception) {
+ PapyrustableconfigurationEditor.this.resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
}
+ first = false;
}
}
- };
+ }
+ };
- updateProblemIndication = false;
+ this.updateProblemIndication = false;
try {
// This runs the options, and shows progress.
//
@@ -1489,35 +1526,34 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
// Refresh the necessary state.
//
- ((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone();
+ ((BasicCommandStack)this.editingDomain.getCommandStack()).saveIsDone();
firePropertyChange(IEditorPart.PROP_DIRTY);
- }
- catch (Exception exception) {
+ } catch (final Exception exception) {
// Something went wrong that shouldn't.
//
PapyrustableconfigurationEditorPlugin.INSTANCE.log(exception);
}
- updateProblemIndication = true;
+ this.updateProblemIndication = true;
updateProblemIndication();
}
/**
* This returns whether something has been persisted to the URI of the specified resource.
- * The implementation uses the URI converter from the editor's resource set to try to open an input stream.
+ * 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) {
+ protected boolean isPersisted(final Resource resource) {
boolean result = false;
try {
- InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
- if (stream != null) {
+ final InputStream stream = this.editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
+ if(stream != null) {
result = true;
stream.close();
}
- }
- catch (IOException e) {
+ } catch (final IOException e) {
// Ignore
}
return result;
@@ -1527,6 +1563,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* This always returns true because it is not currently supported.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
@@ -1538,16 +1575,17 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* This also changes the editor's input.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public void doSaveAs() {
- SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
+ final SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
saveAsDialog.open();
- IPath path = saveAsDialog.getResult();
- if (path != null) {
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- if (file != null) {
+ final IPath path = saveAsDialog.getResult();
+ if(path != null) {
+ final IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ if(file != null) {
doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));
}
}
@@ -1556,38 +1594,36 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
- protected void doSaveAs(URI uri, IEditorInput editorInput) {
- (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
+ protected void doSaveAs(final URI uri, final IEditorInput editorInput) {
+ (this.editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
setInputWithNotify(editorInput);
setPartName(editorInput.getName());
- IProgressMonitor progressMonitor =
- getActionBars().getStatusLineManager() != null ?
- getActionBars().getStatusLineManager().getProgressMonitor() :
- new NullProgressMonitor();
+ final IProgressMonitor progressMonitor = getActionBars().getStatusLineManager() != null ? getActionBars().getStatusLineManager().getProgressMonitor() : new NullProgressMonitor();
doSave(progressMonitor);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
- public void gotoMarker(IMarker marker) {
+ public void gotoMarker(final IMarker marker) {
try {
- if (marker.getType().equals(EValidator.MARKER)) {
- String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
- if (uriAttribute != null) {
- URI uri = URI.createURI(uriAttribute);
- EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
- if (eObject != null) {
- setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
+ if(marker.getType().equals(EValidator.MARKER)) {
+ final String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
+ if(uriAttribute != null) {
+ final URI uri = URI.createURI(uriAttribute);
+ final EObject eObject = this.editingDomain.getResourceSet().getEObject(uri, true);
+ if(eObject != null) {
+ setSelectionToViewer(Collections.singleton(this.editingDomain.getWrapper(eObject)));
}
}
}
- }
- catch (CoreException exception) {
+ } catch (final CoreException exception) {
PapyrustableconfigurationEditorPlugin.INSTANCE.log(exception);
}
}
@@ -1596,29 +1632,30 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* This is called during startup.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
- public void init(IEditorSite site, IEditorInput editorInput) {
+ public void init(final IEditorSite site, final IEditorInput editorInput) {
setSite(site);
setInputWithNotify(editorInput);
setPartName(editorInput.getName());
site.setSelectionProvider(this);
- site.getPage().addPartListener(partListener);
- ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+ site.getPage().addPartListener(this.partListener);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(this.resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public void setFocus() {
- if (currentViewerPane != null) {
- currentViewerPane.setFocus();
- }
- else {
+ if(this.currentViewerPane != null) {
+ this.currentViewerPane.setFocus();
+ } else {
getControl(getActivePage()).setFocus();
}
}
@@ -1627,30 +1664,33 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
- public void addSelectionChangedListener(ISelectionChangedListener listener) {
- selectionChangedListeners.add(listener);
+ public void addSelectionChangedListener(final ISelectionChangedListener listener) {
+ this.selectionChangedListeners.add(listener);
}
/**
* This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
- public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- selectionChangedListeners.remove(listener);
+ public void removeSelectionChangedListener(final ISelectionChangedListener listener) {
+ this.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 editorSelection;
+ return this.editorSelection;
}
/**
@@ -1658,12 +1698,13 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* Calling this result will notify the listeners.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
- public void setSelection(ISelection selection) {
- editorSelection = selection;
+ public void setSelection(final ISelection selection) {
+ this.editorSelection = selection;
- for (ISelectionChangedListener listener : selectionChangedListeners) {
+ for(final ISelectionChangedListener listener : this.selectionChangedListeners) {
listener.selectionChanged(new SelectionChangedEvent(this, selection));
}
setStatusLineManager(selection);
@@ -1672,32 +1713,34 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
- public void setStatusLineManager(ISelection selection) {
- IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
- contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
+ public void setStatusLineManager(final ISelection selection) {
+ final IStatusLineManager statusLineManager = this.currentViewer != null && this.currentViewer == this.contentOutlineViewer ? this.contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
- 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(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;
- }
+ if(statusLineManager != null) {
+ if(selection instanceof IStructuredSelection) {
+ final Collection<?> collection = ((IStructuredSelection)selection).toList();
+ switch(collection.size()) {
+ case 0:
+ {
+ statusLineManager.setMessage(getString("_UI_NoObjectSelected")); //$NON-NLS-1$
+ break;
}
- }
- else {
+ case 1:
+ {
+ final 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;
+ }
+ }
+ } else {
statusLineManager.setMessage(""); //$NON-NLS-1$
}
}
@@ -1707,9 +1750,10 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* 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) {
+ private static String getString(final String key) {
return PapyrustableconfigurationEditorPlugin.INSTANCE.getString(key);
}
@@ -1717,25 +1761,28 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* 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 PapyrustableconfigurationEditorPlugin.INSTANCE.getString(key, new Object [] { s1 });
+ private static String getString(final String key, final Object s1) {
+ return PapyrustableconfigurationEditorPlugin.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) {
+ public void menuAboutToShow(final IMenuManager menuManager) {
((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public EditingDomainActionBarContributor getActionBarContributor() {
@@ -1745,6 +1792,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public IActionBars getActionBars() {
@@ -1754,37 +1802,39 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public AdapterFactory getAdapterFactory() {
- return adapterFactory;
+ return this.adapterFactory;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public void dispose() {
- updateProblemIndication = false;
+ this.updateProblemIndication = false;
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(this.resourceChangeListener);
- getSite().getPage().removePartListener(partListener);
+ getSite().getPage().removePartListener(this.partListener);
- adapterFactory.dispose();
+ this.adapterFactory.dispose();
- if (getActionBarContributor().getActiveEditor() == this) {
+ if(getActionBarContributor().getActiveEditor() == this) {
getActionBarContributor().setActiveEditor(null);
}
- if (propertySheetPage != null) {
- propertySheetPage.dispose();
+ if(this.propertySheetPage != null) {
+ this.propertySheetPage.dispose();
}
- if (contentOutlinePage != null) {
- contentOutlinePage.dispose();
+ if(this.contentOutlinePage != null) {
+ this.contentOutlinePage.dispose();
}
super.dispose();
@@ -1794,6 +1844,7 @@ public class PapyrustableconfigurationEditor extends MultiPageEditorPart impleme
* Returns whether the outline view should be presented to the user.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected boolean showOutlineView() {
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/presentation/PapyrustableconfigurationEditorPlugin.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/presentation/PapyrustableconfigurationEditorPlugin.java
index 0986d2f1b1d..a1faac3158e 100644
--- a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/presentation/PapyrustableconfigurationEditorPlugin.java
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/presentation/PapyrustableconfigurationEditorPlugin.java
@@ -19,14 +19,13 @@ import org.eclipse.emf.ecore.provider.EcoreEditPlugin;
import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.provider.CustomEditPlugin;
import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.provider.Efacet2EditPlugin;
import org.eclipse.emf.facet.widgets.celleditors.edit.CelleditorsEditPlugin;
-import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.provider.Tableinstance02EditPlugin;
-import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.tableconfiguration.provider.TableConfigurationEditPlugin;
import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.provider.PapyrustableEditPlugin;
/**
* This is the central singleton for the Papyrustableconfiguration editor plugin.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public final class PapyrustableconfigurationEditorPlugin extends EMFPlugin {
@@ -35,6 +34,7 @@ public final class PapyrustableconfigurationEditorPlugin extends EMFPlugin {
* Keep track of the singleton.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public static final PapyrustableconfigurationEditorPlugin INSTANCE = new PapyrustableconfigurationEditorPlugin();
@@ -43,6 +43,7 @@ public final class PapyrustableconfigurationEditorPlugin extends EMFPlugin {
* Keep track of the singleton.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
private static Implementation plugin;
@@ -62,6 +63,7 @@ public final class PapyrustableconfigurationEditorPlugin extends EMFPlugin {
* Returns the singleton instance of the Eclipse plugin.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @return the singleton instance.
* @generated
*/
@@ -74,6 +76,7 @@ public final class PapyrustableconfigurationEditorPlugin extends EMFPlugin {
* Returns the singleton instance of the Eclipse plugin.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @return the singleton instance.
* @generated
*/
@@ -85,6 +88,7 @@ public final class PapyrustableconfigurationEditorPlugin extends EMFPlugin {
* The actual implementation of the Eclipse <b>Plugin</b>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public static class Implementation extends EclipseUIPlugin {
@@ -93,11 +97,12 @@ public final class PapyrustableconfigurationEditorPlugin extends EMFPlugin {
* Creates an instance.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public Implementation() {
super();
-
+
// Remember the static instance.
//
plugin = this;

Back to the top