Author: mareshkau
Date: 2008-08-05 11:09:03 -0400 (Tue, 05 Aug 2008)
New Revision: 9521
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/preferences/VpePreference.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java
Log:
JBIDE-2584
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/preferences/VpePreference.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/preferences/VpePreference.java 2008-08-05
15:00:10 UTC (rev 9520)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/preferences/VpePreference.java 2008-08-05
15:09:03 UTC (rev 9521)
@@ -24,7 +24,7 @@
public static String ATT_SOURCE_VISUAL_EDITORS_WEIGHTS = "Source-Visual Editors
Weights";
public static String ATT_SHOW_SELECTION_TAG_BAR = "show selection tag bar";
public static String ATT_ALWAYS_HIDE_SELECTION_BAR_WITHOUT_PROMT="always hide
selection bar without prompt";
-
+ public static String SHOW_COMMENTS_VALUE;
public static String VPE_EDITOR_PATH = "%Options%/Struts Studio/Editors/Visual Page
Editor"; //$NON-NLS-1$
public static final Preference SHOW_COMMENTS = new VpePreference(VPE_EDITOR_PATH,
ATT_SHOW_COMMENTS);
public static final Preference SHOW_BORDER_FOR_UNKNOWN_TAGS = new
VpePreference(VPE_EDITOR_PATH, ATT_SHOW_BORDER_FOR_UNKNOWN_TAGS);
@@ -38,6 +38,9 @@
public static final Preference SHOW_SELECTION_TAG_BAR = new
VpePreference(VPE_EDITOR_PATH,ATT_SHOW_SELECTION_TAG_BAR);
public static final Preference ALWAYS_HIDE_SELECTION_BAR_WITHOUT_PROMT = new
VpePreference(VPE_EDITOR_PATH,ATT_ALWAYS_HIDE_SELECTION_BAR_WITHOUT_PROMT);
+ static {
+ SHOW_COMMENTS_VALUE =SHOW_COMMENTS.getValue();
+ }
protected VpePreference(String optionPath, String attributeName) {
super(optionPath, attributeName);
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java 2008-08-05
15:00:10 UTC (rev 9520)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java 2008-08-05
15:09:03 UTC (rev 9521)
@@ -350,9 +350,11 @@
int offcetReferenceToSourceNode =
focusOffcetInSourceDocument-targetSourceNode.getStartOffset();
int visualNodeOffcet =
TextUtil.visualPosition(((Node)targetSourceNode).getNodeValue(),offcetReferenceToSourceNode);
-
-
selectionController.getSelection(nsISelectionController.SELECTION_NORMAL).collapse(visualNode,
visualNodeOffcet);
-
+
+ if(visualNodeOffcet<visualNode.getNodeValue().length()) {
+
+
selectionController.getSelection(nsISelectionController.SELECTION_NORMAL).collapse(visualNode,
visualNodeOffcet);
+ }
}
}
Show replies by date