JBoss Tools SVN: r17977 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-10-08 09:23:21 -0400 (Thu, 08 Oct 2009)
New Revision: 17977
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4962, Actions' text names were updated.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2009-10-08 13:09:08 UTC (rev 17976)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2009-10-08 13:23:21 UTC (rev 17977)
@@ -214,7 +214,8 @@
/*
* Create OPEN VPE PREFERENCES tool bar item
*/
- openVPEPreferencesAction = new Action("", IAction.AS_PUSH_BUTTON) {
+ openVPEPreferencesAction = new Action(VpeUIMessages.PREFERENCES,
+ IAction.AS_PUSH_BUTTON) {
@Override
public void run() {
VpeEditorPreferencesPage.openPreferenceDialog();
@@ -228,7 +229,8 @@
/*
* Create VPE VISUAL REFRESH tool bar item
*/
- visualRefreshAction = new Action("", IAction.AS_PUSH_BUTTON) {
+ visualRefreshAction = new Action(VpeUIMessages.REFRESH,
+ IAction.AS_PUSH_BUTTON) {
@Override
public void run() {
if (controller != null) {
@@ -259,7 +261,8 @@
}
}
boolean fileExistsInWorkspace = ((file != null) && (file.exists()));
- showResouceDialogAction = new Action("", IAction.AS_PUSH_BUTTON) {
+ showResouceDialogAction = new Action(VpeUIMessages.PAGE_DESIGN_OPTIONS,
+ IAction.AS_PUSH_BUTTON) {
@Override
public void run() {
IEditorInput input = getEditorInput();
@@ -303,7 +306,9 @@
.getDefault().getPreferenceStore().getString(
IVpePreferencesPage.VISUAL_SOURCE_EDITORS_SPLITTING);
currentOrientationIndex = layoutValues.indexOf(newOrientation);
- rotateEditorsAction = new Action("", IAction.AS_PUSH_BUTTON) {
+ rotateEditorsAction = new Action(
+ VpeUIMessages.VISUAL_SOURCE_EDITORS_SPLITTING,
+ IAction.AS_PUSH_BUTTON) {
@Override
public void run() {
/*
@@ -337,7 +342,9 @@
/*
* Create SHOW BORDER FOR UNKNOWN TAGS tool bar item
*/
- showBorderAction = new Action("", IAction.AS_CHECK_BOX) {
+ showBorderAction = new Action(
+ VpeUIMessages.SHOW_BORDER_FOR_UNKNOWN_TAGS,
+ IAction.AS_CHECK_BOX) {
@Override
public void run() {
/*
@@ -358,7 +365,8 @@
/*
* Create SHOW INVISIBLE TAGS tool bar item
*/
- showNonVisualTagsAction = new Action("", IAction.AS_CHECK_BOX) {
+ showNonVisualTagsAction = new Action(
+ VpeUIMessages.SHOW_NON_VISUAL_TAGS, IAction.AS_CHECK_BOX) {
@Override
public void run() {
@@ -381,7 +389,8 @@
/*
* Create SHOW SELECTION BAR tool bar item
*/
- showSelectionBarAction = new Action("", IAction.AS_CHECK_BOX) {
+ showSelectionBarAction = new Action(VpeUIMessages.SHOW_SELECTION_BAR,
+ IAction.AS_CHECK_BOX) {
@Override
public void run() {
/*
@@ -398,7 +407,8 @@
/*
* Create SHOW TEXT FORMATTING tool bar item
*/
- showTextFormattingAction = new Action("", IAction.AS_CHECK_BOX) {
+ showTextFormattingAction = new Action(
+ VpeUIMessages.SHOW_TEXT_FORMATTING, IAction.AS_CHECK_BOX) {
@Override
public void run() {
/*
@@ -415,7 +425,8 @@
/*
* Create SHOW BUNDLE'S MESSAGES AS EL tool bar item
*/
- showBundleAsELAction = new Action("", IAction.AS_CHECK_BOX) {
+ showBundleAsELAction = new Action(VpeUIMessages.SHOW_BUNDLES_AS_EL,
+ IAction.AS_CHECK_BOX) {
@Override
public void run() {
/*
16 years, 6 months
JBoss Tools SVN: r17976 - in trunk/vpe/plugins/org.jboss.tools.vpe: src/org/jboss/tools/vpe/editor and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-10-08 09:09:08 -0400 (Thu, 08 Oct 2009)
New Revision: 17976
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/border.gif
trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/bundle-as-el.gif
trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/non-visusal-tags.gif
trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/selbar.gif
trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/text-formatting.gif
Removed:
trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/bundle-as-el-hide.gif
trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/bundle-as-el-show.gif
trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/non-visusal-tags-hide.gif
trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/non-visusal-tags-show.gif
trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/selbar-hide.gif
trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/selbar-show.gif
trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/text-formatting-hide.gif
trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/text-formatting-show.gif
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAnyCreator.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-4962, ToolBar items were remade: now they correspond to eclipse Actions, their implementation in code became simpler, icons were updated.
Added: trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/border.gif
===================================================================
(Binary files differ)
Property changes on: trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/border.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/bundle-as-el-hide.gif
===================================================================
(Binary files differ)
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/bundle-as-el-show.gif
===================================================================
(Binary files differ)
Added: trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/bundle-as-el.gif
===================================================================
(Binary files differ)
Property changes on: trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/bundle-as-el.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/non-visusal-tags-hide.gif
===================================================================
(Binary files differ)
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/non-visusal-tags-show.gif
===================================================================
(Binary files differ)
Added: trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/non-visusal-tags.gif
===================================================================
(Binary files differ)
Property changes on: trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/non-visusal-tags.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/selbar-hide.gif
===================================================================
(Binary files differ)
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/selbar-show.gif
===================================================================
(Binary files differ)
Added: trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/selbar.gif
===================================================================
(Binary files differ)
Property changes on: trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/selbar.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/text-formatting-hide.gif
===================================================================
(Binary files differ)
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/text-formatting-show.gif
===================================================================
(Binary files differ)
Added: trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/text-formatting.gif
===================================================================
(Binary files differ)
Property changes on: trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/text-formatting.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2009-10-08 13:03:57 UTC (rev 17975)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2009-10-08 13:09:08 UTC (rev 17976)
@@ -1173,6 +1173,17 @@
*/
if (getController() != null) {
boolean doVisualRefresh = false;
+ boolean presfShowBorderForUnknownTags = JspEditorPlugin.getDefault()
+ .getPreferenceStore().getBoolean(
+ IVpePreferencesPage.SHOW_BORDER_FOR_UNKNOWN_TAGS);
+ if (presfShowBorderForUnknownTags != getController().getVisualBuilder().isShowBorderForUnknownTags()) {
+ /*
+ * Templates should be rebuild.
+ */
+ getController().getVisualBuilder().setShowBorderForUnknownTags(presfShowBorderForUnknownTags);
+ doVisualRefresh = true;
+ }
+
boolean presfShowSelectionBar = JspEditorPlugin.getDefault()
.getPreferenceStore().getBoolean(
IVpePreferencesPage.SHOW_SELECTION_TAG_BAR);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2009-10-08 13:03:57 UTC (rev 17975)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2009-10-08 13:09:08 UTC (rev 17976)
@@ -56,6 +56,7 @@
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.template.VpeCreatorUtil;
import org.jboss.tools.vpe.editor.template.VpeDefaultPseudoContentCreator;
+import org.jboss.tools.vpe.editor.template.VpeHtmlTemplate;
import org.jboss.tools.vpe.editor.template.VpeTagDescription;
import org.jboss.tools.vpe.editor.template.VpeTemplate;
import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
@@ -109,6 +110,7 @@
private static final int DRAG_AREA_HEIGHT = 10;
private static final String ATTR_DRAG_AVAILABLE_CLASS = "__drag__available_style"; //$NON-NLS-1$
private static String DOTTED_BORDER = "border: 1px dotted #FF6600; padding: 5px;"; //$NON-NLS-1$
+ private static final String CSS_STYLE_FOR_BORDER_FOR_UNKNOWN_TAGS = ";border: 1px solid green;"; //$NON-NLS-1$
private MozillaEditor visualEditor;
private XulRunnerEditor xulRunnerEditor;
@@ -165,6 +167,7 @@
private Map<IStorage, Document> includeDocuments = new HashMap<IStorage, Document>();
private boolean showInvisibleTags;
+ private boolean showBorderForUnknownTags;
public VpeVisualDomBuilder(VpeDomMapping domMapping,
INodeAdapter sorceAdapter,
@@ -189,7 +192,9 @@
this.showInvisibleTags = JspEditorPlugin.getDefault().getPreferenceStore().getBoolean(
IVpePreferencesPage.SHOW_NON_VISUAL_TAGS);
-
+ this.showBorderForUnknownTags = JspEditorPlugin.getDefault().getPreferenceStore().getBoolean(
+ IVpePreferencesPage.SHOW_BORDER_FOR_UNKNOWN_TAGS);
+
}
public void buildDom(Document sourceDocument) {
@@ -306,6 +311,14 @@
return false;
}
+ /**
+ * Creates border around each tag.
+ *
+ * @param sourceNode the source node
+ * @param visualNode the visual node
+ * @param block show if it is block or inline tag
+ * @return the border element around visual tag
+ */
private nsIDOMElement createBorder(Node sourceNode,
nsIDOMElement visualNode, boolean block) {
nsIDOMElement border = null;
@@ -521,15 +534,20 @@
if (visualNewElement != null) {
correctVisualAttribute(visualNewElement);
}
- if (YES_STRING.equals(VpePreference.SHOW_BORDER_FOR_ALL_TAGS
- .getValue())
- && visualNewElement != null) {
- boolean block = true;
- if (template.getTagDescription(null, null, null,
- visualNewElement, null).getDisplayType() == VpeTagDescription.DISPLAY_TYPE_INLINE) {
- block = false;
- }
- border = createBorder(sourceNode, visualNewElement, block);
+
+ /*
+ * Create border for unknown tags if specified.
+ * Update the style attribute. Usually it's DIV or SPAN with text,
+ * so it's harmless to update the style.
+ * For more complex action #createBorder(..) method should be used.
+ * Also "Create border for all tags" option is never used so it was removed.
+ */
+ if ((template.getType() == VpeHtmlTemplate.TYPE_ANY) && showBorderForUnknownTags) {
+ String style = visualNewElement
+ .getAttribute(VpeStyleUtil.ATTRIBUTE_STYLE);
+ style += CSS_STYLE_FOR_BORDER_FOR_UNKNOWN_TAGS;
+ visualNewElement.setAttribute(VpeStyleUtil.ATTRIBUTE_STYLE, style);
+
}
if (!isCurrentMainDocument() && visualNewElement != null) {
setReadOnlyElement(visualNewElement);
@@ -2285,6 +2303,14 @@
this.showInvisibleTags = showInvisibleTags;
}
+ public boolean isShowBorderForUnknownTags() {
+ return showBorderForUnknownTags;
+ }
+
+ public void setShowBorderForUnknownTags(boolean showBorderForUnknownTags) {
+ this.showBorderForUnknownTags = showBorderForUnknownTags;
+ }
+
/**
*
* @param sourceNode
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2009-10-08 13:03:57 UTC (rev 17975)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2009-10-08 13:09:08 UTC (rev 17976)
@@ -27,6 +27,9 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.ProgressEvent;
@@ -41,9 +44,7 @@
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
@@ -105,14 +106,11 @@
public static final String ICON_ORIENTATION_VISUAL_LEFT = "icons/visual_left.gif"; //$NON-NLS-1$
public static final String ICON_ORIENTATION_VISUAI_TOP = "icons/visual_top.gif"; //$NON-NLS-1$
public static final String ICON_ORIENTATION_SOURCE_LEFT_DISABLED = "icons/source_left_disabled.gif"; //$NON-NLS-1$
- public static final String ICON_NON_VISUAL_TAGS_SHOW = "icons/non-visusal-tags-show.gif"; //$NON-NLS-1$
- public static final String ICON_NON_VISUAL_TAGS_HIDE = "icons/non-visusal-tags-hide.gif"; //$NON-NLS-1$
- public static final String ICON_SELECTION_BAR_SHOW = "icons/selbar-show.gif"; //$NON-NLS-1$
- public static final String ICON_SELECTION_BAR_HIDE = "icons/selbar-hide.gif"; //$NON-NLS-1$
- public static final String ICON_TEXT_FORMATTING_SHOW = "icons/text-formatting-show.gif"; //$NON-NLS-1$
- public static final String ICON_TEXT_FORMATTING_HIDE = "icons/text-formatting-hide.gif"; //$NON-NLS-1$
- public static final String ICON_BUNDLE_AS_EL_SHOW = "icons/bundle-as-el-show.gif"; //$NON-NLS-1$
- public static final String ICON_BUNDLE_AS_EL_HIDE = "icons/bundle-as-el-hide.gif"; //$NON-NLS-1$
+ public static final String ICON_SHOW_BORDER_FOR_UNKNOWN_TAGS = "icons/border.gif"; //$NON-NLS-1$
+ public static final String ICON_NON_VISUAL_TAGS = "icons/non-visusal-tags.gif"; //$NON-NLS-1$
+ public static final String ICON_SELECTION_BAR = "icons/selbar.gif"; //$NON-NLS-1$
+ public static final String ICON_TEXT_FORMATTING = "icons/text-formatting.gif"; //$NON-NLS-1$
+ public static final String ICON_BUNDLE_AS_EL= "icons/bundle-as-el.gif"; //$NON-NLS-1$
static String SELECT_BAR = "SELECT_LBAR"; //$NON-NLS-1$
private XulRunnerEditor xulRunnerEditor;
@@ -134,15 +132,15 @@
private static Map<String, String> layoutNames;
private static List<String> layoutValues;
private int currentOrientationIndex = 1;
- private ToolItem rotateEditorsItem;
- private ToolItem showNonVisualTagsItem;
- private ToolItem showSelectionBarItem;
- private ToolItem showBundlesAsELItem;
- private ToolItem showTextFormattingItem;
- private boolean showNonVisualTags = false;
- private boolean showSelectionBar = true;
- private boolean showTextFormatting = true;
- private boolean showBundlesAsEL = false;
+ private Action openVPEPreferencesAction;
+ private Action visualRefreshAction;
+ private Action showResouceDialogAction;
+ private Action rotateEditorsAction;
+ private Action showBorderAction;
+ private Action showNonVisualTagsAction;
+ private Action showSelectionBarAction;
+ private Action showTextFormattingAction;
+ private Action showBundleAsELAction;
static {
/*
@@ -210,29 +208,42 @@
}
public ToolBar createVisualToolbar(Composite parent) {
- verBar = new ToolBar(parent, SWT.VERTICAL|SWT.FLAT);
- verBar.setLayoutData(new GridData(GridData.FILL_VERTICAL));
+ ToolBarManager toolBarManager = new ToolBarManager(SWT.VERTICAL | SWT.FLAT);
+ verBar = toolBarManager.createControl(parent);
- ToolItem item = null;
- item = createToolItem(verBar, SWT.BUTTON1, ICON_PREFERENCE,
- ICON_PREFERENCE_DISABLED, VpeUIMessages.PREFERENCES, true);
- item.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
+ /*
+ * Create OPEN VPE PREFERENCES tool bar item
+ */
+ openVPEPreferencesAction = new Action("", IAction.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
VpeEditorPreferencesPage.openPreferenceDialog();
}
- });
-
- item = createToolItem(verBar, SWT.BUTTON1, ICON_REFRESH,
- ICON_REFRESH_DISABLED, VpeUIMessages.REFRESH, true);
- item.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
- if(controller!=null) {
+ };
+ openVPEPreferencesAction.setImageDescriptor(ImageDescriptor.createFromFile(MozillaEditor.class,
+ ICON_PREFERENCE));
+ openVPEPreferencesAction.setToolTipText(VpeUIMessages.PREFERENCES);
+ toolBarManager.add(openVPEPreferencesAction);
+
+ /*
+ * Create VPE VISUAL REFRESH tool bar item
+ */
+ visualRefreshAction = new Action("", IAction.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ if (controller != null) {
controller.visualRefresh();
}
}
- });
+ };
+ visualRefreshAction.setImageDescriptor(ImageDescriptor.createFromFile(MozillaEditor.class,
+ ICON_REFRESH));
+ visualRefreshAction.setToolTipText(VpeUIMessages.REFRESH);
+ toolBarManager.add(visualRefreshAction);
/*
+ * Create SHOW RESOURCE DIALOG tool bar item
+ *
* https://jira.jboss.org/jira/browse/JBIDE-3966
* Disabling Page Design Options for external files.
*/
@@ -248,11 +259,9 @@
}
}
boolean fileExistsInWorkspace = ((file != null) && (file.exists()));
- item = createToolItem(verBar, SWT.BUTTON1, ICON_PAGE_DESIGN_OPTIONS,
- ICON_PAGE_DESIGN_OPTIONS_DISABLED,
- VpeUIMessages.PAGE_DESIGN_OPTIONS, fileExistsInWorkspace);
- item.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
+ showResouceDialogAction = new Action("", IAction.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
IEditorInput input = getEditorInput();
Object fileLocation = null;
if (input instanceof IFileEditorInput) {
@@ -274,29 +283,156 @@
VpePlugin.getDefault().logError("Could not open Vpe Resources Dialog."); //$NON-NLS-1$
}
}
- });
-
+ };
+ showResouceDialogAction.setImageDescriptor(ImageDescriptor.createFromFile(MozillaEditor.class,
+ fileExistsInWorkspace ? ICON_PAGE_DESIGN_OPTIONS : ICON_PAGE_DESIGN_OPTIONS_DISABLED));
+ if (!fileExistsInWorkspace) {
+ showResouceDialogAction.setEnabled(false);
+ }
+ showResouceDialogAction.setToolTipText(VpeUIMessages.PAGE_DESIGN_OPTIONS);
+ toolBarManager.add(showResouceDialogAction);
+
+
/*
- * Create ROTATE EDITORS tool bar icon
+ * Create ROTATE EDITORS tool bar item
+ *
+ * https://jira.jboss.org/jira/browse/JBIDE-4152
+ * Compute initial icon state and add it to the tool bar.
*/
- createRotateEditorsItem(verBar);
+ String newOrientation = JspEditorPlugin
+ .getDefault().getPreferenceStore().getString(
+ IVpePreferencesPage.VISUAL_SOURCE_EDITORS_SPLITTING);
+ currentOrientationIndex = layoutValues.indexOf(newOrientation);
+ rotateEditorsAction = new Action("", IAction.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ /*
+ * Rotate editors orientation clockwise.
+ */
+ currentOrientationIndex++;
+ if (currentOrientationIndex >= layoutValues.size()) {
+ currentOrientationIndex = currentOrientationIndex % layoutValues.size();
+ }
+ String newOrientation = layoutValues.get(currentOrientationIndex);
+ /*
+ * Update icon and tooltip
+ */
+ this.setImageDescriptor(ImageDescriptor.createFromFile(
+ MozillaEditor.class, layoutIcons.get(newOrientation)));
+
+ this.setToolTipText(layoutNames.get(newOrientation));
+ /*
+ * Call <code>filContainer()</code> from VpeEditorPart
+ * to redraw CustomSashForm with new layout.
+ */
+ getController().getPageContext().getEditPart().fillContainer(true, newOrientation);
+
+ }
+ };
+ rotateEditorsAction.setImageDescriptor(ImageDescriptor.createFromFile(MozillaEditor.class,
+ layoutIcons.get(newOrientation)));
+ rotateEditorsAction.setToolTipText(layoutNames.get(newOrientation));
+ toolBarManager.add(rotateEditorsAction);
/*
- * Create SHOW INVISIBLE TAGS tool bar icon
+ * Create SHOW BORDER FOR UNKNOWN TAGS tool bar item
*/
- createShowNonVisualTagsItem(verBar);
-
+ showBorderAction = new Action("", IAction.AS_CHECK_BOX) {
+ @Override
+ public void run() {
+ /*
+ * Set new value to VpeVisualDomBuilder.
+ */
+ getController().getVisualBuilder().setShowBorderForUnknownTags(this.isChecked());
+ /*
+ * Update VPE
+ */
+ controller.visualRefresh();
+ }
+ };
+ showBorderAction.setImageDescriptor(ImageDescriptor.createFromFile(MozillaEditor.class,
+ ICON_SHOW_BORDER_FOR_UNKNOWN_TAGS));
+ showBorderAction.setToolTipText(VpeUIMessages.SHOW_BORDER_FOR_UNKNOWN_TAGS);
+ toolBarManager.add(showBorderAction);
+
/*
- * Create SHOW SELECTION BAR tool bar icon
+ * Create SHOW INVISIBLE TAGS tool bar item
*/
- createShowSelectionBarItem(verBar);
+ showNonVisualTagsAction = new Action("", IAction.AS_CHECK_BOX) {
+ @Override
+ public void run() {
+
+ /*
+ * Change flag
+ */
+ controller.getVisualBuilder().setShowInvisibleTags(
+ this.isChecked());
+ /*
+ * Update VPE
+ */
+ controller.visualRefresh();
+ }
+ };
+ showNonVisualTagsAction.setImageDescriptor(ImageDescriptor.createFromFile(MozillaEditor.class,
+ ICON_NON_VISUAL_TAGS));
+ showNonVisualTagsAction.setToolTipText(VpeUIMessages.SHOW_NON_VISUAL_TAGS);
+ toolBarManager.add(showNonVisualTagsAction);
/*
- * Create SHOW BUNDLE'S MESSAGES AS EL tool bar icon
+ * Create SHOW SELECTION BAR tool bar item
*/
- createShowBundlesAsELItem(verBar);
-
- verBar.pack();
+ showSelectionBarAction = new Action("", IAction.AS_CHECK_BOX) {
+ @Override
+ public void run() {
+ /*
+ * Update Selection Bar
+ */
+ controller.getPageContext().getEditPart().updateSelectionBar(this.isChecked());
+ }
+ };
+ showSelectionBarAction.setImageDescriptor(ImageDescriptor.createFromFile(MozillaEditor.class,
+ ICON_SELECTION_BAR));
+ showSelectionBarAction.setToolTipText(VpeUIMessages.SHOW_SELECTION_BAR);
+ toolBarManager.add(showSelectionBarAction);
+
+ /*
+ * Create SHOW TEXT FORMATTING tool bar item
+ */
+ showTextFormattingAction = new Action("", IAction.AS_CHECK_BOX) {
+ @Override
+ public void run() {
+ /*
+ * Update Text Formatting Bar
+ */
+ vpeToolBarManager.setToolbarVisibility(this.isChecked());
+ }
+ };
+ showTextFormattingAction.setImageDescriptor(ImageDescriptor.createFromFile(MozillaEditor.class,
+ ICON_TEXT_FORMATTING));
+ showTextFormattingAction.setToolTipText(VpeUIMessages.SHOW_TEXT_FORMATTING);
+ toolBarManager.add(showTextFormattingAction);
+
+ /*
+ * Create SHOW BUNDLE'S MESSAGES AS EL tool bar item
+ */
+ showBundleAsELAction = new Action("", IAction.AS_CHECK_BOX) {
+ @Override
+ public void run() {
+ /*
+ * Update bundle messages.
+ */
+ controller.getPageContext().getBundle().updateShowBundleUsageAsEL(this.isChecked());
+ controller.visualRefresh();
+ }
+ };
+ showBundleAsELAction.setImageDescriptor(ImageDescriptor.createFromFile(MozillaEditor.class,
+ ICON_BUNDLE_AS_EL));
+ showBundleAsELAction.setToolTipText(VpeUIMessages.SHOW_BUNDLES_AS_EL);
+ toolBarManager.add(showBundleAsELAction);
+
+ updateToolbarItemsAccordingToPreferences();
+ toolBarManager.update(true);
+
return verBar;
}
@@ -350,11 +486,6 @@
if (vpeToolBarManager != null) {
vpeToolBarManager.createToolBarComposite(cmpEdTl);
vpeToolBarManager.addToolBar(new TextFormattingToolBar(formatControllerManager));
-
- /*
- * Create SHOW TEXT FORMATTING tool bar icon
- */
- createShowTextFormattingItem(verBar);
}
}
@@ -550,28 +681,6 @@
});
}
- private ToolItem createToolItem(ToolBar parent, int type, String image, String disabledImage,
- String toolTipText, boolean isEnabled) {
-
- ToolItem item = new ToolItem(parent, type);
- item.setImage(ImageDescriptor
- .createFromFile(MozillaEditor.class, image).createImage());
- item.setToolTipText(toolTipText);
- if(disabledImage.length()!=0) {
- item.setDisabledImage(ImageDescriptor
- .createFromFile(MozillaEditor.class, disabledImage).createImage());
- }
- item.setEnabled(isEnabled);
- // add dispose listener
- item.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- // dispose tollitem's image
- ((ToolItem) e.widget).getImage().dispose();
- }
- });
- return item;
- }
-
public void setFocus() {
if(xulRunnerEditor!=null) {
xulRunnerEditor.setFocus();
@@ -633,7 +742,6 @@
* @return
*/
protected void setContentArea(nsIDOMElement element) {
-
this.contentArea=element;
}
@@ -846,7 +954,6 @@
*/
public MozillaDomEventListener getContentAreaEventListener() {
if(contentAreaEventListener==null) {
-
contentAreaEventListener = new MozillaDomEventListener();
}
return contentAreaEventListener;
@@ -861,7 +968,6 @@
this.contentAreaEventListener = contentAreaEventListener;
}
-
/**
*
*/
@@ -948,240 +1054,44 @@
public VpeDropDownMenu getDropDownMenu() {
return dropDownMenu;
}
-
- private void createShowNonVisualTagsItem(ToolBar parent) {
- showNonVisualTags = JspEditorPlugin.getDefault().getPreferenceStore().getBoolean(
- IVpePreferencesPage.SHOW_NON_VISUAL_TAGS);
- showNonVisualTagsItem = createToolItem(parent, SWT.BUTTON1,
- showNonVisualTags ? ICON_NON_VISUAL_TAGS_SHOW
- : ICON_NON_VISUAL_TAGS_HIDE, "", //$NON-NLS-1$
- showNonVisualTags ? VpeUIMessages.SHOW_NON_VISUAL_TAGS
- : VpeUIMessages.HIDE_NON_VISUAL_TAGS, true);
- showNonVisualTagsItem.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
- /*
- * Switch the value
- */
- showNonVisualTags = !showNonVisualTags;
-
- /*
- * Update icon and tooltip
- */
- updateShowNonVisualTagsItem(showNonVisualTags);
- /*
- * Change flag
- */
- controller.getVisualBuilder().setShowInvisibleTags(
- showNonVisualTags);
- /*
- * Update VPE
- */
- controller.visualRefresh();
- }
- });
- }
-
- private void updateShowNonVisualTagsItem(boolean showInvisibleTags) {
- showNonVisualTagsItem.setImage(ImageDescriptor.createFromFile(
- MozillaEditor.class,
- showInvisibleTags ? ICON_NON_VISUAL_TAGS_SHOW
- : ICON_NON_VISUAL_TAGS_HIDE).createImage());
- showNonVisualTagsItem.setToolTipText(showInvisibleTags ? VpeUIMessages.SHOW_NON_VISUAL_TAGS
- : VpeUIMessages.HIDE_NON_VISUAL_TAGS);
- }
-
- private void createShowSelectionBarItem(ToolBar parent) {
- showSelectionBar = JspEditorPlugin.getDefault().getPreferenceStore().getBoolean(
- IVpePreferencesPage.SHOW_SELECTION_TAG_BAR);
- showSelectionBarItem = createToolItem(parent, SWT.BUTTON1,
- showSelectionBar ? ICON_SELECTION_BAR_SHOW
- : ICON_SELECTION_BAR_HIDE, "", //$NON-NLS-1$
- showSelectionBar ? VpeUIMessages.SHOW_SELECTION_BAR
- : VpeUIMessages.HIDE_SELECTION_BAR, true);
- showSelectionBarItem.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
- /*
- * Switch the value
- */
- showSelectionBar = !showSelectionBar;
- /*
- * Update icon and tooltip
- */
- updateShowSelectionBarItem(showSelectionBar);
-
- /*
- * Update Selection Bar
- */
- controller.getPageContext().getEditPart().updateSelectionBar(showSelectionBar);
- }
- });
- }
-
- private void updateShowSelectionBarItem(boolean showSelectionBar) {
- showSelectionBarItem.setImage(ImageDescriptor.createFromFile(
- MozillaEditor.class,
- showSelectionBar ? ICON_SELECTION_BAR_SHOW
- : ICON_SELECTION_BAR_HIDE).createImage());
- showSelectionBarItem
- .setToolTipText(showSelectionBar ? VpeUIMessages.SHOW_SELECTION_BAR
- : VpeUIMessages.HIDE_SELECTION_BAR);
- }
-
- private void createShowBundlesAsELItem(ToolBar parent) {
- showBundlesAsEL = JspEditorPlugin.getDefault().getPreferenceStore().getBoolean(
- IVpePreferencesPage.SHOW_RESOURCE_BUNDLES_USAGE_AS_EL);
- showBundlesAsELItem = createToolItem(parent, SWT.BUTTON1,
- showBundlesAsEL ? ICON_BUNDLE_AS_EL_SHOW
- : ICON_BUNDLE_AS_EL_HIDE, "", //$NON-NLS-1$
- showBundlesAsEL ? VpeUIMessages.SHOW_BUNDLES_AS_EL
- : VpeUIMessages.SHOW_BUNDLES_AS_MESSAGES, true);
- showBundlesAsELItem.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
- /*
- * Switch the value
- */
- showBundlesAsEL = !showBundlesAsEL;
- /*
- * Update icon and tooltip
- */
- updateShowBundlesAsELItem(showBundlesAsEL);
-
- /*
- * Update bundle messages.
- */
- controller.getPageContext().getBundle().updateShowBundleUsageAsEL(showBundlesAsEL);
- controller.visualRefresh();
- }
- });
- }
-
- private void updateShowBundlesAsELItem(boolean showBundlesAsEL) {
- showBundlesAsELItem.setImage(ImageDescriptor.createFromFile(
- MozillaEditor.class,
- showBundlesAsEL ? ICON_BUNDLE_AS_EL_SHOW
- : ICON_BUNDLE_AS_EL_HIDE).createImage());
- showBundlesAsELItem
- .setToolTipText(showBundlesAsEL ? VpeUIMessages.SHOW_BUNDLES_AS_EL
- : VpeUIMessages.SHOW_BUNDLES_AS_MESSAGES);
- }
-
- private void createShowTextFormattingItem(ToolBar parent) {
- showTextFormatting = JspEditorPlugin.getDefault().getPreferenceStore().getBoolean(
- IVpePreferencesPage.SHOW_TEXT_FORMATTING);
- showTextFormattingItem = createToolItem(parent,
- SWT.BUTTON1,
- showTextFormatting ? ICON_TEXT_FORMATTING_SHOW
- : ICON_TEXT_FORMATTING_HIDE, "", //$NON-NLS-1$
- showTextFormatting ? VpeUIMessages.SHOW_TEXT_FORMATTING
- : VpeUIMessages.HIDE_TEXT_FORMATTING, true);
- showTextFormattingItem.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
- /*
- * Switch the value
- */
- showTextFormatting = !showTextFormatting;
-
- /*
- * Update icon and tooltip
- */
- updateShowTextFormattingItem(showTextFormatting);
-
- /*
- * Update Text Formatting Bar
- */
- vpeToolBarManager.setToolbarVisibility(showTextFormatting);
- }
- });
- }
-
- private void updateShowTextFormattingItem(boolean showTextFormatting) {
- showTextFormattingItem.setImage(ImageDescriptor.createFromFile(
- MozillaEditor.class,
- showTextFormatting ? ICON_TEXT_FORMATTING_SHOW
- : ICON_TEXT_FORMATTING_HIDE).createImage());
- showTextFormattingItem
- .setToolTipText(showTextFormatting ? VpeUIMessages.SHOW_TEXT_FORMATTING
- : VpeUIMessages.HIDE_TEXT_FORMATTING);
- }
-
- private void createRotateEditorsItem(ToolBar parent) {
- /*
- * https://jira.jboss.org/jira/browse/JBIDE-4152
- * Compute initial icon state and add it to the tool bar.
- */
- String newOrientation = JspEditorPlugin
- .getDefault().getPreferenceStore().getString(
- IVpePreferencesPage.VISUAL_SOURCE_EDITORS_SPLITTING);
- currentOrientationIndex = layoutValues.indexOf(newOrientation);
- rotateEditorsItem = createToolItem(parent, SWT.BUTTON1,
- layoutIcons.get(newOrientation),
- ICON_ORIENTATION_SOURCE_LEFT_DISABLED,
- layoutNames.get(newOrientation), true);
-
- rotateEditorsItem.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
- /*
- * Rotate editors orientation clockwise.
- */
- currentOrientationIndex++;
- if (currentOrientationIndex >= layoutValues.size()) {
- currentOrientationIndex = currentOrientationIndex % layoutValues.size();
- }
- String newOrientation = layoutValues.get(currentOrientationIndex);
- /*
- * Update icon and tooltip
- */
- updateRotateEditorsItem(newOrientation);
- /*
- * Call <code>filContainer()</code> from VpeEditorPart
- * to redraw CustomSashForm with new layout.
- */
- getController().getPageContext().getEditPart().fillContainer(true, newOrientation);
- }
- });
- }
-
- private void updateRotateEditorsItem(String newOrientation) {
- rotateEditorsItem.setImage(ImageDescriptor.createFromFile(
- MozillaEditor.class, layoutIcons.get(newOrientation))
- .createImage());
- rotateEditorsItem.setToolTipText(layoutNames.get(newOrientation));
- }
public void updateToolbarItemsAccordingToPreferences() {
String prefsOrientation = JspEditorPlugin
.getDefault().getPreferenceStore().getString(
IVpePreferencesPage.VISUAL_SOURCE_EDITORS_SPLITTING);
int prefsOrientationIndex = layoutValues.indexOf(prefsOrientation);
+
+ boolean prefsShowBorderForUnknownTags = JspEditorPlugin.getDefault().getPreferenceStore()
+ .getBoolean(IVpePreferencesPage.SHOW_BORDER_FOR_UNKNOWN_TAGS);
boolean prefsShowNonVisualTags = JspEditorPlugin.getDefault().getPreferenceStore()
.getBoolean(IVpePreferencesPage.SHOW_NON_VISUAL_TAGS);
boolean prefsShowSelectionBar = JspEditorPlugin.getDefault().getPreferenceStore()
.getBoolean(IVpePreferencesPage.SHOW_SELECTION_TAG_BAR);
- boolean prefsShowBundlesAsEL = JspEditorPlugin.getDefault().getPreferenceStore()
- .getBoolean(
- IVpePreferencesPage.SHOW_RESOURCE_BUNDLES_USAGE_AS_EL);
boolean prefsShowTextFormatting = JspEditorPlugin.getDefault().getPreferenceStore()
.getBoolean(IVpePreferencesPage.SHOW_TEXT_FORMATTING);
+ boolean prefsShowBundlesAsEL = JspEditorPlugin.getDefault().getPreferenceStore()
+ .getBoolean(IVpePreferencesPage.SHOW_RESOURCE_BUNDLES_USAGE_AS_EL);
- if (currentOrientationIndex != prefsOrientationIndex) {
- currentOrientationIndex = prefsOrientationIndex;
- updateRotateEditorsItem(prefsOrientation);
+ if (showBorderAction != null) {
+ showBorderAction.setChecked(prefsShowBorderForUnknownTags);
}
- if (showNonVisualTags != prefsShowNonVisualTags) {
- showNonVisualTags = prefsShowNonVisualTags;
- updateShowNonVisualTagsItem(showNonVisualTags);
+ if (showNonVisualTagsAction != null) {
+ showNonVisualTagsAction.setChecked(prefsShowNonVisualTags);
}
- if (showSelectionBar != prefsShowSelectionBar) {
- showSelectionBar = prefsShowSelectionBar;
- updateShowSelectionBarItem(showSelectionBar);
+ if (showSelectionBarAction != null) {
+ showSelectionBarAction.setChecked(prefsShowSelectionBar);
}
- if (showBundlesAsEL != prefsShowBundlesAsEL) {
- showBundlesAsEL = prefsShowBundlesAsEL;
- updateShowBundlesAsELItem(showBundlesAsEL);
+ if (showTextFormattingAction != null) {
+ showTextFormattingAction.setChecked(prefsShowTextFormatting);
}
- if (showTextFormatting != prefsShowTextFormatting) {
- showTextFormatting = prefsShowTextFormatting;
- updateShowTextFormattingItem(showTextFormatting);
+ if (showBundleAsELAction != null) {
+ showBundleAsELAction.setChecked(prefsShowBundlesAsEL);
}
+ if (rotateEditorsAction != null) {
+ currentOrientationIndex = prefsOrientationIndex;
+ rotateEditorsAction.setImageDescriptor(ImageDescriptor.createFromFile(
+ MozillaEditor.class, layoutIcons.get(prefsOrientation)));
+ rotateEditorsAction.setToolTipText(layoutNames.get(prefsOrientation));
+ }
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAnyCreator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAnyCreator.java 2009-10-08 13:03:57 UTC (rev 17975)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAnyCreator.java 2009-10-08 13:09:08 UTC (rev 17976)
@@ -180,12 +180,18 @@
anyElement.setAttribute(HTML.ATTR_CLASS, CLASS_TAG_CAPTION);
String styleString = getExprValue(pageContext, styleExpr, sourceNode);
+
+ /*
+ * https://jira.jboss.org/jira/browse/JBIDE-4962
+ * Border will be read from VpeVisualDomBuilder.showBorderForUnknownTags
+ * during template creation along with showInvisibleTags option.
+ *
+ */
+// if (JspEditorPlugin.getDefault().getPreferenceStore().getBoolean(
+// IVpePreferencesPage.SHOW_BORDER_FOR_UNKNOWN_TAGS)) {
+// styleString = "border: 1px solid green;" +styleString; //$NON-NLS-1$
+// }
- if (JspEditorPlugin.getDefault().getPreferenceStore().getBoolean(
- IVpePreferencesPage.SHOW_BORDER_FOR_UNKNOWN_TAGS)) {
- styleString = "border: 1px solid green;" +styleString; //$NON-NLS-1$
- }
-
anyElement.setAttribute(HTML.ATTR_STYLE, styleString);
if (propertyCreators != null) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2009-10-08 13:03:57 UTC (rev 17975)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2009-10-08 13:09:08 UTC (rev 17976)
@@ -101,7 +101,7 @@
SHOW_TEXT_FORMATTING = Show text formatting bar
HIDE_TEXT_FORMATTING = Hide text formatting bar
SHOW_RESOURCE_BUNDLES_USAGE_AS_EL=Show resource bundles usage as EL expressions
-SHOW_BUNDLES_AS_EL=Show bundle's messages as EL
+SHOW_BUNDLES_AS_EL=Show bundle's messages as EL expressions
SHOW_BUNDLES_AS_MESSAGES=Show bundle's messages explicitly
ASK_TAG_ATTRIBUTES_ON_TAG_INSERT=Ask for tag attributes during tag insert
ASK_CONFIRMATION_ON_CLOSING_SELECTION_BAR=Ask for confirmation when closing Selection Bar
16 years, 6 months
JBoss Tools SVN: r17974 - in trunk: common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-10-08 08:47:30 -0400 (Thu, 08 Oct 2009)
New Revision: 17974
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/RefactorSearcher.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegmentImpl.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamELReferencesQueryParticipant.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4771
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/RefactorSearcher.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/RefactorSearcher.java 2009-10-08 12:39:31 UTC (rev 17973)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/RefactorSearcher.java 2009-10-08 12:47:30 UTC (rev 17974)
@@ -24,7 +24,6 @@
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.internal.ui.text.FastJavaPartitionScanner;
import org.eclipse.jdt.ui.text.IJavaPartitions;
@@ -60,7 +59,6 @@
import org.jboss.tools.common.el.core.resolver.JavaMemberELSegment;
import org.jboss.tools.common.el.core.resolver.SimpleELContext;
import org.jboss.tools.common.el.core.resolver.Var;
-import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.util.FileUtil;
import org.w3c.dom.Node;
@@ -282,8 +280,8 @@
for(ELInvocationExpression ie : instance.getExpression().getInvocations()){
ELInvocationExpression expression = findComponentReference(ie);
if(expression != null){
- ELInvocationExpression left = expression.getLeft();
- checkMatch(file, left, offset+getOffset(left), offset+getOffset(expression), getLength(expression));
+ //ELInvocationExpression left = expression.getLeft();
+ checkMatch(file, expression, getOffset(expression), offset+getOffset(expression), getLength(expression));
}
}
}
@@ -424,7 +422,7 @@
return false;
}
- private void resolve(IFile file, ELExpression operand, int leftOffset,
+ private void resolve(IFile file, ELExpression operand, int localOffset,
int offset, int length) {
ELResolver[] resolvers = ELResolverFactoryManager.getInstance()
.getResolvers(file);
@@ -438,28 +436,23 @@
context.setResource(file);
context.setElResolvers(resolvers);
- List<Var> vars = ElVarSearcher.findAllVars(context, leftOffset,
+ List<Var> vars = ElVarSearcher.findAllVars(context, localOffset,
resolver);
context.setVars(vars);
ELResolution resolution = resolver.resolve(context, operand);
- ELSegment segment = resolution.findSegmentByOffset(leftOffset);
+ ELSegment segment = resolution.findSegmentByOffset(localOffset);
if (segment != null && segment instanceof JavaMemberELSegment
&& segment.isResolved()) {
JavaMemberELSegment javaSegment = (JavaMemberELSegment) segment;
IJavaElement segmentJavaElement = javaSegment.getJavaElement();
- if (javaElement instanceof IType
- && segmentJavaElement instanceof IType) {
- if (EclipseJavaUtil.isDerivedClass(
- ((IType) javaElement).getFullyQualifiedName(),
- ((IType) segmentJavaElement).getFullyQualifiedName(),
- file.getProject()))
- match(file, offset, length, true);
- } else if (javaElement.equals(segmentJavaElement))
+ if (javaElement.equals(segmentJavaElement)){
match(file, offset, length, true);
+ return;
+ }
}
}
match(file, offset, length, false);
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegmentImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegmentImpl.java 2009-10-08 12:39:31 UTC (rev 17973)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegmentImpl.java 2009-10-08 12:47:30 UTC (rev 17974)
@@ -39,6 +39,16 @@
* @see org.jboss.tools.common.el.core.resolver.ELSegment#getSourceReference()
*/
public ITextSourceReference getSourceReference() {
+ if(sourceReference==null) {
+ sourceReference = new ITextSourceReference() {
+ public int getStartPosition() {
+ return token.getStart();
+ }
+ public int getLength() {
+ return token.getLength();
+ }
+ };
+ }
return sourceReference;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamELReferencesQueryParticipant.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamELReferencesQueryParticipant.java 2009-10-08 12:39:31 UTC (rev 17973)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamELReferencesQueryParticipant.java 2009-10-08 12:47:30 UTC (rev 17974)
@@ -187,8 +187,13 @@
@Override
protected void match(IFile file, int offset, int length, boolean resolved) {
- Match match = new Match(new FileWrapper(file, resolved), offset, length);
- requestor.reportMatch(match);
+ if(resolved){
+ Match match = new Match(file, offset, length);
+ requestor.reportMatch(match);
+ }else{
+ Match match = new Match(new FileWrapper(file, resolved), offset, length);
+ requestor.reportMatch(match);
+ }
}
protected ELInvocationExpression findComponentReference(ELInvocationExpression invocationExpression){
16 years, 6 months
JBoss Tools SVN: r17972 - trunk/jsf/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-10-08 07:53:01 -0400 (Thu, 08 Oct 2009)
New Revision: 17972
Modified:
trunk/jsf/docs/userguide/en/modules/preferences.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-878 - updating the chapter according to the changes made in the VPE Preferences page;
Modified: trunk/jsf/docs/userguide/en/modules/preferences.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/preferences.xml 2009-10-08 11:44:51 UTC (rev 17971)
+++ trunk/jsf/docs/userguide/en/modules/preferences.xml 2009-10-08 11:53:01 UTC (rev 17972)
@@ -384,62 +384,68 @@
<tbody>
<row>
- <entry>Show Border for Unknown Tags</entry>
+ <entry>Show border for unknown tags</entry>
<entry>The option allows to place the border around unknown tags or undo
this</entry>
<entry>On</entry>
</row>
<row>
- <entry>Show Non-Visual Tags</entry>
+ <entry>Show non-visual tags</entry>
<entry>Check this box, if you want the editor shows non-visual elements on
the page you're editing</entry>
<entry>Off</entry>
</row>
+ <row>
+ <entry>Show selection tag bar</entry>
+ <entry>The option allows to show/hide the Selection Bar</entry>
+ <entry>On</entry>
+ </row>
+
+ <row>
+ <entry>Show text formatting bar</entry>
+ <entry>Check this box in order to show/hide the Text Formatting bar</entry>
+ <entry>On</entry>
+ </row>
+
<row>
- <entry>Show Resource Bundles Usage as EL Expressions </entry>
+ <entry>Show resource bundles usage as EL expressions</entry>
<entry>If the option is checked, the editor will show EL expressions instead
of the resource values</entry>
<entry>Off</entry>
</row>
<row>
- <entry>Always Prompts for Tag Attributes During Tag Insert </entry>
+ <entry>Ask for tag attributes during tag insert </entry>
<entry>Having this option off, the dialog with possible attributes for
- inserting tag won't appear if all its attributes are optional</entry>
+ inserting tag won't appear if all its attributes are optional</entry>
<entry>On</entry>
</row>
-
+
<row>
- <entry>Show Selection Tag Bar</entry>
- <entry>This option allows to show or hide the Selection Bar</entry>
- <entry>On</entry>
- </row>
-
- <row>
- <entry>Always Hide Selection Bar Without Prompt</entry>
+ <entry>Ask for confirmation when closing the Selection Bar</entry>
<entry>Check this box if you don't want the confirmation window
appears when closing the Selection Bar</entry>
- <entry>Off</entry>
+ <entry>On</entry>
</row>
<row>
- <entry>Default Editor Tab</entry>
- <entry>The option provides with a possibility to choose one of the following
+ <entry>Select the default active editor's tab</entry>
+ <entry>The option provides possibility to choose one of the following
views - Visual/Source, Source or Preview, as default when opening the
editor</entry>
<entry>Visual/Source</entry>
</row>
<row>
- <entry>Visual/Source Editors Splitting</entry>
+ <entry>Visual/Source editors splitting</entry>
<entry>The option allows to choose one of the following
- Visual,Source layouts - Vertical Source on top, Vertical Visual on top,Horizontal Source to the left or Horizontal Visual to the left ,as a default one when opening the
- Visual/Source view</entry>
- <entry>Vertical Source on top</entry>
+ Visual,Source layouts - Vertical Source on top, Vertical Visual on top,Horizontal Source to the left or Horizontal Visual to the left,
+ as a default one when opening the Visual/Source view</entry>
+ <entry>Vertical splitting with Source Editor on the top</entry>
</row>
<row>
- <entry>Size of Visual Editor Pane 0 – 100% </entry>
+ <entry>Size of the Visual Editor pane (0 – 100%)</entry>
<entry>With the help of this scroll bar you can adjust the percentage rating
between the Source and Visual modes of the Visual/Source view</entry>
<entry>50%</entry>
16 years, 6 months
JBoss Tools SVN: r17971 - trunk/jsf/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-10-08 07:44:51 -0400 (Thu, 08 Oct 2009)
New Revision: 17971
Modified:
trunk/jsf/docs/userguide/en/modules/editors.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-878 - updating the chapter according to the changes made in the VPE Preferences page;
Modified: trunk/jsf/docs/userguide/en/modules/editors.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/editors.xml 2009-10-08 11:43:00 UTC (rev 17970)
+++ trunk/jsf/docs/userguide/en/modules/editors.xml 2009-10-08 11:44:51 UTC (rev 17971)
@@ -1431,11 +1431,6 @@
</imageobject>
</inlinemediaobject>
)
-
-
-
-
-
provides a quick access to <property>Visual Page
Editor</property> preferences.</para>
@@ -1448,43 +1443,22 @@
</mediaobject>
</figure>
- <para>The available preferences are as follows:</para>
- <itemizedlist>
- <listitem><para>Show Border for Unknown Tags</para></listitem>
- <listitem><para>Show Non-Visual Tags</para></listitem>
- <listitem><para>Show Resource Bundles Usage as EL Expressions</para></listitem>
- <listitem><para>Always Prompt for Tag Attributes During Tag Insert</para></listitem>
- <listitem><para>Show Selection Tag Bar</para></listitem>
- <listitem><para>Always Hide Selection Bar without Prompt</para></listitem>
- <listitem><para>Default Editor Tab: <emphasis>Visual/Source</emphasis>, <emphasis>Source</emphasis> or <emphasis>Preview</emphasis></para></listitem>
- <listitem><para>Size of Visual Editor Pane 0-100%</para></listitem>
- </itemizedlist> <para>Click on the <emphasis><property>Apply</property></emphasis> button to apply the changes or on the <emphasis><property>Restore Defaults</property></emphasis> button to cancel the changes and set the default preferences.</para>
+ <para>This page provides a number of options associated with the editor representation.
+ The more detailed description on each one you can find in the <property>"JBoss Tools Preferences"</property> chapter
+ under <link linkend="VisualPageEditor2">Visual Page Editor</link>.</para>
</listitem>
-
-
-
- <listitem>
-
+ <listitem>
<para>Clicking on <emphasis>
<property>Refresh</property>
- </emphasis> button
-
-
+ </emphasis> button
(
<inlinemediaobject>
<imageobject>
<imagedata fileref="images/visual_page/icon_2.png"/>
</imageobject>
</inlinemediaobject>
- )
-
-
-
-
-
-
-
+ )
you refresh the displayed information.</para>
</listitem>
@@ -1498,9 +1472,7 @@
<imagedata fileref="images/visual_page/icon_3.png"/>
</imageobject>
</inlinemediaobject>
- )
-
-
+ )
leads to a window which helps you specify necessary
references of the resources. It is represented by a window with 4 tabs. The
first one, <emphasis>
@@ -1531,9 +1503,6 @@
</mediaobject>
</figure>
-
-
-
<para>The third one, <emphasis>
<property>Included tag libs</property></emphasis>, can be used to add Taglibs that can be used by the editor for
getting appropriate templates to generate a preview:</para>
16 years, 6 months
JBoss Tools SVN: r17968 - trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2009-10-07 15:07:40 -0400 (Wed, 07 Oct 2009)
New Revision: 17968
Modified:
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4972 No ejb and ear project are created as new Maven-based Seam Web Project
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java 2009-10-07 17:45:12 UTC (rev 17967)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java 2009-10-07 19:07:40 UTC (rev 17968)
@@ -1,6 +1,10 @@
package org.jboss.tools.maven.core;
import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
@@ -650,11 +654,40 @@
public static PomResourceImpl loadResource(URL url) throws CoreException {
try {
URI uri = URI.createURI(url.toString());
+ if ( !( uri.isFile() || uri.isPlatformResource()) ) {
+ // the m2eclipse pom model can read only a file URL or platform resource URL
+ // see https://jira.jboss.org/jira/browse/JBIDE-4972
+ InputStream is = null;
+ OutputStream os = null;
+ try {
+ File temp = File.createTempFile("mavenCoreActivator", ".pom"); //$NON-NLS-1$//$NON-NLS-2$
+ temp.deleteOnExit();
+ os = new FileOutputStream(temp);
+ is = url.openStream();
+ copy(is,os);
+ URL tempURL = temp.toURL();
+ uri = URI.createURI(tempURL.toString());
+ } catch (Exception e) {
+ log(e);
+ throw new CoreException(new Status(IStatus.ERROR,
+ PLUGIN_ID, -1, e.getMessage(), e));
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (Exception ignore) {}
+ }
+ if (os != null) {
+ try {
+ os.close();
+ } catch (Exception ignore) {}
+ }
+ }
+ }
org.eclipse.emf.ecore.resource.Resource resource = new PomResourceFactoryImpl()
.createResource(uri);
resource.load(Collections.EMPTY_MAP);
return (PomResourceImpl) resource;
-
} catch (Exception ex) {
log(ex);
throw new CoreException(new Status(IStatus.ERROR,
@@ -662,6 +695,15 @@
}
}
+ private static void copy(InputStream is, OutputStream os)
+ throws IOException {
+ byte[] buffer = new byte[1024];
+ int count;
+ while ( (count = is.read(buffer)) > 0) {
+ os.write(buffer,0,count);
+ }
+ }
+
public static void addLibraryProviderOperationConfig(
LibraryProviderOperationConfig config) {
libraryProviderOperationConfigs.add(config);
16 years, 6 months
JBoss Tools SVN: r17967 - trunk/common/plugins/org.jboss.tools.common.projecttemplates/src/org/jboss/tools/common/projecttemplates.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-10-07 13:45:12 -0400 (Wed, 07 Oct 2009)
New Revision: 17967
Modified:
trunk/common/plugins/org.jboss.tools.common.projecttemplates/src/org/jboss/tools/common/projecttemplates/ProjectTemplatesPlugin.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4977
Modified: trunk/common/plugins/org.jboss.tools.common.projecttemplates/src/org/jboss/tools/common/projecttemplates/ProjectTemplatesPlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.projecttemplates/src/org/jboss/tools/common/projecttemplates/ProjectTemplatesPlugin.java 2009-10-07 17:06:56 UTC (rev 17966)
+++ trunk/common/plugins/org.jboss.tools.common.projecttemplates/src/org/jboss/tools/common/projecttemplates/ProjectTemplatesPlugin.java 2009-10-07 17:45:12 UTC (rev 17967)
@@ -63,8 +63,8 @@
copy(location, install, "lib", filter); //$NON-NLS-1$
} else {
UnzipOperation unzip = new UnzipOperation(install);
- unzip.execute(location.getAbsolutePath(), "templates");
- unzip.execute(location.getAbsolutePath(), "lib");
+ unzip.execute(location, "templates.*"); //$NON-NLS-1$
+ unzip.execute(location, "lib.*"); //$NON-NLS-1$
}
}
16 years, 6 months