summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorHendrik Still2013-07-23 05:27:17 (EDT)
committer John Arthorne2013-07-23 10:05:56 (EDT)
commit99752661ac8adda3c3f0569fdccade307d13f51a (patch)
treeb93db14bc13f648e219dfaa3cc55af6c1c7d4b3f
parent7bb898866f6f90ba29528d372f38aa7250d183fc (diff)
downloadeclipse.platform.ui-99752661ac8adda3c3f0569fdccade307d13f51a.zip
eclipse.platform.ui-99752661ac8adda3c3f0569fdccade307d13f51a.tar.gz
eclipse.platform.ui-99752661ac8adda3c3f0569fdccade307d13f51a.tar.bz2
Bug 413499 - Fix compiler warnings in org.eclipse.jface.commands
Change-Id: I2bce9e5158c6bb271faf9b5fb8d26d7be4dfc952 Signed-off-by: Hendrik Still <hendrik.still@gammas.de>
-rw-r--r--bundles/org.eclipse.jface/src/org/eclipse/jface/commands/ActionHandler.java17
-rw-r--r--bundles/org.eclipse.jface/src/org/eclipse/jface/commands/RadioState.java19
-rw-r--r--bundles/org.eclipse.jface/src/org/eclipse/jface/commands/ToggleState.java6
3 files changed, 20 insertions, 22 deletions
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/commands/ActionHandler.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/commands/ActionHandler.java
index ec27259..fb5410d 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/commands/ActionHandler.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/commands/ActionHandler.java
@@ -22,8 +22,7 @@ import org.eclipse.swt.widgets.Event;
/**
* <p>
- * This class adapts instances of <code>IAction</code> to
- * <code>IHandler</code>.
+ * This class adapts instances of <code>IAction</code> to <code>IHandler</code>.
* </p>
*
* @since 3.1
@@ -79,8 +78,8 @@ public final class ActionHandler extends AbstractHandler {
final PropertyChangeEvent propertyChangeEvent) {
final String property = propertyChangeEvent.getProperty();
fireHandlerChanged(new HandlerEvent(ActionHandler.this,
- IAction.ENABLED.equals(property), IAction.HANDLED
- .equals(property)));
+ IAction.ENABLED.equals(property),
+ IAction.HANDLED.equals(property)));
}
};
}
@@ -108,7 +107,7 @@ public final class ActionHandler extends AbstractHandler {
action.removePropertyChangeListener(propertyChangeListener);
}
}
-
+
public final Object execute(final ExecutionEvent event)
throws ExecutionException {
if ((action.getStyle() == IAction.AS_CHECK_BOX)
@@ -138,17 +137,17 @@ public final class ActionHandler extends AbstractHandler {
public final IAction getAction() {
return action;
}
-
+
@Override
public final boolean isEnabled() {
return action.isEnabled();
}
-
+
@Override
public final boolean isHandled() {
return action.isHandled();
}
-
+
@Override
public final void removeHandlerListener(
final IHandlerListener handlerListener) {
@@ -158,7 +157,7 @@ public final class ActionHandler extends AbstractHandler {
detachListener();
}
}
-
+
@Override
public final String toString() {
final StringBuffer buffer = new StringBuffer();
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/commands/RadioState.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/commands/RadioState.java
index 00c2cb4..5478ad3 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/commands/RadioState.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/commands/RadioState.java
@@ -61,10 +61,10 @@ public class RadioState extends ToggleState {
* The current members in this group. If there are no members, then
* this value is <code>nlistenerull</code>.
*/
- private Set members = null;
+ private Set<RadioState> members = null;
/**
- * Activates a memeber. This checks to see if there are any other
+ * Activates a member. This checks to see if there are any other
* active members. If there are, they are deactivated.
*
* @param state
@@ -72,7 +72,7 @@ public class RadioState extends ToggleState {
* <code>null</code>.
*/
private final void activateMember(final RadioState state) {
- if (active!=null && active != state) {
+ if (active != null && active != state) {
active.setValue(Boolean.FALSE);
}
active = state;
@@ -80,7 +80,7 @@ public class RadioState extends ToggleState {
/**
* Adds a member to this radio group. If the state being added is
- * active, then it replaces the currently active group memeber as
+ * active, then it replaces the currently active group member as
* the active state.
*
* @param state
@@ -88,7 +88,7 @@ public class RadioState extends ToggleState {
*/
private final void addMember(final RadioState state) {
if (members == null) {
- members = new HashSet(5);
+ members = new HashSet<RadioState>(5);
}
members.add(state);
@@ -134,11 +134,10 @@ public class RadioState extends ToggleState {
/**
* The map of radio states indexed by identifier (<code>String</code>).
- * The radio states is either a single <code>RadioState</code>
- * instance or a <code>Collection</code> of <code>RadioState</code>
- * instances.
+ * The radio states is either a single <code>RadioState</code> instance
+ * or a <code>Collection</code> of <code>RadioState</code> instances.
*/
- private static Map radioStatesById = null;
+ private static Map<String, RadioGroup> radioStatesById = null;
/**
* Activates a particular state within a given group.
@@ -174,7 +173,7 @@ public class RadioState extends ToggleState {
private static final void registerState(final String identifier,
final RadioState state) {
if (radioStatesById == null) {
- radioStatesById = new HashMap();
+ radioStatesById = new HashMap<String, RadioGroup>();
}
final Object currentValue = radioStatesById.get(identifier);
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/commands/ToggleState.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/commands/ToggleState.java
index 0aa24e7..f54b330 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/commands/ToggleState.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/commands/ToggleState.java
@@ -32,8 +32,8 @@ import org.eclipse.jface.preference.IPreferenceStore;
public class ToggleState extends PersistentState {
/**
- * Constructs a new <code>ToggleState</code>. By default, the toggle is
- * off (e.g., <code>false</code>).
+ * Constructs a new <code>ToggleState</code>. By default, the toggle is off
+ * (e.g., <code>false</code>).
*/
public ToggleState() {
setValue(Boolean.FALSE);
@@ -42,7 +42,7 @@ public class ToggleState extends PersistentState {
@Override
public final void load(final IPreferenceStore store,
final String preferenceKey) {
- final boolean currentValue = ((Boolean) getValue()).booleanValue();
+ final boolean currentValue = ((Boolean) getValue()).booleanValue();
store.setDefault(preferenceKey, currentValue);
if (shouldPersist() && (store.contains(preferenceKey))) {
final boolean value = store.getBoolean(preferenceKey);