diff options
3 files changed, 43 insertions, 20 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/DefaultBeanSymbolSourceProvider.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/DefaultBeanSymbolSourceProvider.java index f5f1ee85f..5984adb04 100644 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/DefaultBeanSymbolSourceProvider.java +++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/symbols/DefaultBeanSymbolSourceProvider.java @@ -226,7 +226,8 @@ public class DefaultBeanSymbolSourceProvider private boolean isBeanScopeInMask(final ManagedBeanScopeType scope, final int scopeMask) { - final int testScope = ISymbolConstants.getMaskForString(scope.getTextContent()); + final int testScope = + scope != null ? ISymbolConstants.getMaskForString(scope.getTextContent()) : -1; if (testScope != -1) { diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/AppConfigValidationUtil.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/AppConfigValidationUtil.java index 90beacbd6..a99dd2aee 100644 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/AppConfigValidationUtil.java +++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/AppConfigValidationUtil.java @@ -236,8 +236,11 @@ public final class AppConfigValidationUtil if (node != null) { - return node.getEndStructuredDocumentRegion().getEndOffset() + if(node.getEndStructuredDocumentRegion() != null) { + return node.getEndStructuredDocumentRegion().getEndOffset() - node.getStartStructuredDocumentRegion().getStartOffset(); + } + return node.getStartStructuredDocumentRegion().getLength(); } return -1; diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/ColorSupport.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/ColorSupport.java index d253dd183..5442a31f9 100644 --- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/ColorSupport.java +++ b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/actions/single/ColorSupport.java @@ -23,24 +23,43 @@ import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement; */ /*package*/ class ColorSupport { static final String[] COLOR_VALUES = new String[] { - PDPlugin.getResourceString("ColorSupport.CommandLabel.Aqua"), //$NON-NLS-1$ - PDPlugin.getResourceString("ColorSupport.CommandLabel.Black"), //$NON-NLS-1$ - PDPlugin.getResourceString("ColorSupport.CommandLabel.Blue"), //$NON-NLS-1$ - PDPlugin.getResourceString("ColorSupport.CommandLabel.Fuchsia"), //$NON-NLS-1$ - PDPlugin.getResourceString("ColorSupport.CommandLabel.Gray"), //$NON-NLS-1$ - PDPlugin.getResourceString("ColorSupport.CommandLabel.Green"), //$NON-NLS-1$ - PDPlugin.getResourceString("ColorSupport.CommandLabel.Lime"), //$NON-NLS-1$ - PDPlugin.getResourceString("ColorSupport.CommandLabel.Maroon"), //$NON-NLS-1$ - PDPlugin.getResourceString("ColorSupport.CommandLabel.Navy"), //$NON-NLS-1$ - PDPlugin.getResourceString("ColorSupport.CommandLabel.Olive"), //$NON-NLS-1$ - PDPlugin.getResourceString("ColorSupport.CommandLabel.Orange"), //$NON-NLS-1$ - PDPlugin.getResourceString("ColorSupport.CommandLabel.Purple"), //$NON-NLS-1$ - PDPlugin.getResourceString("ColorSupport.CommandLabel.Red"), //$NON-NLS-1$ - PDPlugin.getResourceString("ColorSupport.CommandLabel.Silver"), //$NON-NLS-1$ - PDPlugin.getResourceString("ColorSupport.CommandLabel.Teal"), //$NON-NLS-1$ - PDPlugin.getResourceString("ColorSupport.CommandLabel.White"), //$NON-NLS-1$ - PDPlugin.getResourceString("ColorSupport.CommandLabel.Yellow") //$NON-NLS-1$ + "Aqua", //$NON-NLS-1$ + "Black", //$NON-NLS-1$ + "Blue", //$NON-NLS-1$ + "Fuchsia", //$NON-NLS-1$ + "Gray", //$NON-NLS-1$ + "Green", //$NON-NLS-1$ + "Lime", //$NON-NLS-1$ + "Maroon", //$NON-NLS-1$ + "Navy", //$NON-NLS-1$ + "Olive", //$NON-NLS-1$ + "Orange", //$NON-NLS-1$ + "Purple", //$NON-NLS-1$ + "Red", //$NON-NLS-1$ + "Silver", //$NON-NLS-1$ + "Teal", //$NON-NLS-1$ + "White", //$NON-NLS-1$ + "Yellow" //$NON-NLS-1$ }; + static final String[] COLOR_MENU_LABELS = new String[] { + PDPlugin.getResourceString("ColorSupport.CommandLabel.Aqua"), //$NON-NLS-1$ + PDPlugin.getResourceString("ColorSupport.CommandLabel.Black"), //$NON-NLS-1$ + PDPlugin.getResourceString("ColorSupport.CommandLabel.Blue"), //$NON-NLS-1$ + PDPlugin.getResourceString("ColorSupport.CommandLabel.Fuchsia"), //$NON-NLS-1$ + PDPlugin.getResourceString("ColorSupport.CommandLabel.Gray"), //$NON-NLS-1$ + PDPlugin.getResourceString("ColorSupport.CommandLabel.Green"), //$NON-NLS-1$ + PDPlugin.getResourceString("ColorSupport.CommandLabel.Lime"), //$NON-NLS-1$ + PDPlugin.getResourceString("ColorSupport.CommandLabel.Maroon"), //$NON-NLS-1$ + PDPlugin.getResourceString("ColorSupport.CommandLabel.Navy"), //$NON-NLS-1$ + PDPlugin.getResourceString("ColorSupport.CommandLabel.Olive"), //$NON-NLS-1$ + PDPlugin.getResourceString("ColorSupport.CommandLabel.Orange"), //$NON-NLS-1$ + PDPlugin.getResourceString("ColorSupport.CommandLabel.Purple"), //$NON-NLS-1$ + PDPlugin.getResourceString("ColorSupport.CommandLabel.Red"), //$NON-NLS-1$ + PDPlugin.getResourceString("ColorSupport.CommandLabel.Silver"), //$NON-NLS-1$ + PDPlugin.getResourceString("ColorSupport.CommandLabel.Teal"), //$NON-NLS-1$ + PDPlugin.getResourceString("ColorSupport.CommandLabel.White"), //$NON-NLS-1$ + PDPlugin.getResourceString("ColorSupport.CommandLabel.Yellow") //$NON-NLS-1$ +}; /** * @@ -64,7 +83,7 @@ import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement; menu.add(new Separator()); for (int i = 0; i < COLOR_VALUES.length; i++) { ChangeStylePropertyAction action = new ChangeStylePropertyAction( - COLOR_VALUES[i], ele, cssProperty, COLOR_VALUES[i]); + COLOR_MENU_LABELS[i], ele, cssProperty, COLOR_VALUES[i]); if (COLOR_VALUES[i].equalsIgnoreCase(currentValue)) { action.setChecked(true); needAdditional = false; |