diff options
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/EditTextRule.java')
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/EditTextRule.java | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/EditTextRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/EditTextRule.java index 875756b..dc60086 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/EditTextRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/EditTextRule.java @@ -16,10 +16,12 @@ package com.android.ide.common.layout; -import static com.android.util.XmlUtils.ANDROID_URI; import static com.android.ide.common.layout.LayoutConstants.ATTR_EMS; import static com.android.ide.eclipse.adt.internal.editors.layout.descriptors.LayoutDescriptors.REQUEST_FOCUS; +import static com.android.util.XmlUtils.ANDROID_URI; +import com.android.annotations.NonNull; +import com.android.annotations.Nullable; import com.android.ide.common.api.IMenuCallback; import com.android.ide.common.api.INode; import com.android.ide.common.api.INodeHandler; @@ -35,7 +37,8 @@ import java.util.List; public class EditTextRule extends BaseViewRule { @Override - public void onCreate(INode node, INode parent, InsertType insertType) { + public void onCreate(@NonNull INode node, @NonNull INode parent, + @NonNull InsertType insertType) { super.onCreate(node, parent, insertType); if (parent != null) { @@ -57,7 +60,8 @@ public class EditTextRule extends BaseViewRule { * Adds a "Request Focus" menu item. */ @Override - public void addContextMenuActions(List<RuleAction> actions, final INode selectedNode) { + public void addContextMenuActions(@NonNull List<RuleAction> actions, + final @NonNull INode selectedNode) { super.addContextMenuActions(actions, selectedNode); final boolean hasFocus = hasFocus(selectedNode); @@ -65,11 +69,14 @@ public class EditTextRule extends BaseViewRule { IMenuCallback onChange = new IMenuCallback() { @Override - public void action(RuleAction menuAction, List<? extends INode> selectedNodes, - String valueId, Boolean newValue) { + public void action( + @NonNull RuleAction menuAction, + @NonNull List<? extends INode> selectedNodes, + @Nullable String valueId, + @Nullable Boolean newValue) { selectedNode.editXml(label, new INodeHandler() { @Override - public void handle(INode node) { + public void handle(@NonNull INode node) { INode focus = findFocus(findRoot(node)); if (focus != null && focus.getParent() != null) { focus.getParent().removeChild(focus); |