diff options
author | Remy Suen | 2011-09-22 13:30:46 +0000 |
---|---|---|
committer | Remy Suen | 2011-09-22 13:30:46 +0000 |
commit | d73063603ee60c5675cba1ea64ae18593e1b34eb (patch) | |
tree | fae2e3b85b171ba6c691e6b9d36d85292f1cfcf1 | |
parent | 80bdafdc56b4e557be15c462e0dfafd7d06f8d4d (diff) | |
download | eclipse.platform.ui-d73063603ee60c5675cba1ea64ae18593e1b34eb.tar.gz eclipse.platform.ui-d73063603ee60c5675cba1ea64ae18593e1b34eb.tar.xz eclipse.platform.ui-d73063603ee60c5675cba1ea64ae18593e1b34eb.zip |
Clean-up warnings
-rw-r--r-- | bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java | 67 |
1 files changed, 37 insertions, 30 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java index ad5fddae8f5..f493cf7cfb3 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java @@ -20,6 +20,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import javax.annotation.PostConstruct; import javax.inject.Inject; @@ -200,8 +201,6 @@ public class WorkbenchWindow implements IWorkbenchWindow { private ActionBarAdvisor actionBarAdvisor; - private int number; - private PageListenerList pageListeners = new PageListenerList(); private PerspectiveListenerList perspectiveListeners = new PerspectiveListenerList(); @@ -225,10 +224,11 @@ public class WorkbenchWindow implements IWorkbenchWindow { public IConfigurationElement getICEFor(MToolControl mtc) { return iceMap.get(mtc); } + /** * The map of services maintained by the workbench window. These services - * are initialized during workbench window during the - * {@link #configureShell(Shell)}. + * are initialized when the workbench window is being constructed by + * dependency injection. */ private ServiceLocator serviceLocator; @@ -389,8 +389,10 @@ public class WorkbenchWindow implements IWorkbenchWindow { /** * Creates and initializes a new workbench window. * - * @param number - * the number for the window + * @param input + * the input for this workbench window + * @param pers + * the perspective to initialize this workbench window with */ public WorkbenchWindow(IAdaptable input, IPerspectiveDescriptor pers) { this.input = input; @@ -942,13 +944,13 @@ public class WorkbenchWindow implements IWorkbenchWindow { * <code>ActionHandler</code>. This map is never <code>null</code>, and is * never empty as long as at least one global action has been registered. */ - private Map globalActionHandlersByCommandId = new HashMap(); + private Map<String, ActionHandler> globalActionHandlersByCommandId = new HashMap<String, ActionHandler>(); /** * The list of handler submissions submitted to the workbench command * support. This list may be empty, but it is never <code>null</code>. */ - private List handlerActivations = new ArrayList(); + private List<IHandlerActivation> handlerActivations = new ArrayList<IHandlerActivation>(); /** * The number of large updates that are currently going on. If this is @@ -1020,14 +1022,15 @@ public class WorkbenchWindow implements IWorkbenchWindow { * Mash the action sets and global actions together, with global actions * taking priority. */ - Map handlersByCommandId = new HashMap(); + Map<String, ActionHandler> handlersByCommandId = new HashMap<String, ActionHandler>(); handlersByCommandId.putAll(globalActionHandlersByCommandId); - List newHandlers = new ArrayList(handlersByCommandId.size()); + List<IHandlerActivation> newHandlers = new ArrayList<IHandlerActivation>( + handlersByCommandId.size()); - Iterator existingIter = handlerActivations.iterator(); + Iterator<IHandlerActivation> existingIter = handlerActivations.iterator(); while (existingIter.hasNext()) { - IHandlerActivation next = (IHandlerActivation) existingIter.next(); + IHandlerActivation next = existingIter.next(); String cmdId = next.getCommandId(); @@ -1043,10 +1046,11 @@ public class WorkbenchWindow implements IWorkbenchWindow { final Shell shell = getShell(); if (shell != null) { final Expression expression = new ActiveShellExpression(shell); - for (Iterator iterator = handlersByCommandId.entrySet().iterator(); iterator.hasNext();) { - Map.Entry entry = (Map.Entry) iterator.next(); - String commandId = (String) entry.getKey(); - IHandler handler = (IHandler) entry.getValue(); + for (Iterator<Entry<String, ActionHandler>> iterator = handlersByCommandId.entrySet() + .iterator(); iterator.hasNext();) { + Entry<String, ActionHandler> entry = iterator.next(); + String commandId = entry.getKey(); + IHandler handler = entry.getValue(); newHandlers.add(handlerService.activateHandler(commandId, handler, expression)); } } @@ -1246,6 +1250,10 @@ public class WorkbenchWindow implements IWorkbenchWindow { /** * Fires perspective changed + * + * @param page + * @param perspective + * @param changeId */ public void firePerspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId) { @@ -1259,6 +1267,11 @@ public class WorkbenchWindow implements IWorkbenchWindow { /** * Fires perspective changed for an affected part + * + * @param page + * @param perspective + * @param partRef + * @param changeId */ public void firePerspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, IWorkbenchPartReference partRef, String changeId) { @@ -1302,6 +1315,8 @@ public class WorkbenchWindow implements IWorkbenchWindow { /** * Returns the action bars for this window. + * + * @return this window's action bars */ public WWinActionBars getActionBars() { if (actionBars == null) { @@ -1320,14 +1335,6 @@ public class WorkbenchWindow implements IWorkbenchWindow { } /** - * Returns the number. This corresponds to a page number in a window or a - * window number in the workbench. - */ - public int getNumber() { - return number; - } - - /** * Returns an array of the pages in the workbench window. * * @return an array of pages @@ -1437,9 +1444,9 @@ public class WorkbenchWindow implements IWorkbenchWindow { final IHandlerService handlerService = (IHandlerService) workbench .getService(IHandlerService.class); handlerService.deactivateHandlers(handlerActivations); - final Iterator activationItr = handlerActivations.iterator(); + final Iterator<IHandlerActivation> activationItr = handlerActivations.iterator(); while (activationItr.hasNext()) { - final IHandlerActivation activation = (IHandlerActivation) activationItr.next(); + final IHandlerActivation activation = activationItr.next(); activation.getHandler().dispose(); } handlerActivations.clear(); @@ -1667,13 +1674,13 @@ public class WorkbenchWindow implements IWorkbenchWindow { } } - private Set menuRestrictions = new HashSet(); + private Set<?> menuRestrictions = new HashSet<Object>(); private Boolean valueOf(boolean result) { return result ? Boolean.TRUE : Boolean.FALSE; } - public Set getMenuRestrictions() { + public Set<?> getMenuRestrictions() { return menuRestrictions; } @@ -1681,7 +1688,7 @@ public class WorkbenchWindow implements IWorkbenchWindow { if (menuRestrictions.isEmpty()) { return; } - EvaluationReference[] refs = (EvaluationReference[]) menuRestrictions + EvaluationReference[] refs = menuRestrictions .toArray(new EvaluationReference[menuRestrictions.size()]); IEvaluationService es = (IEvaluationService) serviceLocator .getService(IEvaluationService.class); @@ -1710,7 +1717,7 @@ public class WorkbenchWindow implements IWorkbenchWindow { } void imposeRestrictions() { - Iterator i = menuRestrictions.iterator(); + Iterator<?> i = menuRestrictions.iterator(); while (i.hasNext()) { EvaluationReference ref = (EvaluationReference) i.next(); ref.setPostingChanges(false); |