diff options
author | Eike Stepper | 2015-04-22 16:16:16 +0000 |
---|---|---|
committer | Eike Stepper | 2015-04-22 16:16:16 +0000 |
commit | d2c5b0ee9d0634fb6c79d99e6952ee0d7c752dd7 (patch) | |
tree | 6488f73e26dcddd9b1c7befccf7ba721215edce9 /plugins/org.eclipse.emf.cdo.security.editor | |
parent | ef5341796d793607c49d863f8607f3193ceb08ae (diff) | |
download | cdo-d2c5b0ee9d0634fb6c79d99e6952ee0d7c752dd7.tar.gz cdo-d2c5b0ee9d0634fb6c79d99e6952ee0d7c752dd7.tar.xz cdo-d2c5b0ee9d0634fb6c79d99e6952ee0d7c752dd7.zip |
[Releng] Reformat everything with M6 formatter
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.security.editor')
3 files changed, 388 insertions, 389 deletions
diff --git a/plugins/org.eclipse.emf.cdo.security.editor/src/org/eclipse/emf/cdo/security/presentation/SecurityActionBarContributor.java b/plugins/org.eclipse.emf.cdo.security.editor/src/org/eclipse/emf/cdo/security/presentation/SecurityActionBarContributor.java index 7919fdbe34..522923017c 100644 --- a/plugins/org.eclipse.emf.cdo.security.editor/src/org/eclipse/emf/cdo/security/presentation/SecurityActionBarContributor.java +++ b/plugins/org.eclipse.emf.cdo.security.editor/src/org/eclipse/emf/cdo/security/presentation/SecurityActionBarContributor.java @@ -49,8 +49,7 @@ import java.util.Collection; * <!-- end-user-doc --> * @generated */ -public class SecurityActionBarContributor extends EditingDomainActionBarContributor implements - ISelectionChangedListener +public class SecurityActionBarContributor extends EditingDomainActionBarContributor implements ISelectionChangedListener { /** * This keeps track of the active editor. @@ -75,8 +74,8 @@ public class SecurityActionBarContributor extends EditingDomainActionBarContribu * @generated */ protected IAction showPropertiesViewAction = new Action( - SecurityEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) //$NON-NLS-1$ - { + SecurityEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item"))//$NON-NLS-1$ + { @Override public void run() { @@ -89,385 +88,385 @@ public class SecurityActionBarContributor extends EditingDomainActionBarContribu SecurityEditorPlugin.INSTANCE.log(exception); } } - }; - - /** - * This action refreshes the viewer of the current editor if the editor - * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected IAction refreshViewerAction = new Action( - SecurityEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) //$NON-NLS-1$ - { - @Override - public boolean isEnabled() - { - return activeEditorPart instanceof IViewerProvider; - } - - @Override - public void run() - { - if (activeEditorPart instanceof IViewerProvider) - { - Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer(); - if (viewer != null) + }; + + /** + * This action refreshes the viewer of the current editor if the editor + * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected IAction refreshViewerAction = new Action( + SecurityEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item"))//$NON-NLS-1$ + { + @Override + public boolean isEnabled() { - viewer.refresh(); + return activeEditorPart instanceof IViewerProvider; } - } - } - }; - - /** - * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor - * generated for the current selection by the item provider. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected Collection<IAction> createChildActions; - - /** - * This is the menu manager into which menu contribution items should be added for CreateChild actions. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected IMenuManager createChildMenuManager; - - /** - * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor - * generated for the current selection by the item provider. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected Collection<IAction> createSiblingActions; - - /** - * This is the menu manager into which menu contribution items should be added for CreateSibling actions. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected IMenuManager createSiblingMenuManager; - - /** - * This creates an instance of the contributor. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public SecurityActionBarContributor() - { - super(ADDITIONS_LAST_STYLE); - loadResourceAction = new LoadResourceAction(); - validateAction = new ValidateAction(); - controlAction = new ControlAction(); - } - - /** - * This adds Separators for editor additions to the tool bar. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public void contributeToToolBar(IToolBarManager toolBarManager) - { - toolBarManager.add(new Separator("security-settings")); //$NON-NLS-1$ - toolBarManager.add(new Separator("security-additions")); //$NON-NLS-1$ - } - - /** - * This adds to the menu bar a menu and some separators for editor additions, - * as well as the sub-menus for object creation items. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public void contributeToMenu(IMenuManager menuManager) - { - super.contributeToMenu(menuManager); - - IMenuManager submenuManager = new MenuManager( - SecurityEditorPlugin.INSTANCE.getString("_UI_SecurityEditor_menu"), "org.eclipse.emf.cdo.securityMenuID"); //$NON-NLS-1$ //$NON-NLS-2$ - menuManager.insertAfter("additions", submenuManager); //$NON-NLS-1$ - submenuManager.add(new Separator("settings")); //$NON-NLS-1$ - submenuManager.add(new Separator("actions")); //$NON-NLS-1$ - submenuManager.add(new Separator("additions")); //$NON-NLS-1$ - submenuManager.add(new Separator("additions-end")); //$NON-NLS-1$ - - // Prepare for CreateChild item addition or removal. - // - createChildMenuManager = new MenuManager(SecurityEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); //$NON-NLS-1$ - submenuManager.insertBefore("additions", createChildMenuManager); //$NON-NLS-1$ - - // Prepare for CreateSibling item addition or removal. - // - createSiblingMenuManager = new MenuManager(SecurityEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); //$NON-NLS-1$ - submenuManager.insertBefore("additions", createSiblingMenuManager); //$NON-NLS-1$ - - // Force an update because Eclipse hides empty menus now. - // - submenuManager.addMenuListener(new IMenuListener() - { - public void menuAboutToShow(IMenuManager menuManager) - { - menuManager.updateAll(true); - } - }); - - addGlobalActions(submenuManager); - } - - /** - * When the active editor changes, this remembers the change and registers with it as a selection provider. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public void setActiveEditor(IEditorPart part) - { - super.setActiveEditor(part); - activeEditorPart = part; - - // Switch to the new selection provider. - // - if (selectionProvider != null) - { - selectionProvider.removeSelectionChangedListener(this); - } - if (part == null) - { - selectionProvider = null; - } - else - { - selectionProvider = part.getSite().getSelectionProvider(); - selectionProvider.addSelectionChangedListener(this); - - // Fake a selection changed event to update the menus. - // - if (selectionProvider.getSelection() != null) - { - selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection())); - } - } - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener}, - * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings - * that can be added to the selected object and updating the menus accordingly. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void selectionChanged(SelectionChangedEvent event) - { - // Remove any menu items for old selection. - // - if (createChildMenuManager != null) - { - depopulateManager(createChildMenuManager, createChildActions); - } - if (createSiblingMenuManager != null) - { - depopulateManager(createSiblingMenuManager, createSiblingActions); - } - - // Query the new selection for appropriate new child/sibling descriptors - // - Collection<?> newChildDescriptors = null; - Collection<?> newSiblingDescriptors = null; - - ISelection selection = event.getSelection(); - if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) - { - Object object = ((IStructuredSelection)selection).getFirstElement(); - EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain(); + @Override + public void run() + { + if (activeEditorPart instanceof IViewerProvider) + { + Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer(); + if (viewer != null) + { + viewer.refresh(); + } + } + } + }; + + /** + * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor + * generated for the current selection by the item provider. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected Collection<IAction> createChildActions; + + /** + * This is the menu manager into which menu contribution items should be added for CreateChild actions. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected IMenuManager createChildMenuManager; + + /** + * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor + * generated for the current selection by the item provider. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected Collection<IAction> createSiblingActions; + + /** + * This is the menu manager into which menu contribution items should be added for CreateSibling actions. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected IMenuManager createSiblingMenuManager; + + /** + * This creates an instance of the contributor. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public SecurityActionBarContributor() + { + super(ADDITIONS_LAST_STYLE); + loadResourceAction = new LoadResourceAction(); + validateAction = new ValidateAction(); + controlAction = new ControlAction(); + } - newChildDescriptors = domain.getNewChildDescriptors(object, null); - newSiblingDescriptors = domain.getNewChildDescriptors(null, object); - } + /** + * This adds Separators for editor additions to the tool bar. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void contributeToToolBar(IToolBarManager toolBarManager) + { + toolBarManager.add(new Separator("security-settings")); //$NON-NLS-1$ + toolBarManager.add(new Separator("security-additions")); //$NON-NLS-1$ + } - // Generate actions for selection; populate and redraw the menus. - // - createChildActions = generateCreateChildActions(newChildDescriptors, selection); - createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection); + /** + * This adds to the menu bar a menu and some separators for editor additions, + * as well as the sub-menus for object creation items. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void contributeToMenu(IMenuManager menuManager) + { + super.contributeToMenu(menuManager); + + IMenuManager submenuManager = new MenuManager(SecurityEditorPlugin.INSTANCE.getString("_UI_SecurityEditor_menu"), //$NON-NLS-1$ + "org.eclipse.emf.cdo.securityMenuID"); //$NON-NLS-1$ + menuManager.insertAfter("additions", submenuManager); //$NON-NLS-1$ + submenuManager.add(new Separator("settings")); //$NON-NLS-1$ + submenuManager.add(new Separator("actions")); //$NON-NLS-1$ + submenuManager.add(new Separator("additions")); //$NON-NLS-1$ + submenuManager.add(new Separator("additions-end")); //$NON-NLS-1$ + + // Prepare for CreateChild item addition or removal. + // + createChildMenuManager = new MenuManager(SecurityEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); //$NON-NLS-1$ + submenuManager.insertBefore("additions", createChildMenuManager); //$NON-NLS-1$ + + // Prepare for CreateSibling item addition or removal. + // + createSiblingMenuManager = new MenuManager(SecurityEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); //$NON-NLS-1$ + submenuManager.insertBefore("additions", createSiblingMenuManager); //$NON-NLS-1$ + + // Force an update because Eclipse hides empty menus now. + // + submenuManager.addMenuListener(new IMenuListener() + { + public void menuAboutToShow(IMenuManager menuManager) + { + menuManager.updateAll(true); + } + }); + + addGlobalActions(submenuManager); + } - if (createChildMenuManager != null) - { - populateManager(createChildMenuManager, createChildActions, null); - createChildMenuManager.update(true); - } - if (createSiblingMenuManager != null) - { - populateManager(createSiblingMenuManager, createSiblingActions, null); - createSiblingMenuManager.update(true); - } - } + /** + * When the active editor changes, this remembers the change and registers with it as a selection provider. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void setActiveEditor(IEditorPart part) + { + super.setActiveEditor(part); + activeEditorPart = part; + + // Switch to the new selection provider. + // + if (selectionProvider != null) + { + selectionProvider.removeSelectionChangedListener(this); + } + if (part == null) + { + selectionProvider = null; + } + else + { + selectionProvider = part.getSite().getSelectionProvider(); + selectionProvider.addSelectionChangedListener(this); + + // Fake a selection changed event to update the menus. + // + if (selectionProvider.getSelection() != null) + { + selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection())); + } + } + } - /** - * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in <code>descriptors</code>, - * and returns the collection of these actions. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection) - { - Collection<IAction> actions = new ArrayList<IAction>(); - if (descriptors != null) - { - for (Object descriptor : descriptors) - { - actions.add(new CreateChildAction(activeEditorPart, selection, descriptor)); - } - } - return actions; - } + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener}, + * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings + * that can be added to the selected object and updating the menus accordingly. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void selectionChanged(SelectionChangedEvent event) + { + // Remove any menu items for old selection. + // + if (createChildMenuManager != null) + { + depopulateManager(createChildMenuManager, createChildActions); + } + if (createSiblingMenuManager != null) + { + depopulateManager(createSiblingMenuManager, createSiblingActions); + } + + // Query the new selection for appropriate new child/sibling descriptors + // + Collection<?> newChildDescriptors = null; + Collection<?> newSiblingDescriptors = null; + + ISelection selection = event.getSelection(); + if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) + { + Object object = ((IStructuredSelection)selection).getFirstElement(); + + EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain(); + + newChildDescriptors = domain.getNewChildDescriptors(object, null); + newSiblingDescriptors = domain.getNewChildDescriptors(null, object); + } + + // Generate actions for selection; populate and redraw the menus. + // + createChildActions = generateCreateChildActions(newChildDescriptors, selection); + createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection); + + if (createChildMenuManager != null) + { + populateManager(createChildMenuManager, createChildActions, null); + createChildMenuManager.update(true); + } + if (createSiblingMenuManager != null) + { + populateManager(createSiblingMenuManager, createSiblingActions, null); + createSiblingMenuManager.update(true); + } + } - /** - * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>, - * and returns the collection of these actions. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) - { - Collection<IAction> actions = new ArrayList<IAction>(); - if (descriptors != null) - { - for (Object descriptor : descriptors) - { - actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor)); - } - } - return actions; - } + /** + * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in <code>descriptors</code>, + * and returns the collection of these actions. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection) + { + Collection<IAction> actions = new ArrayList<IAction>(); + if (descriptors != null) + { + for (Object descriptor : descriptors) + { + actions.add(new CreateChildAction(activeEditorPart, selection, descriptor)); + } + } + return actions; + } - /** - * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s - * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection, - * by inserting them before the specified contribution item <code>contributionID</code>. - * If <code>contributionID</code> is <code>null</code>, they are simply added. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, - String contributionID) - { - if (actions != null) - { - for (IAction action : actions) - { - if (contributionID != null) - { - manager.insertBefore(contributionID, action); - } - else - { - manager.add(action); - } - } - } - } + /** + * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>, + * and returns the collection of these actions. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) + { + Collection<IAction> actions = new ArrayList<IAction>(); + if (descriptors != null) + { + for (Object descriptor : descriptors) + { + actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor)); + } + } + return actions; + } - /** - * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s - * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) - { - if (actions != null) - { - IContributionItem[] items = manager.getItems(); - for (int i = 0; i < items.length; i++) - { - // Look into SubContributionItems - // - IContributionItem contributionItem = items[i]; - while (contributionItem instanceof SubContributionItem) - { - contributionItem = ((SubContributionItem)contributionItem).getInnerItem(); - } + /** + * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s + * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection, + * by inserting them before the specified contribution item <code>contributionID</code>. + * If <code>contributionID</code> is <code>null</code>, they are simply added. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, + String contributionID) + { + if (actions != null) + { + for (IAction action : actions) + { + if (contributionID != null) + { + manager.insertBefore(contributionID, action); + } + else + { + manager.add(action); + } + } + } + } - // Delete the ActionContributionItems with matching action. - // - if (contributionItem instanceof ActionContributionItem) - { - IAction action = ((ActionContributionItem)contributionItem).getAction(); - if (actions.contains(action)) + /** + * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s + * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) { - manager.remove(contributionItem); + if (actions != null) + { + IContributionItem[] items = manager.getItems(); + for (int i = 0; i < items.length; i++) + { + // Look into SubContributionItems + // + IContributionItem contributionItem = items[i]; + while (contributionItem instanceof SubContributionItem) + { + contributionItem = ((SubContributionItem)contributionItem).getInnerItem(); + } + + // Delete the ActionContributionItems with matching action. + // + if (contributionItem instanceof ActionContributionItem) + { + IAction action = ((ActionContributionItem)contributionItem).getAction(); + if (actions.contains(action)) + { + manager.remove(contributionItem); + } + } + } + } } - } - } - } - } - /** - * This populates the pop-up menu before it appears. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public void menuAboutToShow(IMenuManager menuManager) - { - super.menuAboutToShow(menuManager); - MenuManager submenuManager = null; + /** + * This populates the pop-up menu before it appears. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void menuAboutToShow(IMenuManager menuManager) + { + super.menuAboutToShow(menuManager); + MenuManager submenuManager = null; - submenuManager = new MenuManager(SecurityEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); //$NON-NLS-1$ - populateManager(submenuManager, createChildActions, null); - menuManager.insertBefore("edit", submenuManager); //$NON-NLS-1$ + submenuManager = new MenuManager(SecurityEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); //$NON-NLS-1$ + populateManager(submenuManager, createChildActions, null); + menuManager.insertBefore("edit", submenuManager); //$NON-NLS-1$ - submenuManager = new MenuManager(SecurityEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); //$NON-NLS-1$ - populateManager(submenuManager, createSiblingActions, null); - menuManager.insertBefore("edit", submenuManager); //$NON-NLS-1$ - } + submenuManager = new MenuManager(SecurityEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); //$NON-NLS-1$ + populateManager(submenuManager, createSiblingActions, null); + menuManager.insertBefore("edit", submenuManager); //$NON-NLS-1$ + } - /** - * This inserts global actions before the "additions-end" separator. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - protected void addGlobalActions(IMenuManager menuManager) - { - menuManager.insertAfter("additions-end", new Separator("ui-actions")); //$NON-NLS-1$ //$NON-NLS-2$ - menuManager.insertAfter("ui-actions", showPropertiesViewAction); //$NON-NLS-1$ + /** + * This inserts global actions before the "additions-end" separator. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected void addGlobalActions(IMenuManager menuManager) + { + menuManager.insertAfter("additions-end", new Separator("ui-actions")); //$NON-NLS-1$ //$NON-NLS-2$ + menuManager.insertAfter("ui-actions", showPropertiesViewAction); //$NON-NLS-1$ - refreshViewerAction.setEnabled(refreshViewerAction.isEnabled()); - menuManager.insertAfter("ui-actions", refreshViewerAction); //$NON-NLS-1$ + refreshViewerAction.setEnabled(refreshViewerAction.isEnabled()); + menuManager.insertAfter("ui-actions", refreshViewerAction); //$NON-NLS-1$ - super.addGlobalActions(menuManager); - } + super.addGlobalActions(menuManager); + } - /** - * This ensures that a delete action will clean up all references to deleted objects. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - protected boolean removeAllReferencesOnDelete() - { - return true; - } + /** + * This ensures that a delete action will clean up all references to deleted objects. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected boolean removeAllReferencesOnDelete() + { + return true; + } } diff --git a/plugins/org.eclipse.emf.cdo.security.editor/src/org/eclipse/emf/cdo/security/presentation/SecurityEditor.java b/plugins/org.eclipse.emf.cdo.security.editor/src/org/eclipse/emf/cdo/security/presentation/SecurityEditor.java index f821be6a5c..cd1ff9b347 100644 --- a/plugins/org.eclipse.emf.cdo.security.editor/src/org/eclipse/emf/cdo/security/presentation/SecurityEditor.java +++ b/plugins/org.eclipse.emf.cdo.security.editor/src/org/eclipse/emf/cdo/security/presentation/SecurityEditor.java @@ -126,8 +126,8 @@ import java.util.Map; * <!-- end-user-doc --> * @generated */ -public class SecurityEditor extends MultiPageEditorPart implements IEditingDomainProvider, ISelectionProvider, - IMenuListener, IViewerProvider, IGotoMarker +public class SecurityEditor 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. @@ -420,11 +420,11 @@ public class SecurityEditor extends MultiPageEditorPart implements IEditingDomai { if (delta.getResource().getType() == IResource.FILE) { - if (delta.getKind() == IResourceDelta.REMOVED || delta.getKind() == IResourceDelta.CHANGED - && delta.getFlags() != IResourceDelta.MARKERS) + if (delta.getKind() == IResourceDelta.REMOVED + || delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) { - Resource resource = resourceSet.getResource( - URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false); + Resource resource = resourceSet + .getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false); if (resource != null) { if (delta.getKind() == IResourceDelta.REMOVED) @@ -1022,8 +1022,8 @@ public class SecurityEditor extends MultiPageEditorPart implements IEditingDomai setCurrentViewer(selectionViewer); selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider.FontAndColorProvider(adapterFactory, - selectionViewer)); + selectionViewer + .setLabelProvider(new AdapterFactoryLabelProvider.FontAndColorProvider(adapterFactory, selectionViewer)); selectionViewer.setInput(editingDomain.getResourceSet()); selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); @@ -1181,8 +1181,8 @@ public class SecurityEditor extends MultiPageEditorPart implements IEditingDomai // Set up the tree viewer. // contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider.FontAndColorProvider(adapterFactory, - contentOutlineViewer)); + contentOutlineViewer.setLabelProvider( + new AdapterFactoryLabelProvider.FontAndColorProvider(adapterFactory, contentOutlineViewer)); contentOutlineViewer.setInput(editingDomain.getResourceSet()); // Make sure our popups work. @@ -1193,8 +1193,8 @@ public class SecurityEditor extends MultiPageEditorPart implements IEditingDomai { // Select the root object in the view. // - contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources() - .get(0)), true); + contentOutlineViewer + .setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); } } @@ -1447,9 +1447,9 @@ public class SecurityEditor extends MultiPageEditorPart implements IEditingDomai editingDomain.getResourceSet().getResources().get(0).setURI(uri); setInputWithNotify(editorInput); setPartName(editorInput.getName()); - IProgressMonitor progressMonitor = getActionBars().getStatusLineManager() != null ? getActionBars() - .getStatusLineManager().getProgressMonitor() : new NullProgressMonitor(); - doSave(progressMonitor); + IProgressMonitor progressMonitor = getActionBars().getStatusLineManager() != null + ? getActionBars().getStatusLineManager().getProgressMonitor() : new NullProgressMonitor(); + doSave(progressMonitor); } /** @@ -1552,8 +1552,8 @@ public class SecurityEditor extends MultiPageEditorPart implements IEditingDomai */ 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) { diff --git a/plugins/org.eclipse.emf.cdo.security.editor/src/org/eclipse/emf/cdo/security/presentation/SecurityModelWizard.java b/plugins/org.eclipse.emf.cdo.security.editor/src/org/eclipse/emf/cdo/security/presentation/SecurityModelWizard.java index 43e3687eab..dc462ea39a 100644 --- a/plugins/org.eclipse.emf.cdo.security.editor/src/org/eclipse/emf/cdo/security/presentation/SecurityModelWizard.java +++ b/plugins/org.eclipse.emf.cdo.security.editor/src/org/eclipse/emf/cdo/security/presentation/SecurityModelWizard.java @@ -91,8 +91,8 @@ public class SecurityModelWizard extends Wizard implements INewWizard * <!-- end-user-doc --> * @generated */ - public static final String FORMATTED_FILE_EXTENSIONS = SecurityEditorPlugin.INSTANCE.getString( - "_UI_SecurityEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + public static final String FORMATTED_FILE_EXTENSIONS = SecurityEditorPlugin.INSTANCE + .getString("_UI_SecurityEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ /** * This caches an instance of the model package. @@ -161,8 +161,8 @@ public class SecurityModelWizard extends Wizard implements INewWizard this.workbench = workbench; this.selection = selection; setWindowTitle(SecurityEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); //$NON-NLS-1$ - setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(SecurityEditorPlugin.INSTANCE - .getImage("full/wizban/NewSecurity"))); //$NON-NLS-1$ + setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE + .getImageDescriptor(SecurityEditorPlugin.INSTANCE.getImage("full/wizban/NewSecurity"))); //$NON-NLS-1$ } /** @@ -607,8 +607,8 @@ public class SecurityModelWizard extends Wizard implements INewWizard newFileCreationPage = new SecurityModelWizardNewFileCreationPage("Whatever", selection); //$NON-NLS-1$ newFileCreationPage.setTitle(SecurityEditorPlugin.INSTANCE.getString("_UI_SecurityModelWizard_label")); //$NON-NLS-1$ newFileCreationPage.setDescription(SecurityEditorPlugin.INSTANCE.getString("_UI_SecurityModelWizard_description")); //$NON-NLS-1$ - newFileCreationPage - .setFileName(SecurityEditorPlugin.INSTANCE.getString("_UI_SecurityEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0)); //$NON-NLS-1$ //$NON-NLS-2$ + newFileCreationPage.setFileName(SecurityEditorPlugin.INSTANCE.getString("_UI_SecurityEditorFilenameDefaultBase") //$NON-NLS-1$ + + "." + FILE_EXTENSIONS.get(0)); //$NON-NLS-1$ addPage(newFileCreationPage); // Try and get the resource selection to determine a current directory for the file dialog. @@ -652,8 +652,8 @@ public class SecurityModelWizard extends Wizard implements INewWizard } initialObjectCreationPage = new SecurityModelWizardInitialObjectCreationPage("Whatever2"); //$NON-NLS-1$ initialObjectCreationPage.setTitle(SecurityEditorPlugin.INSTANCE.getString("_UI_SecurityModelWizard_label")); //$NON-NLS-1$ - initialObjectCreationPage.setDescription(SecurityEditorPlugin.INSTANCE - .getString("_UI_Wizard_initial_object_description")); //$NON-NLS-1$ + initialObjectCreationPage + .setDescription(SecurityEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description")); //$NON-NLS-1$ addPage(initialObjectCreationPage); } |