Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisprovider/presentation/NattableaxisproviderEditor.java')
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisprovider/presentation/NattableaxisproviderEditor.java753
1 files changed, 392 insertions, 361 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisprovider/presentation/NattableaxisproviderEditor.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisprovider/presentation/NattableaxisproviderEditor.java
index 58c44568d2d..f4dd647f0fd 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisprovider/presentation/NattableaxisproviderEditor.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor/src-gen/org/eclipse/papyrus/infra/nattable/model/nattable/nattableaxisprovider/presentation/NattableaxisproviderEditor.java
@@ -102,6 +102,7 @@ import org.eclipse.papyrus.infra.nattable.model.nattable.nattablecell.provider.N
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableconfiguration.provider.NattableconfigurationItemProviderAdapterFactory;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattablelabelprovider.provider.NattablelabelproviderItemProviderAdapterFactory;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableproblem.provider.NattableproblemItemProviderAdapterFactory;
+import org.eclipse.papyrus.infra.nattable.model.nattable.nattablestyle.provider.NattablestyleItemProviderAdapterFactory;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattabletester.provider.NattabletesterItemProviderAdapterFactory;
import org.eclipse.papyrus.infra.nattable.model.nattable.presentation.NattableEditorPlugin;
import org.eclipse.papyrus.infra.nattable.model.nattable.provider.NattableItemProviderAdapterFactory;
@@ -147,8 +148,9 @@ import org.eclipse.ui.views.properties.PropertySheetPage;
*
* @generated
*/
-public class NattableaxisproviderEditor extends MultiPageEditorPart implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker {
-
+public class NattableaxisproviderEditor
+ extends MultiPageEditorPart
+ implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker {
/**
* This keeps track of the editing domain that is used to track all changes to the model.
* <!-- begin-user-doc -->
@@ -322,46 +324,48 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
*
* @generated
*/
- protected IPartListener partListener = new IPartListener() {
-
- @Override
- public void partActivated(IWorkbenchPart p) {
- if (p instanceof ContentOutline) {
- if (((ContentOutline) p).getCurrentPage() == contentOutlinePage) {
- getActionBarContributor().setActiveEditor(NattableaxisproviderEditor.this);
+ protected IPartListener partListener =
+ new IPartListener() {
+ @Override
+ public void partActivated(IWorkbenchPart p) {
+ if (p instanceof ContentOutline) {
+ if (((ContentOutline) p).getCurrentPage() == contentOutlinePage) {
+ getActionBarContributor().setActiveEditor(NattableaxisproviderEditor.this);
- setCurrentViewer(contentOutlineViewer);
- }
- } else if (p instanceof PropertySheet) {
- if (propertySheetPages.contains(((PropertySheet) p).getCurrentPage())) {
- getActionBarContributor().setActiveEditor(NattableaxisproviderEditor.this);
- handleActivate();
+ setCurrentViewer(contentOutlineViewer);
+ }
+ }
+ else if (p instanceof PropertySheet) {
+ if (propertySheetPages.contains(((PropertySheet) p).getCurrentPage())) {
+ getActionBarContributor().setActiveEditor(NattableaxisproviderEditor.this);
+ handleActivate();
+ }
+ }
+ else if (p == NattableaxisproviderEditor.this) {
+ handleActivate();
+ }
}
- } else if (p == NattableaxisproviderEditor.this) {
- handleActivate();
- }
- }
- @Override
- public void partBroughtToTop(IWorkbenchPart p) {
- // Ignore.
- }
+ @Override
+ public void partBroughtToTop(IWorkbenchPart p) {
+ // Ignore.
+ }
- @Override
- public void partClosed(IWorkbenchPart p) {
- // Ignore.
- }
+ @Override
+ public void partClosed(IWorkbenchPart p) {
+ // Ignore.
+ }
- @Override
- public void partDeactivated(IWorkbenchPart p) {
- // Ignore.
- }
+ @Override
+ public void partDeactivated(IWorkbenchPart p) {
+ // Ignore.
+ }
- @Override
- public void partOpened(IWorkbenchPart p) {
- // Ignore.
- }
- };
+ @Override
+ public void partOpened(IWorkbenchPart p) {
+ // Ignore.
+ }
+ };
/**
* Resources that have been removed since last activation.
@@ -415,61 +419,62 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
*
* @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() {
+ 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 run() {
- updateProblemIndication();
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ @Override
+ public void run() {
+ updateProblemIndication();
+ }
+ });
}
- });
+ break;
+ }
+ }
+ }
+ else {
+ super.notifyChanged(notification);
}
- break;
- }
}
- } else {
- super.notifyChanged(notification);
- }
- }
- @Override
- protected void setTarget(Resource target) {
- basicSetTarget(target);
- }
-
- @Override
- protected void unsetTarget(Resource target) {
- basicUnsetTarget(target);
- resourceToDiagnosticMap.remove(target);
- if (updateProblemIndication) {
- getSite().getShell().getDisplay().asyncExec(new Runnable() {
+ @Override
+ protected void setTarget(Resource target) {
+ basicSetTarget(target);
+ }
- @Override
- public void run() {
- updateProblemIndication();
+ @Override
+ protected void unsetTarget(Resource target) {
+ basicUnsetTarget(target);
+ resourceToDiagnosticMap.remove(target);
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ @Override
+ public void run() {
+ updateProblemIndication();
+ }
+ });
}
- });
- }
- }
- };
+ }
+ };
/**
* This listens for workspace changes.
@@ -478,81 +483,81 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
*
* @generated
*/
- protected IResourceChangeListener resourceChangeListener = new IResourceChangeListener() {
-
- @Override
- 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>();
+ protected IResourceChangeListener resourceChangeListener =
+ new IResourceChangeListener() {
+ @Override
+ 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>();
- @Override
- 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);
+ @Override
+ 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;
- }
-
- public Collection<Resource> getChangedResources() {
- return changedResources;
- }
- public Collection<Resource> getRemovedResources() {
- return removedResources;
- }
- }
-
- final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
- delta.accept(visitor);
+ return true;
+ }
- if (!visitor.getRemovedResources().isEmpty()) {
- getSite().getShell().getDisplay().asyncExec(new Runnable() {
+ public Collection<Resource> getChangedResources() {
+ return changedResources;
+ }
- @Override
- public void run() {
- removedResources.addAll(visitor.getRemovedResources());
- if (!isDirty()) {
- getSite().getPage().closeEditor(NattableaxisproviderEditor.this, false);
+ public Collection<Resource> getRemovedResources() {
+ return removedResources;
}
}
- });
- }
- if (!visitor.getChangedResources().isEmpty()) {
- getSite().getShell().getDisplay().asyncExec(new Runnable() {
+ final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
+ delta.accept(visitor);
+
+ if (!visitor.getRemovedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ @Override
+ public void run() {
+ removedResources.addAll(visitor.getRemovedResources());
+ if (!isDirty()) {
+ getSite().getPage().closeEditor(NattableaxisproviderEditor.this, false);
+ }
+ }
+ });
+ }
- @Override
- public void run() {
- changedResources.addAll(visitor.getChangedResources());
- if (getSite().getPage().getActiveEditor() == NattableaxisproviderEditor.this) {
- handleActivate();
- }
+ if (!visitor.getChangedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ @Override
+ public void run() {
+ changedResources.addAll(visitor.getChangedResources());
+ if (getSite().getPage().getActiveEditor() == NattableaxisproviderEditor.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.
@@ -575,12 +580,14 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
if (!removedResources.isEmpty()) {
if (handleDirtyConflict()) {
getSite().getPage().closeEditor(NattableaxisproviderEditor.this, false);
- } else {
+ }
+ else {
removedResources.clear();
changedResources.clear();
savedResources.clear();
}
- } else if (!changedResources.isEmpty()) {
+ }
+ else if (!changedResources.isEmpty()) {
changedResources.removeAll(savedResources);
handleChangedResources();
changedResources.clear();
@@ -634,8 +641,12 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
*/
protected void updateProblemIndication() {
if (updateProblemIndication) {
- BasicDiagnostic diagnostic = new BasicDiagnostic(Diagnostic.OK, "org.eclipse.papyrus.infra.nattable.model.editor", //$NON-NLS-1$
- 0, null, new Object[] { editingDomain.getResourceSet() });
+ 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);
@@ -648,7 +659,8 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
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(markerHelper);
@@ -683,8 +695,10 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
* @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$
}
/**
@@ -721,6 +735,7 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
adapterFactory.addAdapterFactory(new NattableaxisItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new NattablecellItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new NattableproblemItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new NattablestyleItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
@@ -730,34 +745,35 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
// 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() {
-
- @Override
- public void commandStackChanged(final EventObject event) {
- getContainer().getDisplay().asyncExec(new Runnable() {
-
+ commandStack.addCommandStackListener
+ (new CommandStackListener() {
@Override
- 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();
- }
- }
+ public void commandStackChanged(final EventObject event) {
+ getContainer().getDisplay().asyncExec
+ (new Runnable() {
+ @Override
+ 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.
//
@@ -788,17 +804,17 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
// Make sure it's okay.
//
if (theSelection != null && !theSelection.isEmpty()) {
- Runnable runnable = new Runnable() {
-
- @Override
- 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);
- }
- }
- };
+ Runnable runnable =
+ new Runnable() {
+ @Override
+ 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);
}
}
@@ -823,7 +839,6 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
* @generated
*/
public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider {
-
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -913,15 +928,15 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
if (selectionChangedListener == null) {
// Create the listener on demand.
//
- selectionChangedListener = new ISelectionChangedListener() {
-
- // This just notifies those things that are affected by the section.
- //
- @Override
- public void selectionChanged(SelectionChangedEvent selectionChangedEvent) {
- setSelection(selectionChangedEvent.getSelection());
- }
- };
+ selectionChangedListener =
+ new ISelectionChangedListener() {
+ // This just notifies those things that are affected by the section.
+ //
+ @Override
+ public void selectionChanged(SelectionChangedEvent selectionChangedEvent) {
+ setSelection(selectionChangedEvent.getSelection());
+ }
+ };
}
// Stop listening to the old one.
@@ -1017,16 +1032,22 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
*/
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 });
+ 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) {
+ }
+ 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$
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()), //$NON-NLS-1$
new Object[] { exception });
- } else {
+ }
+ else {
return Diagnostic.OK_INSTANCE;
}
}
@@ -1050,21 +1071,21 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
// Create a page for the selection tree view.
//
{
- ViewerPane viewerPane = new ViewerPane(getSite().getPage(), NattableaxisproviderEditor.this) {
-
- @Override
- public Viewer createViewer(Composite composite) {
- Tree tree = new Tree(composite, SWT.MULTI);
- TreeViewer newTreeViewer = new TreeViewer(tree);
- return newTreeViewer;
- }
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NattableaxisproviderEditor.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);
- }
- };
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
viewerPane.createControl(getContainer());
selectionViewer = (TreeViewer) viewerPane.getViewer();
@@ -1085,21 +1106,21 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
// Create a page for the parent tree view.
//
{
- ViewerPane viewerPane = new ViewerPane(getSite().getPage(), NattableaxisproviderEditor.this) {
-
- @Override
- public Viewer createViewer(Composite composite) {
- Tree tree = new Tree(composite, SWT.MULTI);
- TreeViewer newTreeViewer = new TreeViewer(tree);
- return newTreeViewer;
- }
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NattableaxisproviderEditor.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);
- }
- };
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
viewerPane.createControl(getContainer());
parentViewer = (TreeViewer) viewerPane.getViewer();
@@ -1115,19 +1136,19 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
// This is the page for the list viewer
//
{
- ViewerPane viewerPane = new ViewerPane(getSite().getPage(), NattableaxisproviderEditor.this) {
-
- @Override
- public Viewer createViewer(Composite composite) {
- return new ListViewer(composite);
- }
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NattableaxisproviderEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new ListViewer(composite);
+ }
- @Override
- public void requestActivation() {
- super.requestActivation();
- setCurrentViewerPane(this);
- }
- };
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
viewerPane.createControl(getContainer());
listViewer = (ListViewer) viewerPane.getViewer();
listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
@@ -1141,19 +1162,19 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
// This is the page for the tree viewer
//
{
- ViewerPane viewerPane = new ViewerPane(getSite().getPage(), NattableaxisproviderEditor.this) {
-
- @Override
- public Viewer createViewer(Composite composite) {
- return new TreeViewer(composite);
- }
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NattableaxisproviderEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
- @Override
- public void requestActivation() {
- super.requestActivation();
- setCurrentViewerPane(this);
- }
- };
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
viewerPane.createControl(getContainer());
treeViewer = (TreeViewer) viewerPane.getViewer();
treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
@@ -1169,19 +1190,19 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
// This is the page for the table viewer.
//
{
- ViewerPane viewerPane = new ViewerPane(getSite().getPage(), NattableaxisproviderEditor.this) {
-
- @Override
- public Viewer createViewer(Composite composite) {
- return new TableViewer(composite);
- }
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NattableaxisproviderEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TableViewer(composite);
+ }
- @Override
- public void requestActivation() {
- super.requestActivation();
- setCurrentViewerPane(this);
- }
- };
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
viewerPane.createControl(getContainer());
tableViewer = (TableViewer) viewerPane.getViewer();
@@ -1213,19 +1234,19 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
// This is the page for the table tree viewer.
//
{
- ViewerPane viewerPane = new ViewerPane(getSite().getPage(), NattableaxisproviderEditor.this) {
-
- @Override
- public Viewer createViewer(Composite composite) {
- return new TreeViewer(composite);
- }
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), NattableaxisproviderEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
- @Override
- public void requestActivation() {
- super.requestActivation();
- setCurrentViewerPane(this);
- }
- };
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
viewerPane.createControl(getContainer());
treeViewerWithColumns = (TreeViewer) viewerPane.getViewer();
@@ -1254,39 +1275,39 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label")); //$NON-NLS-1$
}
- getSite().getShell().getDisplay().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- setActivePage(0);
- }
- });
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ @Override
+ 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;
+ 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() {
+ @Override
+ public void controlResized(ControlEvent event) {
+ if (!guard) {
+ guard = true;
+ hideTabs();
+ guard = false;
+ }
+ }
+ });
- @Override
- public void run() {
- updateProblemIndication();
- }
- });
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ @Override
+ public void run() {
+ updateProblemIndication();
+ }
+ });
}
/**
@@ -1355,11 +1376,14 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
public Object getAdapter(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);
}
}
@@ -1376,7 +1400,6 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
// The content outline is just a tree.
//
class MyContentOutlinePage extends ContentOutlinePage {
-
@Override
public void createControl(Composite parent) {
super.createControl(parent);
@@ -1417,15 +1440,15 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
// Listen to selection so that we can handle it is a special way.
//
- contentOutlinePage.addSelectionChangedListener(new ISelectionChangedListener() {
-
- // This ensures that we handle selections correctly.
- //
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- handleContentOutlineSelection(event.getSelection());
- }
- });
+ contentOutlinePage.addSelectionChangedListener
+ (new ISelectionChangedListener() {
+ // This ensures that we handle selections correctly.
+ //
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ handleContentOutlineSelection(event.getSelection());
+ }
+ });
}
return contentOutlinePage;
@@ -1439,20 +1462,20 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
* @generated
*/
public IPropertySheetPage getPropertySheetPage() {
- PropertySheetPage propertySheetPage = new ExtendedPropertySheetPage(editingDomain) {
-
- @Override
- public void setSelectionToViewer(List<?> selection) {
- NattableaxisproviderEditor.this.setSelectionToViewer(selection);
- NattableaxisproviderEditor.this.setFocus();
- }
+ PropertySheetPage propertySheetPage =
+ new ExtendedPropertySheetPage(editingDomain) {
+ @Override
+ public void setSelectionToViewer(List<?> selection) {
+ NattableaxisproviderEditor.this.setSelectionToViewer(selection);
+ NattableaxisproviderEditor.this.setFocus();
+ }
- @Override
- public void setActionBars(IActionBars actionBars) {
- super.setActionBars(actionBars);
- getActionBarContributor().shareGlobalActions(this, actionBars);
- }
- };
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ };
propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
propertySheetPages.add(propertySheetPage);
@@ -1486,7 +1509,8 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
// Set the selection to the widget.
//
selectionViewer.setSelection(new StructuredSelection(selectionList));
- } else {
+ }
+ else {
// Set the input to the widget.
//
if (currentViewerPane.getViewer().getInput() != selectedElement) {
@@ -1527,31 +1551,32 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
// 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.
- //
- @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);
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ // This is the method that gets invoked when the operation runs.
+ //
+ @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);
+ }
+ }
+ catch (Exception exception) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ first = false;
}
- } catch (Exception exception) {
- resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
}
- first = false;
}
- }
- }
- };
+ };
updateProblemIndication = false;
try {
@@ -1636,7 +1661,10 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
(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);
}
@@ -1681,7 +1709,8 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
public void setFocus() {
if (currentViewerPane != null) {
currentViewerPane.setFocus();
- } else {
+ }
+ else {
getControl(getActivePage()).setFocus();
}
}
@@ -1747,7 +1776,8 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
* @generated
*/
public void setStatusLineManager(ISelection selection) {
- IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ? contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
+ IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
+ contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
if (statusLineManager != null) {
if (selection instanceof IStructuredSelection) {
@@ -1767,7 +1797,8 @@ public class NattableaxisproviderEditor extends MultiPageEditorPart implements I
break;
}
}
- } else {
+ }
+ else {
statusLineManager.setMessage(""); //$NON-NLS-1$
}
}

Back to the top