diff options
author | Camille Letavernier | 2014-08-21 11:43:07 +0000 |
---|---|---|
committer | Camille Letavernier | 2014-08-21 13:50:25 +0000 |
commit | dbc038b44bcbb890ae256d15eb09eb285512f020 (patch) | |
tree | 757e736583eea3ae352ad9ac91a81df7e59b79ff /plugins/views/validation | |
parent | ea48a20561464c3cbb7895d430583669a9f82fcc (diff) | |
download | org.eclipse.papyrus-dbc038b44bcbb890ae256d15eb09eb285512f020.tar.gz org.eclipse.papyrus-dbc038b44bcbb890ae256d15eb09eb285512f020.tar.xz org.eclipse.papyrus-dbc038b44bcbb890ae256d15eb09eb285512f020.zip |
[Code style] Apply clean-up and formatter on Main plug-ins
Diffstat (limited to 'plugins/views/validation')
21 files changed, 155 insertions, 151 deletions
diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/Activator.java b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/Activator.java index 00d95978fd0..7a511617b31 100644 --- a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/Activator.java +++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/Activator.java @@ -30,6 +30,7 @@ public class Activator super(); } + @Override public void start(BundleContext context) throws Exception { @@ -40,6 +41,7 @@ public class Activator log.setPlugin(plugin); } + @Override public void stop(BundleContext context) throws Exception { @@ -50,7 +52,7 @@ public class Activator /** * Returns the shared instance - * + * * @return the shared instance */ public static Activator getDefault() { @@ -62,7 +64,7 @@ public class Activator super.initializeImageRegistry(reg); reg.put(ICON_GOTO_MARKER, - getImageDescriptor("full/elcl16/goto_marker.gif")); //$NON-NLS-1$ + getImageDescriptor("full/elcl16/goto_marker.gif")); //$NON-NLS-1$ } protected ImageDescriptor getImageDescriptor(String path) { diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/IValidationMarkerListener.java b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/IValidationMarkerListener.java index 0d50ae8c575..3251092cc66 100644 --- a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/IValidationMarkerListener.java +++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/IValidationMarkerListener.java @@ -1,6 +1,6 @@ /***************************************************************************** * Copyright (c) 2013 CEA LIST. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/ModelValidationPage.java b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/ModelValidationPage.java index 34ae10b77d4..c7ca84a56b8 100644 --- a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/ModelValidationPage.java +++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/ModelValidationPage.java @@ -1,6 +1,6 @@ /***************************************************************************** * Copyright (c) 2013 CEA LIST. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -101,9 +101,9 @@ public class ModelValidationPage this.settings = settings; this.markers = ServiceUtils.getInstance().getService( - ValidationMarkersService.class, services); + ValidationMarkersService.class, services); this.labelProviders = ServiceUtils.getInstance().getService( - LabelProviderService.class, services); + LabelProviderService.class, services); this.modelSet = ServiceUtils.getInstance().getModelSet(services); } @@ -123,7 +123,7 @@ public class ModelValidationPage tableParent.setLayout(layout); table = new TableViewer(tableParent, SWT.BORDER | SWT.V_SCROLL - | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI); + | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI); table.getTable().setHeaderVisible(true); table.getTable().setLinesVisible(true); table.setUseHashlookup(true); @@ -131,7 +131,7 @@ public class ModelValidationPage // the severity column has fixed width TableViewerColumn severity = new TableViewerColumn(table, SWT.NONE); layout.setColumnData(severity.getColumn(), new ColumnPixelData(24, - false)); + false)); severity.getColumn().setResizable(false); labels(severity, new SeverityLabelProvider()); @@ -173,7 +173,7 @@ public class ModelValidationPage result.getColumn().setText(title); TableColumnLayout layout = (TableColumnLayout) table.getControl() - .getParent().getLayout(); + .getParent().getLayout(); final int columnIndex = table.getTable().indexOf(result.getColumn()); @@ -189,7 +189,7 @@ public class ModelValidationPage ColumnLayoutData layoutData; layoutData = new ColumnPixelData(width, true); layout.setColumnData(result.getColumn(), layoutData); - + result.getColumn().addListener(SWT.Resize, new Listener() { public void handleEvent(Event event) { @@ -236,8 +236,8 @@ public class ModelValidationPage if (settings.getSortColumn() == columnIndex) { int direction = settings.getSortDirection(); viewer.setComparator(direction == SWT.UP - ? sorter - : invert(sorter)); + ? sorter + : invert(sorter)); viewer.getTable().setSortColumn(col.getColumn()); viewer.getTable().setSortDirection(direction); } @@ -259,12 +259,12 @@ public class ModelValidationPage table.getControl().setMenu(menu); getSite().registerContextMenu(ModelValidationView.VIEW_ID, contextMenu, - table); + table); } protected void createActions() { final ISelectionProvider selectionProvider = getSite() - .getSelectionProvider(); + .getSelectionProvider(); gotoMarkerAction = new GotoMarkerAction(getSite()); selectionProvider.addSelectionChangedListener(gotoMarkerAction); @@ -276,11 +276,11 @@ public class ModelValidationPage final IActionBars actionBars = getSite().getActionBars(); actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), - copyMarkerAction); + copyMarkerAction); actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), - deleteMarkerAction); + deleteMarkerAction); actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), - selectAllAction); + selectAllAction); } protected void fillContextMenu(IMenuManager menu) { @@ -324,7 +324,7 @@ public class ModelValidationPage // apply to the columns for (int i = startIndex; i < columns.length; i++) { layout.setColumnData(columns[i], - new ColumnPixelData(settings.getColumnWidth(i))); + new ColumnPixelData(settings.getColumnWidth(i))); } // discover the new layout data @@ -332,7 +332,7 @@ public class ModelValidationPage } else { // update the settings for next time settings.setColumnWidth(index, table.getTable().getColumn(index) - .getWidth()); + .getWidth()); } } } diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/ModelValidationView.java b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/ModelValidationView.java index 6b6febc9826..04c3b28a4d3 100644 --- a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/ModelValidationView.java +++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/ModelValidationView.java @@ -1,6 +1,6 @@ /***************************************************************************** * Copyright (c) 2013 CEA LIST. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -38,7 +38,7 @@ public class ModelValidationView public static final String VIEW_ID = "org.eclipse.papyrus.views.validation.ModelValidationView"; //$NON-NLS-1$ private ViewSettings settings; - + public ModelValidationView() { super(); } @@ -46,23 +46,23 @@ public class ModelValidationView @Override public void init(IViewSite site, IMemento memento) throws PartInitException { - + super.init(site, memento); - + this.settings = new ViewSettings(memento); } - + @Override public void saveState(IMemento memento) { super.saveState(memento); - + settings.save(memento); } - + @Override protected IPage createDefaultPage(PageBook book) { IPageBookViewPage result = new MessagePage( - "No model editor is currently active."); + "No model editor is currently active."); initPage(result); result.createControl(book); @@ -77,8 +77,8 @@ public class ModelValidationView IPageBookViewPage result; try { result = (services == null) - ? new MessagePage("Invalid model editor selected.") - : new ModelValidationPage(services, settings); + ? new MessagePage("Invalid model editor selected.") + : new ModelValidationPage(services, settings); } catch (ServiceException e) { String message = "Failed to obtain services required for Model Validation View."; Activator.log.error(message, e); diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/ValidationMarkersService.java b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/ValidationMarkersService.java index 56f7e82b0a9..86286230dc9 100644 --- a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/ValidationMarkersService.java +++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/ValidationMarkersService.java @@ -1,6 +1,6 @@ /***************************************************************************** * Copyright (c) 2013 CEA LIST. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -37,7 +37,7 @@ public class ValidationMarkersService private ModelSet modelSet; private final Multimap<EObject, IPapyrusMarker> markers = HashMultimap - .create(); + .create(); private final CopyOnWriteArrayList<IValidationMarkerListener> listeners = new CopyOnWriteArrayList<IValidationMarkerListener>(); @@ -74,26 +74,26 @@ public class ValidationMarkersService // ADDED try { if (marker.exists() && !marker.isSubtypeOf(IMarker.PROBLEM)) { - return ; + return; } } catch (CoreException e1) { - Activator.log.error(e1) ; + Activator.log.error(e1); } - ////// - + // //// + MarkerChangeKind kind = (addedOrRemoved == MARKER_ADDED) - ? MarkerChangeKind.ADDED - : MarkerChangeKind.REMOVED; + ? MarkerChangeKind.ADDED + : MarkerChangeKind.REMOVED; switch (kind) { - case ADDED : - markers.put(eObjectOfMarker, marker); - break; - case REMOVED : - // workspace markers don't know their EObjects, so we can't look - // up the mapping to remove by key - markers.values().remove(marker); - break; + case ADDED: + markers.put(eObjectOfMarker, marker); + break; + case REMOVED: + // workspace markers don't know their EObjects, so we can't look + // up the mapping to remove by key + markers.values().remove(marker); + break; } for (IValidationMarkerListener next : listeners) { @@ -101,7 +101,7 @@ public class ValidationMarkersService next.notifyMarkerChange(marker, kind); } catch (Exception e) { Activator.log.error( - "Uncaught exception in validation marker listener.", e); + "Uncaught exception in validation marker listener.", e); } } } diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/ViewSettings.java b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/ViewSettings.java index b66fb7e0909..5ef8e5e56d9 100644 --- a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/ViewSettings.java +++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/ViewSettings.java @@ -1,6 +1,6 @@ /***************************************************************************** * Copyright (c) 2013 CEA LIST. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -34,7 +34,7 @@ class ViewSettings { private static int DEFAULT_SORT_DIRECTION = SWT.UP; // negative values indicate relative weights - private static Integer[] DEFAULT_COLUMN_WIDTHS = {0, -30, -25, -30, -15}; + private static Integer[] DEFAULT_COLUMN_WIDTHS = { 0, -30, -25, -30, -15 }; private static int DEFAULT_COLUMN_WIDTH = 30; @@ -66,8 +66,8 @@ class ViewSettings { public void setSortDirection(int direction) { sortDirection = (direction == SWT.DOWN) - ? SWT.DOWN - : SWT.UP; + ? SWT.DOWN + : SWT.UP; } public int getColumnWidth(int index) { @@ -88,7 +88,7 @@ class ViewSettings { if (index > columnWidths.size()) { // pad columnWidths.addAll(Collections.nCopies(index - - columnWidths.size(), DEFAULT_COLUMN_WIDTH)); + - columnWidths.size(), DEFAULT_COLUMN_WIDTH)); } columnWidths.add(weight); } @@ -103,7 +103,7 @@ class ViewSettings { private void load(IMemento memento) { columnWidths = getIntegerList(memento, "columnWidths", - DEFAULT_COLUMN_WIDTHS); + DEFAULT_COLUMN_WIDTHS); sortColumn = getInt(memento, "sortColumn", DEFAULT_SORT_COLUMN); sortDirection = getInt(memento, "sortDirection", DEFAULT_SORT_DIRECTION); } @@ -118,8 +118,8 @@ class ViewSettings { Integer value = memento.getInteger(key); return (value == null) - ? defaultValue - : value.intValue(); + ? defaultValue + : value.intValue(); } private List<Integer> getIntegerList(IMemento memento, String key, @@ -132,15 +132,15 @@ class ViewSettings { result = Lists.newArrayList(defaultValue); } else { result = Lists.newArrayList(Iterables.transform(Splitter.on(',') - .trimResults().split(stringValue), - new Function<String, Integer>() { - - public Integer apply(String input) { - return "".equals(input) - ? DEFAULT_COLUMN_WIDTH - : Integer.valueOf(input); - } - })); + .trimResults().split(stringValue), + new Function<String, Integer>() { + + public Integer apply(String input) { + return "".equals(input) + ? DEFAULT_COLUMN_WIDTH + : Integer.valueOf(input); + } + })); } return result; diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/actions/AbstractMarkerAction.java b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/actions/AbstractMarkerAction.java index c2b82a989d6..6bdaefbc851 100644 --- a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/actions/AbstractMarkerAction.java +++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/actions/AbstractMarkerAction.java @@ -1,6 +1,6 @@ /***************************************************************************** * Copyright (c) 2013 CEA LIST. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -36,7 +36,7 @@ public class AbstractMarkerAction super(label); this.site = site; - + setEnabled(false); } @@ -55,9 +55,9 @@ public class AbstractMarkerAction @Override protected boolean updateSelection(IStructuredSelection selection) { markers = selection.isEmpty() - ? Collections.<IPapyrusMarker> emptyList() - : Lists.newArrayList(Iterables.filter(selection.toList(), - IPapyrusMarker.class)); + ? Collections.<IPapyrusMarker> emptyList() + : Lists.newArrayList(Iterables.filter(selection.toList(), + IPapyrusMarker.class)); return !markers.isEmpty() && super.updateSelection(selection); } diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/actions/CopyMarkerAction.java b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/actions/CopyMarkerAction.java index f554a9991f0..1747e7cd4e6 100644 --- a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/actions/CopyMarkerAction.java +++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/actions/CopyMarkerAction.java @@ -1,6 +1,6 @@ /***************************************************************************** * Copyright (c) 2013 CEA LIST. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -33,9 +33,9 @@ public class CopyMarkerAction super(site, "Copy"); setImageDescriptor(PlatformUI.getWorkbench().getSharedImages() - .getImageDescriptor(ISharedImages.IMG_TOOL_COPY)); + .getImageDescriptor(ISharedImages.IMG_TOOL_COPY)); setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages() - .getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED)); + .getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED)); setActionDefinitionId(ActionFactory.COPY.getCommandId()); } @@ -47,10 +47,10 @@ public class CopyMarkerAction String text = copy(viewer); Clipboard clipboard = new Clipboard(viewer.getControl() - .getDisplay()); + .getDisplay()); try { - clipboard.setContents(new Object[]{text}, - new Transfer[]{TextTransfer.getInstance()}); + clipboard.setContents(new Object[] { text }, + new Transfer[] { TextTransfer.getInstance() }); } finally { clipboard.dispose(); } @@ -72,7 +72,7 @@ public class CopyMarkerAction final int startIndex = 1; // the Severity column has no label final int columnCount = viewer.getTable().getColumnCount(); CellLabelProvider[] labelProviders = new CellLabelProvider[columnCount - - startIndex]; + - startIndex]; for (int i = startIndex; i < columnCount; i++) { labelProviders[i - startIndex] = viewer.getLabelProvider(i); } @@ -95,16 +95,16 @@ public class CopyMarkerAction String result; switch (marker.getAttribute(IPapyrusMarker.SEVERITY, - IPapyrusMarker.SEVERITY_ERROR)) { - - case IPapyrusMarker.SEVERITY_INFO : - result = "Info"; - break; - case IPapyrusMarker.SEVERITY_WARNING : - result = "Warning"; - break; - default : - result = "Error"; + IPapyrusMarker.SEVERITY_ERROR)) { + + case IPapyrusMarker.SEVERITY_INFO: + result = "Info"; + break; + case IPapyrusMarker.SEVERITY_WARNING: + result = "Warning"; + break; + default: + result = "Error"; } return result; diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/actions/DeleteMarkerAction.java b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/actions/DeleteMarkerAction.java index 3b762fa8414..b43e7377d6c 100644 --- a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/actions/DeleteMarkerAction.java +++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/actions/DeleteMarkerAction.java @@ -1,6 +1,6 @@ /***************************************************************************** * Copyright (c) 2013 CEA LIST. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -31,9 +31,9 @@ public class DeleteMarkerAction super(site, "Delete"); setImageDescriptor(PlatformUI.getWorkbench().getSharedImages() - .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE)); + .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE)); setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages() - .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED)); + .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED)); setActionDefinitionId(ActionFactory.DELETE.getCommandId()); } @@ -45,7 +45,7 @@ public class DeleteMarkerAction } catch (CoreException e) { StatusAdapter adapter = new StatusAdapter(e.getStatus()); adapter.setProperty(IStatusAdapterConstants.TITLE_PROPERTY, - "Delete Validation Problem"); + "Delete Validation Problem"); StatusManager.getManager().handle(adapter, StatusManager.SHOW); } } diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/actions/GotoMarkerAction.java b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/actions/GotoMarkerAction.java index daf1119b2ca..a745d39f2ab 100644 --- a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/actions/GotoMarkerAction.java +++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/actions/GotoMarkerAction.java @@ -1,6 +1,6 @@ /***************************************************************************** * Copyright (c) 2013 CEA LIST. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -29,7 +29,7 @@ public class GotoMarkerAction super(site, "Go To"); setImageDescriptor(Activator.getDefault().getImageRegistry() - .getDescriptor(Activator.ICON_GOTO_MARKER)); + .getDescriptor(Activator.ICON_GOTO_MARKER)); } @Override @@ -50,7 +50,7 @@ public class GotoMarkerAction break; } else if (part != null) { revealer = (IRevealSemanticElement) part - .getAdapter(IRevealSemanticElement.class); + .getAdapter(IRevealSemanticElement.class); if (revealer != null) { break; } @@ -59,7 +59,7 @@ public class GotoMarkerAction if (revealer != null) { revealer.revealSemanticElement(Collections - .singletonList(getMarker().getEObject())); + .singletonList(getMarker().getEObject())); } } } diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/actions/SelectAllAction.java b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/actions/SelectAllAction.java index b64f1f942fe..fa97ef3a144 100644 --- a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/actions/SelectAllAction.java +++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/actions/SelectAllAction.java @@ -1,6 +1,6 @@ /***************************************************************************** * Copyright (c) 2013 CEA LIST. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -41,9 +41,9 @@ public class SelectAllAction if (selectionProvider instanceof StructuredViewer) { StructuredViewer viewer = (StructuredViewer) selectionProvider; IStructuredContentProvider content = (IStructuredContentProvider) viewer - .getContentProvider(); + .getContentProvider(); viewer.setSelection(new StructuredSelection(content - .getElements(viewer.getInput()))); + .getElements(viewer.getInput()))); } } } diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/DescriptionLabelProvider.java b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/DescriptionLabelProvider.java index cbd73b5e940..35569ddbf05 100644 --- a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/DescriptionLabelProvider.java +++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/DescriptionLabelProvider.java @@ -1,6 +1,6 @@ /***************************************************************************** * Copyright (c) 2013 CEA LIST. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -23,6 +23,7 @@ public class DescriptionLabelProvider super(); } + @Override public String getText(Object element) { String result = null; diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/ElementLabelProvider.java b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/ElementLabelProvider.java index 3502b390f1f..365b5a18860 100644 --- a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/ElementLabelProvider.java +++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/ElementLabelProvider.java @@ -1,6 +1,6 @@ /***************************************************************************** * Copyright (c) 2013 CEA LIST. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -34,9 +34,10 @@ public class ElementLabelProvider super(); this.factory = ((AdapterFactoryEditingDomain) modelSet - .getTransactionalEditingDomain()).getAdapterFactory(); + .getTransactionalEditingDomain()).getAdapterFactory(); } + @Override public String getText(Object element) { String result = null; @@ -45,7 +46,7 @@ public class ElementLabelProvider EObject object = marker.getEObject(); if (object != null) { IItemLabelProvider provider = (IItemLabelProvider) factory - .adapt(object, IItemLabelProvider.class); + .adapt(object, IItemLabelProvider.class); if (provider != null) { result = provider.getText(object); } @@ -64,7 +65,7 @@ public class ElementLabelProvider EObject object = marker.getEObject(); if (object != null) { IItemLabelProvider provider = (IItemLabelProvider) factory - .adapt(object, IItemLabelProvider.class); + .adapt(object, IItemLabelProvider.class); if (provider != null) { result = images.getImage(provider.getImage(object)); } diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/InvertedViewerComparator.java b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/InvertedViewerComparator.java index e9a8fe65c06..d8fa1d937d2 100644 --- a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/InvertedViewerComparator.java +++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/InvertedViewerComparator.java @@ -1,6 +1,6 @@ /***************************************************************************** * Copyright (c) 2013 CEA LIST. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -29,20 +29,20 @@ public class InvertedViewerComparator public static ViewerComparator invert(ViewerComparator comparator) { return (comparator instanceof InvertedViewerComparator) - ? ((InvertedViewerComparator) comparator).comparator - : new InvertedViewerComparator(comparator); + ? ((InvertedViewerComparator) comparator).comparator + : new InvertedViewerComparator(comparator); } public static ViewerComparator unwrap(ViewerComparator comparator) { return (comparator instanceof InvertedViewerComparator) - ? ((InvertedViewerComparator) comparator).comparator - : comparator; + ? ((InvertedViewerComparator) comparator).comparator + : comparator; } - + public static int direction(ViewerComparator comparator) { return (comparator instanceof InvertedViewerComparator) - ? SWT.DOWN - : SWT.UP; + ? SWT.DOWN + : SWT.UP; } @Override @@ -68,6 +68,6 @@ public class InvertedViewerComparator @Override public boolean equals(Object obj) { return (obj instanceof InvertedViewerComparator) - && ((InvertedViewerComparator) obj).comparator.equals(comparator); + && ((InvertedViewerComparator) obj).comparator.equals(comparator); } } diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/LabelProviderSorter.java b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/LabelProviderSorter.java index a10be21dcbd..eb5a65ab34a 100644 --- a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/LabelProviderSorter.java +++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/LabelProviderSorter.java @@ -1,6 +1,6 @@ /***************************************************************************** * Copyright (c) 2013 CEA LIST. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/PathLabelProvider.java b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/PathLabelProvider.java index f4bc406e68d..197f7918bac 100644 --- a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/PathLabelProvider.java +++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/PathLabelProvider.java @@ -1,6 +1,6 @@ /***************************************************************************** * Copyright (c) 2013 CEA LIST. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -40,7 +40,7 @@ public class PathLabelProvider ILabelProvider provider = service.getLabelProvider(element); if (provider instanceof IQualifierLabelProvider) { result = ((IQualifierLabelProvider) provider) - .getQualifierText(element); + .getQualifierText(element); } } @@ -56,7 +56,7 @@ public class PathLabelProvider ILabelProvider provider = service.getLabelProvider(element); if (provider instanceof IQualifierLabelProvider) { result = ((IQualifierLabelProvider) provider) - .getQualifierImage(element); + .getQualifierImage(element); } } diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/ProblemCellLabelProvider.java b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/ProblemCellLabelProvider.java index d0d2f21d211..e963d7a1dd1 100644 --- a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/ProblemCellLabelProvider.java +++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/ProblemCellLabelProvider.java @@ -1,6 +1,6 @@ /***************************************************************************** * Copyright (c) 2013 CEA LIST. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/ProblemLabelProvider.java b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/ProblemLabelProvider.java index ad549abafc7..00bf22e142c 100644 --- a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/ProblemLabelProvider.java +++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/ProblemLabelProvider.java @@ -1,6 +1,6 @@ /***************************************************************************** * Copyright (c) 2013 CEA LIST. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -28,9 +28,9 @@ public abstract class ProblemLabelProvider public CellLabelProvider createCellLabelProvider() { return new ProblemCellLabelProvider(this); } - + public ViewerComparator createSorter() { return new LabelProviderSorter(this); } - + } diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/ProblemsContentProvider.java b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/ProblemsContentProvider.java index c47c5d83a33..33e46999588 100644 --- a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/ProblemsContentProvider.java +++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/ProblemsContentProvider.java @@ -1,6 +1,6 @@ /***************************************************************************** * Copyright (c) 2013, 2014 CEA LIST and others. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -9,7 +9,7 @@ * Contributors: * CEA LIST - Initial API and implementation * Christian W. Damus (CEA) - bug 437217 - * + * *****************************************************************************/ package org.eclipse.papyrus.views.validation.internal.providers; @@ -54,22 +54,22 @@ public class ProblemsContentProvider implements IStructuredContentProvider { } public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - this.viewer = (AbstractTableViewer)viewer; + this.viewer = (AbstractTableViewer) viewer; - if(oldInput instanceof ValidationMarkersService) { - ValidationMarkersService service = (ValidationMarkersService)oldInput; + if (oldInput instanceof ValidationMarkersService) { + ValidationMarkersService service = (ValidationMarkersService) oldInput; unhookMarkers(service); // The old service may have been disposed if its editor was closed - if(service.getModelSet() != null) { + if (service.getModelSet() != null) { unhookResourceSet(service.getModelSet().getTransactionalEditingDomain()); } this.service = null; } - if(newInput instanceof ValidationMarkersService) { - ValidationMarkersService service = (ValidationMarkersService)newInput; + if (newInput instanceof ValidationMarkersService) { + ValidationMarkersService service = (ValidationMarkersService) newInput; this.service = service; hookMarkers(service); hookResourceSet(service.getModelSet().getTransactionalEditingDomain()); @@ -77,7 +77,7 @@ public class ProblemsContentProvider implements IStructuredContentProvider { } public Object[] getElements(Object inputElement) { - return (inputElement instanceof ValidationMarkersService) ? Iterables.toArray(((ValidationMarkersService)inputElement).getMarkers(), IPapyrusMarker.class) : NONE; + return (inputElement instanceof ValidationMarkersService) ? Iterables.toArray(((ValidationMarkersService) inputElement).getMarkers(), IPapyrusMarker.class) : NONE; } protected void hookMarkers(ValidationMarkersService service) { @@ -89,12 +89,12 @@ public class ProblemsContentProvider implements IStructuredContentProvider { } private IValidationMarkerListener getValidationMarkerListener() { - if(listener == null) { + if (listener == null) { listener = new IValidationMarkerListener() { public void notifyMarkerChange(IPapyrusMarker marker, MarkerChangeKind kind) { - if(viewer != null) { - switch(kind) { + if (viewer != null) { + switch (kind) { case ADDED: viewer.add(marker); break; @@ -119,7 +119,7 @@ public class ProblemsContentProvider implements IStructuredContentProvider { } private ResourceSetListener getResourceSetListener() { - if(resourceSetListener == null) { + if (resourceSetListener == null) { resourceSetListener = new DemultiplexingListener() { @Override @@ -128,19 +128,19 @@ public class ProblemsContentProvider implements IStructuredContentProvider { // handle containment changes of problem elements to update // labels Object feature = notification.getFeature(); - if((feature instanceof EReference) && ((EReference)feature).isContainment()) { + if ((feature instanceof EReference) && ((EReference) feature).isContainment()) { - switch(notification.getEventType()) { + switch (notification.getEventType()) { case Notification.ADD: - handleContainment((EObject)notification.getNewValue()); + handleContainment((EObject) notification.getNewValue()); break; case Notification.ADD_MANY: - for(Object next : (Collection<?>)notification.getNewValue()) { - handleContainment((EObject)next); + for (Object next : (Collection<?>) notification.getNewValue()) { + handleContainment((EObject) next); } break; case Notification.SET: - handleContainment((EObject)notification.getNewValue()); + handleContainment((EObject) notification.getNewValue()); break; } } @@ -148,7 +148,7 @@ public class ProblemsContentProvider implements IStructuredContentProvider { private void handleContainment(EObject object) { Object[] markers = service.getMarkers(object).toArray(); - if(markers.length > 0) { + if (markers.length > 0) { viewer.update(markers, null); } } diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/SeverityLabelProvider.java b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/SeverityLabelProvider.java index 903d36cfd23..1dcd3bd4e0e 100644 --- a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/SeverityLabelProvider.java +++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/SeverityLabelProvider.java @@ -1,6 +1,6 @@ /***************************************************************************** * Copyright (c) 2013 CEA LIST. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -43,16 +43,16 @@ public class SeverityLabelProvider if (element instanceof IPapyrusMarker) { IPapyrusMarker marker = (IPapyrusMarker) element; switch (marker.getAttribute(IPapyrusMarker.SEVERITY, - IPapyrusMarker.SEVERITY_ERROR)) { - case IPapyrusMarker.SEVERITY_INFO : - result = images.getImage(ISharedImages.IMG_OBJS_INFO_TSK); - break; - case IPapyrusMarker.SEVERITY_WARNING : - result = images.getImage(ISharedImages.IMG_OBJS_WARN_TSK); - break; - default : - result = images.getImage(ISharedImages.IMG_OBJS_ERROR_TSK); - break; + IPapyrusMarker.SEVERITY_ERROR)) { + case IPapyrusMarker.SEVERITY_INFO: + result = images.getImage(ISharedImages.IMG_OBJS_INFO_TSK); + break; + case IPapyrusMarker.SEVERITY_WARNING: + result = images.getImage(ISharedImages.IMG_OBJS_WARN_TSK); + break; + default: + result = images.getImage(ISharedImages.IMG_OBJS_ERROR_TSK); + break; } } @@ -70,7 +70,7 @@ public class SeverityLabelProvider if (element instanceof IPapyrusMarker) { IPapyrusMarker marker = (IPapyrusMarker) element; result = IPapyrusMarker.SEVERITY_ERROR - - marker.getAttribute(IPapyrusMarker.SEVERITY, -1); + - marker.getAttribute(IPapyrusMarker.SEVERITY, -1); } return result; diff --git a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/TypeLabelProvider.java b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/TypeLabelProvider.java index 1c68dfada78..4fe47b0a228 100644 --- a/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/TypeLabelProvider.java +++ b/plugins/views/validation/org.eclipse.papyrus.views.validation/src/org/eclipse/papyrus/views/validation/internal/providers/TypeLabelProvider.java @@ -1,6 +1,6 @@ /***************************************************************************** * Copyright (c) 2013 CEA LIST. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at |