JBoss Tools SVN: r7491 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2008-04-10 12:33:44 -0400 (Thu, 10 Apr 2008)
New Revision: 7491
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/AttributeFormatController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/FontNameFormatController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/FontSizeFormatController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/TextFormattingToolBar.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-1996
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/AttributeFormatController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/AttributeFormatController.java 2008-04-10 15:54:21 UTC (rev 7490)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/AttributeFormatController.java 2008-04-10 16:33:44 UTC (rev 7491)
@@ -57,6 +57,10 @@
if(FormatAttributeData.STYLE_TYPE.equals(templateData.getType())) {
manager.setIgnoreSelectionChanges(false);
setStyle(attribute, templateData);
+ if (!(attribute.getValue().length() > 0)) {
+ Element element = (Element) selectedNode;
+ element.removeAttributeNode(attribute);
+ }
return;
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/FontNameFormatController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/FontNameFormatController.java 2008-04-10 15:54:21 UTC (rev 7490)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/FontNameFormatController.java 2008-04-10 16:33:44 UTC (rev 7491)
@@ -7,82 +7,106 @@
*
* Contributors:
* Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.vpe.editor.toolbar.format;
import org.eclipse.swt.widgets.Combo;
-import org.w3c.dom.Attr;
-
import org.jboss.tools.vpe.editor.template.textformating.FormatAttributeData;
import org.jboss.tools.vpe.editor.toolbar.format.css.StyleAttribute;
import org.jboss.tools.vpe.editor.toolbar.format.css.StyleProperty;
+import org.w3c.dom.Attr;
/**
* @author Igels
*/
public class FontNameFormatController extends ComboFormatController {
- public static String TYPE = "FontNameFormat";
+ private static final String REPLACE_VALUE = "['\"]"; //$NON-NLS-1$
- private static String STYLE_PROPERTY_NAME = "FONT-FAMILY";
+ private static final String EMPTY = ""; //$NON-NLS-1$
- /**
- * @param manager
- * @param comboBlockFormat
- */
- public FontNameFormatController(FormatControllerManager manager, Combo comboBlockFormat) {
- super(manager, comboBlockFormat);
- }
+ public static String TYPE = "FontNameFormat"; //$NON-NLS-1$
- /* (non-Javadoc)
- * @see org.jboss.tools.vpe.editor.toolbar.format.IFormatController#getType()
- */
- public String getType() {
- return TYPE;
- }
+ private static String STYLE_PROPERTY_NAME = "FONT-FAMILY"; //$NON-NLS-1$
- protected void setStyle(Attr styleAttribute, FormatAttributeData templateData) {
- String value = createStylePropertyValue();
- if(value!=null) {
- setSingleStyleProperty(styleAttribute, STYLE_PROPERTY_NAME, value);
- }
+ private String defaultFont = null;
+
+ /**
+ * @param manager
+ * @param comboBlockFormat
+ */
+ public FontNameFormatController(FormatControllerManager manager,
+ Combo comboBlockFormat, String defaultFont) {
+ super(manager, comboBlockFormat);
+ this.defaultFont = defaultFont;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.vpe.editor.toolbar.format.IFormatController#getType()
+ */
+ public String getType() {
+ return TYPE;
+ }
+
+ protected void setStyle(Attr styleAttribute,
+ FormatAttributeData templateData) {
+ String value = createStylePropertyValue();
+ if (value != null) {
+ String fontName = value.replaceAll(REPLACE_VALUE, EMPTY);
+ if (fontName.equalsIgnoreCase(defaultFont)) {
+ StyleAttribute style = new StyleAttribute(styleAttribute);
+ style.removeStyleProperty(STYLE_PROPERTY_NAME);
+ String newStyle = style.toString().trim();
+ styleAttribute.setValue(newStyle);
+ return;
+ }
+ setSingleStyleProperty(styleAttribute, STYLE_PROPERTY_NAME, value);
}
+ }
- private String createStylePropertyValue() {
- if(selectionText!=null && selectionText.trim().length()>0) {
- return "'" + selectionText.trim() + "'";
- }
- return null;
+ private String createStylePropertyValue() {
+ if (selectionText != null && selectionText.trim().length() > 0) {
+ return "'" + selectionText.trim() + "'"; //$NON-NLS-1$//$NON-NLS-2$
}
+ return null;
+ }
- /* (non-Javadoc)
- * @see org.jboss.tools.vpe.editor.toolbar.format.IFormatController#setToolbarItemEnabled(boolean enabled)
- */
- public void setToolbarItemEnabled(boolean enabled) {
- comboBlockFormat.setEnabled(enabled);
- if(enabled) {
- Attr style = getStyleAttributeFromSelectedNode(true);
- if(style!=null) {
- StyleAttribute styleAttribute = new StyleAttribute(style);
- StyleProperty fontProperty = styleAttribute.getProperty(STYLE_PROPERTY_NAME);
- if(fontProperty!=null) {
- String fontName = fontProperty.getPropertyValue().getDirtyValue().trim();
- if(fontName!=null) {
- fontName = fontName.replaceAll("['\"]", "");
- if(getComboBlockFormat().getText().equalsIgnoreCase(fontName)) {
- return;
- }
- String[] items = this.getComboBlockFormat().getItems();
- for (int i = 0; i < items.length; i++) {
- if(items[i].equalsIgnoreCase(fontName)) {
- this.getComboBlockFormat().select(i);
- return;
- }
- }
- }
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.vpe.editor.toolbar.format.IFormatController#setToolbarItemEnabled(boolean
+ * enabled)
+ */
+ public void setToolbarItemEnabled(boolean enabled) {
+ comboBlockFormat.setEnabled(enabled);
+ if (enabled) {
+ Attr style = getStyleAttributeFromSelectedNode(true);
+ if (style != null) {
+ StyleAttribute styleAttribute = new StyleAttribute(style);
+ StyleProperty fontProperty = styleAttribute
+ .getProperty(STYLE_PROPERTY_NAME);
+ if (fontProperty != null) {
+ String fontName = fontProperty.getPropertyValue()
+ .getDirtyValue().trim();
+ if (fontName != null) {
+ fontName = fontName.replaceAll(REPLACE_VALUE, EMPTY);
+ if (getComboBlockFormat().getText().equalsIgnoreCase(
+ fontName)) {
+ return;
}
+ String[] items = this.getComboBlockFormat().getItems();
+ for (int i = 0; i < items.length; i++) {
+ if (items[i].equalsIgnoreCase(fontName)) {
+ this.getComboBlockFormat().select(i);
+ return;
+ }
+ }
+ }
}
- getComboBlockFormat().deselectAll();
+ }
}
+ getComboBlockFormat().select(0);
+ }
}
\ No newline at end of file
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/FontSizeFormatController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/FontSizeFormatController.java 2008-04-10 15:54:21 UTC (rev 7490)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/FontSizeFormatController.java 2008-04-10 16:33:44 UTC (rev 7491)
@@ -7,7 +7,7 @@
*
* Contributors:
* Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.vpe.editor.toolbar.format;
import java.util.HashMap;
@@ -24,76 +24,91 @@
*/
public class FontSizeFormatController extends ComboFormatController {
- public static String TYPE = "FontSizeFormat";
+ public static String TYPE = "FontSizeFormat"; //$NON-NLS-1$
- private static String STYLE_PROPERTY_NAME = "FONT-SIZE";
+ private static String STYLE_PROPERTY_NAME = "FONT-SIZE"; //$NON-NLS-1$
- private static HashMap SIZES = new HashMap();
- static {
- SIZES.put("1", "xx-small");
- SIZES.put("2", "x-small");
- SIZES.put("3", "small");
- SIZES.put("4", "medium");
- SIZES.put("5", "large");
- SIZES.put("6", "x-large");
- SIZES.put("7", "xx-large");
- }
+ private static HashMap<String, String> SIZES = new HashMap<String, String>();
+ static {
+ SIZES.put("1", "xx-small"); //$NON-NLS-1$ //$NON-NLS-2$
+ SIZES.put("2", "x-small"); //$NON-NLS-1$ //$NON-NLS-2$
+ SIZES.put("3", "small"); //$NON-NLS-1$ //$NON-NLS-2$
+ SIZES.put("4", "medium"); //$NON-NLS-1$ //$NON-NLS-2$
+ SIZES.put("5", "large"); //$NON-NLS-1$ //$NON-NLS-2$
+ SIZES.put("6", "x-large"); //$NON-NLS-1$ //$NON-NLS-2$
+ SIZES.put("7", "xx-large"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
- /**
- * @param manager
- * @param comboBlockFormat
- */
- public FontSizeFormatController(FormatControllerManager manager, Combo comboBlockFormat) {
- super(manager, comboBlockFormat);
- }
+ /**
+ * @param manager
+ * @param comboBlockFormat
+ */
+ public FontSizeFormatController(FormatControllerManager manager,
+ Combo comboBlockFormat) {
+ super(manager, comboBlockFormat);
+ }
- /* (non-Javadoc)
- * @see org.jboss.tools.vpe.editor.toolbar.format.IFormatController#getType()
- */
- public String getType() {
- return TYPE;
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.vpe.editor.toolbar.format.IFormatController#getType()
+ */
+ public String getType() {
+ return TYPE;
+ }
- protected void setStyle(Attr styleAttribute, FormatAttributeData templateData) {
- String value = createStylePropertyValue();
- if(value!=null) {
- setSingleStyleProperty(styleAttribute, STYLE_PROPERTY_NAME, value);
- }
+ protected void setStyle(Attr styleAttribute,
+ FormatAttributeData templateData) {
+ String value = createStylePropertyValue();
+ if (value != null) {
+ setSingleStyleProperty(styleAttribute, STYLE_PROPERTY_NAME, value);
+ } else {
+ StyleAttribute style = new StyleAttribute(styleAttribute);
+ style.removeStyleProperty(STYLE_PROPERTY_NAME);
+ String newStyle = style.toString().trim();
+ styleAttribute.setValue(newStyle);
}
+ }
- private String createStylePropertyValue() {
- if(selectionText!=null && selectionText.trim().length()>0) {
- return (String)SIZES.get(selectionText.trim());
- }
- return null;
+ private String createStylePropertyValue() {
+ if (selectionText != null && selectionText.trim().length() > 0) {
+ return (String) SIZES.get(selectionText.trim());
}
+ return null;
+ }
- /* (non-Javadoc)
- * @see org.jboss.tools.vpe.editor.toolbar.format.IFormatController#setToolbarItemEnabled(boolean enabled)
- */
- public void setToolbarItemEnabled(boolean enabled) {
- comboBlockFormat.setEnabled(enabled);
- if(enabled) {
- Attr style = getStyleAttributeFromSelectedNode(true);
- if(style!=null) {
- StyleAttribute styleAttribute = new StyleAttribute(style);
- StyleProperty fontProperty = styleAttribute.getProperty(STYLE_PROPERTY_NAME);
- if(fontProperty!=null) {
- String fontSize = fontProperty.getFirstSinglePropertyValue();
- if(fontSize!=null) {
- String[] items = this.getComboBlockFormat().getItems();
- for (int i = 0; i < items.length; i++) {
- if(SIZES.get(items[i]).equals(fontSize)) {
- if(this.getComboBlockFormat().getSelectionIndex()!=i) {
- this.getComboBlockFormat().select(i);
- }
- return;
- }
- }
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.vpe.editor.toolbar.format.IFormatController#setToolbarItemEnabled(boolean
+ * enabled)
+ */
+ public void setToolbarItemEnabled(boolean enabled) {
+ comboBlockFormat.setEnabled(enabled);
+ if (enabled) {
+ Attr style = getStyleAttributeFromSelectedNode(true);
+ if (style != null) {
+ StyleAttribute styleAttribute = new StyleAttribute(style);
+ StyleProperty fontProperty = styleAttribute
+ .getProperty(STYLE_PROPERTY_NAME);
+ if (fontProperty != null) {
+ String fontSize = fontProperty
+ .getFirstSinglePropertyValue();
+ if (fontSize != null) {
+ String[] items = this.getComboBlockFormat().getItems();
+ for (int i = 1; i < items.length; i++) {
+ if (SIZES.get(items[i]).equals(fontSize)) {
+ if (this.getComboBlockFormat()
+ .getSelectionIndex() != i) {
+ this.getComboBlockFormat().select(i);
}
+ return;
+ }
}
+ }
}
- getComboBlockFormat().deselectAll();
+ }
}
+ getComboBlockFormat().select(0);
+ }
}
\ No newline at end of file
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/TextFormattingToolBar.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/TextFormattingToolBar.java 2008-04-10 15:54:21 UTC (rev 7490)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/TextFormattingToolBar.java 2008-04-10 16:33:44 UTC (rev 7491)
@@ -36,9 +36,11 @@
*/
public class TextFormattingToolBar extends SplitToolBar {
- private static String[] FONT_ARRAY = { "Arial", "Courier New", "Times New Roman",
- "Comic Sans", "MS Serif", "Tahoma", "Verdana" };
+ private static final String NORMAL_FONT = "Normal"; //$NON-NLS-1$
+ private static String[] FONT_ARRAY = { "Arial", "Courier New", "Times New Roman", //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ "Comic Sans", "MS Serif", "Tahoma", "Verdana" }; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$
+
private Composite composite;
private FormatControllerManager formatControllerManager;
@@ -77,11 +79,11 @@
ToolItem sep = new ToolItem(horBar, SWT.SEPARATOR);
Combo comboBlockFormat = new Combo(horBar, SWT.READ_ONLY);
- comboBlockFormat.add("Normal");
+ comboBlockFormat.add("Normal"); //$NON-NLS-1$
// comboBlockFormat.add("Formatted");
- comboBlockFormat.add("Address");
+ comboBlockFormat.add("Address"); //$NON-NLS-1$
for (int i = 1; i < 7; i++) {
- comboBlockFormat.add("Heading " + i);
+ comboBlockFormat.add("Heading " + i); //$NON-NLS-1$
}
// comboBlockFormat.add("Numbered List");
// comboBlockFormat.add("Bulleted List");
@@ -107,10 +109,11 @@
font = FONT_ARRAY;
}
comboFont.setItems(font);
- comboFont.select(30);
+ comboFont.add(NORMAL_FONT, 0);
+ comboFont.select(0);
comboFont.pack();
comboFont.setToolTipText(VpeUIMessages.FONT_NAME);
- comboFont.addListener(SWT.Selection, new FontNameFormatController(formatControllerManager, comboFont));
+ comboFont.addListener(SWT.Selection, new FontNameFormatController(formatControllerManager, comboFont, NORMAL_FONT));
sep.setWidth(comboFont.getSize().x);
sep.setControl(comboFont);
@@ -119,8 +122,9 @@
sep = new ToolItem(horBar, SWT.SEPARATOR);
Combo comboFontSize = new Combo(horBar, SWT.DROP_DOWN|SWT.COLOR_LIST_BACKGROUND );
for (int i = 1; i < 8; i++) {
- comboFontSize.add("" + i);
+ comboFontSize.add("" + i); //$NON-NLS-1$
}
+ comboFontSize.add(NORMAL_FONT, 0);
comboFontSize.setToolTipText(VpeUIMessages.FONT_SIZE);
comboFontSize.select(2);
comboFontSize.pack();
@@ -132,17 +136,17 @@
sep = new ToolItem(horBar, SWT.SEPARATOR);
itemDescriptors.add(new ToolItemDescriptor(sep, false, null, false));
- ToolItem item = createToolItem(horBar, SWT.CHECK, "icons/bold.gif", VpeUIMessages.BOLD);
+ ToolItem item = createToolItem(horBar, SWT.CHECK, "icons/bold.gif", VpeUIMessages.BOLD); //$NON-NLS-1$
Listener listener = new BoldFormatController(formatControllerManager, item);
item.addListener(SWT.Selection, listener);
itemDescriptors.add(new ToolItemDescriptor(item, true, listener, true));
- item = createToolItem(horBar, SWT.CHECK, "icons/italic.gif", VpeUIMessages.ITALIC);
+ item = createToolItem(horBar, SWT.CHECK, "icons/italic.gif", VpeUIMessages.ITALIC); //$NON-NLS-1$
listener = new ItalicFormatController(formatControllerManager, item);
item.addListener(SWT.Selection, listener);
itemDescriptors.add(new ToolItemDescriptor(item, true, listener, true));
- item = createToolItem(horBar, SWT.CHECK, "icons/uderline.gif", VpeUIMessages.UNDERLINE);
+ item = createToolItem(horBar, SWT.CHECK, "icons/uderline.gif", VpeUIMessages.UNDERLINE); //$NON-NLS-1$
listener = new UnderlineFormatController(formatControllerManager, item);
item.addListener(SWT.Selection, listener);
itemDescriptors.add(new ToolItemDescriptor(item, true, listener, true));
@@ -150,12 +154,12 @@
sep = new ToolItem(horBar, SWT.SEPARATOR);
itemDescriptors.add(new ToolItemDescriptor(sep, false, null, true));
- item = createToolItem(horBar, SWT.PUSH, "icons/background.gif", VpeUIMessages.BACKGROUND_COLOR);
+ item = createToolItem(horBar, SWT.PUSH, "icons/background.gif", VpeUIMessages.BACKGROUND_COLOR); //$NON-NLS-1$
listener = new BackgroundColorFormatController(formatControllerManager, item);
item.addListener(SWT.Selection, listener);
itemDescriptors.add(new ToolItemDescriptor(item, true, listener, true));
- item = createToolItem(horBar, SWT.PUSH, "icons/foreground.gif", VpeUIMessages.FOREGROUND_COLOR);
+ item = createToolItem(horBar, SWT.PUSH, "icons/foreground.gif", VpeUIMessages.FOREGROUND_COLOR); //$NON-NLS-1$
listener = new ForegroundColorFormatController(formatControllerManager, item);
item.addListener(SWT.Selection, listener);
itemDescriptors.add(new ToolItemDescriptor(item, true, listener, true));
18 years
JBoss Tools SVN: r7490 - trunk/as/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-04-10 11:54:21 -0400 (Thu, 10 Apr 2008)
New Revision: 7490
Modified:
trunk/as/docs/reference/en/modules/perspective.xml
trunk/as/docs/reference/en/modules/runtimes_servers.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-304 - making changes in the text according to new Jboss AS 5 adapter
Modified: trunk/as/docs/reference/en/modules/perspective.xml
===================================================================
--- trunk/as/docs/reference/en/modules/perspective.xml 2008-04-10 14:11:27 UTC (rev 7489)
+++ trunk/as/docs/reference/en/modules/perspective.xml 2008-04-10 15:54:21 UTC (rev 7490)
@@ -26,7 +26,7 @@
<?dbhtml filename="JBossServerView.html"?>
<title>The JBoss Server View</title>
<para>Let's have a look at the <property>JBoss Server View</property> and inspect
- in details all parts it consists of. </para>
+ in detail all parts it consists of. </para>
<para>The <property>JBoss Server View</property> is based on the WTP view, Server View. The
top part of the <property>JBoss Servers View</property> essentially embeds the original
@@ -146,13 +146,13 @@
</mediaobject>
</figure>
- <para>The editor will also allow you to modify that server's launch
+ <para id="com_line_arg">The editor will also allow you to modify that server's launch
configuration. It's just after clicking <emphasis>
<property>Open launch configuration</property>
</emphasis> link. In the open window there are the tabs for setting command line
arguments and other things that are relevant to launching the server.</para>
- <figure id="com_line_arg">
+ <figure>
<title>Launch Configuration Properties</title>
<mediaobject>
<imageobject>
Modified: trunk/as/docs/reference/en/modules/runtimes_servers.xml
===================================================================
--- trunk/as/docs/reference/en/modules/runtimes_servers.xml 2008-04-10 14:11:27 UTC (rev 7489)
+++ trunk/as/docs/reference/en/modules/runtimes_servers.xml 2008-04-10 15:54:21 UTC (rev 7490)
@@ -67,8 +67,8 @@
</mediaobject>
</figure>
- <para>As shown on the above figure, <property>JBoss Tools</property> provides
- its own updated and supported adapters such as JBoss 3.2, 4.0, and 4.2.
+ <para>As shown on the above figure, <property>JBoss Tools</property> provide
+ its own updated and supported adapters such as JBoss 3.2, 4.0, 4.2 and 5.0 as well.
You'll also note a Deploy-Only Runtime type. This type provides no classpath for WTP
projects. It is used solely by its server type for the purpose of setting up a deploy
directory for users who don't wish to make use of starting, stopping, or debugging their
18 years
JBoss Tools SVN: r7489 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-04-10 10:11:27 -0400 (Thu, 10 Apr 2008)
New Revision: 7489
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1992 Fixed
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java 2008-04-10 14:07:06 UTC (rev 7488)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java 2008-04-10 14:11:27 UTC (rev 7489)
@@ -57,6 +57,7 @@
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.SeamProjectsSet;
import org.jboss.tools.seam.core.project.facet.SeamProjectPreferences;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
import org.jboss.tools.seam.core.project.facet.SeamVersion;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
@@ -146,11 +147,7 @@
seamRuntimeEditor.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
Object value = evt.getNewValue();
- if(value.toString().length()>0) {
- setRuntimeIsSelected(true);
- } else {
- setRuntimeIsSelected(false);
- }
+ setRuntimeIsSelected(value.toString().length()>0);
}
});
registerEditor(seamRuntimeEditor, generalGroup);
@@ -346,85 +343,113 @@
folder = preferences.get(ISeamFacetDataModelProperties.ENTITY_BEAN_SOURCE_FOLDER, null);
}
if(folder==null) {
- SeamProjectsSet set = new SeamProjectsSet(project);
- IContainer f = set.getModelFolder();
- folder = f!=null?f.getFullPath().toString():"";
+ folder = getDefaultModelSourceFolder();
}
return folder;
}
+ private String getDefaultModelSourceFolder() {
+ SeamProjectsSet set = new SeamProjectsSet(project);
+ IContainer f = set.getModelFolder();
+ return f!=null?f.getFullPath().toString():"";
+ }
+
private String getModelPackageName() {
String name = null;
if(preferences!=null) {
name = preferences.get(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME, null);
}
if(name==null) {
- name = "org.domain." + getSeamProjectName() + ".entity";
+ name = getDefaultModelPackageName();
}
return name;
}
+ private String getDefaultModelPackageName() {
+ return "org.domain." + getSeamProjectName() + ".entity";
+ }
+
private String getActionPackageName() {
String name = null;
if(preferences!=null) {
name = preferences.get(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME, null);
}
if(name==null) {
- name = "org.domain." + getSeamProjectName() + ".session";
+ name = getDefaultActionPackageName();
}
return name;
}
+ private String getDefaultActionPackageName() {
+ return "org.domain." + getSeamProjectName() + ".session";
+ }
+
private String getTestPackageName() {
String name = null;
if(preferences!=null) {
name = preferences.get(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, null);
}
if(name==null) {
- name = "org.domain." + getSeamProjectName() + ".test";
+ name = getDefaultTestPackageName();
}
return name;
}
+ private String getDefaultTestPackageName() {
+ return "org.domain." + getSeamProjectName() + ".test";
+ }
+
private String getActionSourceFolder() {
String folder = null;
if(preferences!=null) {
folder = preferences.get(ISeamFacetDataModelProperties.SESSION_BEAN_SOURCE_FOLDER, null);
}
if(folder==null) {
- SeamProjectsSet set = new SeamProjectsSet(project);
- IContainer f = set.getActionFolder();
- folder = f!=null?f.getFullPath().toString():"";
+ folder = getDefaultActionSourceFolder();
}
return folder;
}
+ private String getDefaultActionSourceFolder() {
+ SeamProjectsSet set = new SeamProjectsSet(project);
+ IContainer f = set.getActionFolder();
+ return f!=null?f.getFullPath().toString():"";
+ }
+
private String getTestSourceFolder() {
String folder = null;
if(preferences!=null) {
folder = preferences.get(ISeamFacetDataModelProperties.TEST_SOURCE_FOLDER, null);
}
if(folder==null) {
- SeamProjectsSet set = new SeamProjectsSet(project);
- IContainer f = set.getTestsFolder();
- folder = f!=null?f.getFullPath().toString():"";
+ folder = getDefaultTestSourceFolder();
}
return folder;
}
+ private String getDefaultTestSourceFolder() {
+ SeamProjectsSet set = new SeamProjectsSet(project);
+ IContainer f = set.getTestsFolder();
+ return f!=null?f.getFullPath().toString():"";
+ }
+
private String getViewFolder() {
String folder = null;
if(preferences!=null) {
folder = preferences.get(ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER, null);
}
if(folder==null) {
- SeamProjectsSet set = new SeamProjectsSet(project);
- IContainer f = set.getViewsFolder();
- folder = f!=null?f.getFullPath().toString():"";
+ folder = getDefaultViewFolder();
}
return folder;
}
+ private String getDefaultViewFolder() {
+ SeamProjectsSet set = new SeamProjectsSet(project);
+ IContainer f = set.getViewsFolder();
+ return f!=null?f.getFullPath().toString():"";
+ }
+
private List<String> getProfileNameList() {
IConnectionProfile[] profiles = ProfileManager.getInstance()
.getProfilesByCategory("org.eclipse.datatools.connectivity.db.category"); //$NON-NLS-1$
@@ -443,6 +468,11 @@
return (ds!=null && getProfileNameList().contains(ds))?ds:""; //$NON-NLS-1$
}
+ private String getDefaultConnectionProfile() {
+ List<String> names = getProfileNameList();
+ return names.size()>0?names.get(0):"";
+ }
+
private String getEjbProjectName() {
if(preferences!=null) {
return preferences.get(ISeamFacetDataModelProperties.SEAM_EJB_PROJECT, project.getName());
@@ -743,7 +773,7 @@
}
private void setEnabledTestGroup() {
- boolean enabled = isTestEnabled();
+ boolean enabled = isTestEnabled() && isSeamSupported() && runtimeIsSelected;
editorRegistry.get(ISeamFacetDataModelProperties.SEAM_TEST_PROJECT).setEnabled(enabled);
editorRegistry.get(ISeamFacetDataModelProperties.TEST_SOURCE_FOLDER).setEnabled(enabled);
editorRegistry.get(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME).setEnabled(enabled);
@@ -760,6 +790,53 @@
}
}
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
+ */
+ @Override
+ protected void performDefaults() {
+ getEditor(SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_SEAM_SUPPORT).setValue(Boolean.TRUE);
+ getEditor(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME).setValue(getDefaultRuntimeName());
+ getEditor(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS).setValue(ISeamFacetDataModelProperties.DEPLOY_AS_WAR);
+ getEditor(ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER).setValue(getDefaultViewFolder());
+ getEditor(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE).setValue(getDefaultConnectionProfile());
+ getEditor(ISeamFacetDataModelProperties.ENTITY_BEAN_SOURCE_FOLDER).setValue(getDefaultModelSourceFolder());
+ getEditor(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME).setValue(getDefaultModelPackageName());
+ getEditor(ISeamFacetDataModelProperties.SESSION_BEAN_SOURCE_FOLDER).setValue(getDefaultActionSourceFolder());
+ getEditor(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME).setValue(getDefaultActionPackageName());
+ getEditor(ISeamFacetDataModelProperties.TEST_CREATING).setValue(Boolean.TRUE);
+ getEditor(ISeamFacetDataModelProperties.SEAM_TEST_PROJECT).setValue(project.getName());
+ getEditor(ISeamFacetDataModelProperties.TEST_SOURCE_FOLDER).setValue(getDefaultTestSourceFolder());
+ getEditor(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME).setValue(getDefaultTestPackageName());
+ setEnabledSeamSuport(true);
+ validate();
+ }
+
+ private String getDefaultRuntimeName() {
+ SeamRuntime runtime = SeamRuntimeManager.getDefaultRuntimeForProject(warProject!=null?warProject:project);
+ if(runtime==null) {
+ List<String> names = getRuntimeNames();
+ if(names.size()>0) {
+ return names.get(0);
+ }
+ return "";
+ }
+ return runtime.getName();
+ }
+
+ private List<String> getRuntimeNames() {
+ SeamVersion[] seamVersions = getSeamVersions();
+ List<String> rtStrings = new ArrayList<String>();
+ for (int i = 0; i < seamVersions.length; i++) {
+ SeamRuntime[] rts = SeamRuntimeManager.getInstance().getRuntimes(seamVersions[i]);
+ for(SeamRuntime seamRuntime : rts) {
+ rtStrings.add(seamRuntime.getName());
+ }
+ }
+ return rtStrings;
+ }
+
private void setRuntimeIsSelected(boolean selected) {
runtimeIsSelected = selected;
for (String key : editorRegistry.keySet()) {
18 years
JBoss Tools SVN: r7488 - trunk/as/docs/reference/en.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2008-04-10 10:07:06 -0400 (Thu, 10 Apr 2008)
New Revision: 7488
Modified:
trunk/as/docs/reference/en/master.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-286 xml validator is added
Modified: trunk/as/docs/reference/en/master.xml
===================================================================
--- trunk/as/docs/reference/en/master.xml 2008-04-10 14:05:38 UTC (rev 7487)
+++ trunk/as/docs/reference/en/master.xml 2008-04-10 14:07:06 UTC (rev 7488)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR3//EN"
-"../../resources/support/docbook-dtd/docbookx.dtd"
+"http://www.oasis-open.org/docbook/xml/4.3CR3/docbookx.dtd"
[<!ENTITY quick_start SYSTEM "modules/quick_start.xml">
<!ENTITY runtimes_servers SYSTEM "modules/runtimes_servers.xml">
18 years
JBoss Tools SVN: r7487 - trunk/documentation/guides/GettingStartedGuide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: tromanovich
Date: 2008-04-10 10:05:38 -0400 (Thu, 10 Apr 2008)
New Revision: 7487
Modified:
trunk/documentation/guides/GettingStartedGuide/en/modules/further_reading.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-140 links in docs should be relative
Updating external links between documents
Modified: trunk/documentation/guides/GettingStartedGuide/en/modules/further_reading.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/further_reading.xml 2008-04-10 14:02:22 UTC (rev 7486)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/further_reading.xml 2008-04-10 14:05:38 UTC (rev 7487)
@@ -15,9 +15,9 @@
<para>
<emphasis role="bold">JSF Tools Reference Guide</emphasis>
- <ulink url="../../../jsf_tools_ref_guide/en/html/index.html">(html)</ulink>
- <ulink url="../../../jsf_tools_ref_guide/en/html_single/index.html">(html single)</ulink>
- <ulink url="../../../jsf_tools_ref_guide/en/pdf/Seam_Dev_Tools_Reference_Guide.pdf"
+ <ulink url="../../jsf_tools_ref_guide/html/index.html">(html)</ulink>
+ <ulink url="../../jsf_tools_ref_guide/html_single/index.html">(html single)</ulink>
+ <ulink url="../../jsf_tools_ref_guide/pdf/Seam_Dev_Tools_Reference_Guide.pdf"
>(PDF)</ulink>
</para>
<para> From this guide you'll discover all peculiarities of work at a JSF project. You'll
@@ -28,18 +28,18 @@
<para>
<emphasis role="bold">JSF Tools Tutorial</emphasis>
- <ulink url="../../../jsf_tools_tutorial/en/html/index.html">(html)</ulink>
- <ulink url="../../../jsf_tools_tutorial/en/html_single/index.html">(html single)</ulink>
- <ulink url="../../../jsf_tools_tutorial/en/pdf/Seam_Dev_Tools_Reference_Guide.pdf">(PDF)</ulink>
+ <ulink url="../../jsf_tools_tutorial/html/index.html">(html)</ulink>
+ <ulink url="../../jsf_tools_tutorial/html_single/index.html">(html single)</ulink>
+ <ulink url="../../jsf_tools_tutorial/pdf/Seam_Dev_Tools_Reference_Guide.pdf">(PDF)</ulink>
</para>
<para> This tutorial will describe how to deal with classic/old style of JSF development and how
to create a simple JSF application using the JBoss Developer Studio. </para>
<para>
<emphasis role="bold">Struts Tools Reference Guide</emphasis>
- <ulink url="../../../struts_tools_ref_guide/en/html/index.html">(html)</ulink>
- <ulink url="../../../struts_tools_ref_guide/en/html_single/index.html">(html single)</ulink>
- <ulink url="../../../struts_tools_ref_guide/en/pdf/Seam_Dev_Tools_Reference_Guide.pdf"
+ <ulink url="../../struts_tools_ref_guide/html/index.html">(html)</ulink>
+ <ulink url="../../struts_tools_ref_guide/html_single/index.html">(html single)</ulink>
+ <ulink url="../../struts_tools_ref_guide/pdf/Seam_Dev_Tools_Reference_Guide.pdf"
>(PDF)</ulink>
</para>
<para> In Struts Tools Reference Guide you will learn how to create and work with a new struts
@@ -48,9 +48,9 @@
<para>
<emphasis role="bold">Struts Tools Tutorial</emphasis>
- <ulink url="../../../struts_tools_tutorial/en/html/index.html">(html)</ulink>
- <ulink url="../../../struts_tools_tutorial/en/html_single/index.html">(html single)</ulink>
- <ulink url="../../../struts_tools_tutorial/en/pdf/Seam_Dev_Tools_Reference_Guide.pdf"
+ <ulink url="../../struts_tools_tutorial/html/index.html">(html)</ulink>
+ <ulink url="../../struts_tools_tutorial/html_single/index.html">(html single)</ulink>
+ <ulink url="../../struts_tools_tutorial/pdf/Seam_Dev_Tools_Reference_Guide.pdf"
>(PDF)</ulink>
</para>
<para> This tutorial will describe the classical style of Struts development, and will
@@ -58,9 +58,9 @@
<para>
<emphasis role="bold">Seam Dev Tools Reference Guide</emphasis>
- <ulink url="../../../seam/en/html/index.html">(html)</ulink>
- <ulink url="../../../seam/en/html_single/index.html">(html single)</ulink>
- <ulink url="../../../seam/en/pdf/Seam_Dev_Tools_Reference_Guide.pdf">(PDF)</ulink>
+ <ulink url="../../seam/html/index.html">(html)</ulink>
+ <ulink url="../../seam/html_single/index.html">(html single)</ulink>
+ <ulink url="../../seam/pdf/Seam_Dev_Tools_Reference_Guide.pdf">(PDF)</ulink>
</para>
<para> This guide helps you to understand what Seam is and how to install Seam plug-in into
Eclipse. It tells you the necessary steps to start working with Seam Framework and assists in a
@@ -69,16 +69,16 @@
<para>
<emphasis role="bold">Visual Web Tools Reference Guide</emphasis>
- <ulink url="../../../jsf/en/html/index.html">(html)</ulink>
- <ulink url="../../../jsf/en/html_single/index.html">(html single)</ulink>
- <ulink url="../../../jsf/en/pdf/Visual_Web_Tools_Reference_Guide.pdf">(PDF)</ulink>
+ <ulink url="../../jsf/html/index.html">(html)</ulink>
+ <ulink url="../../jsf/html_single/index.html">(html single)</ulink>
+ <ulink url="../../jsf/pdf/Visual_Web_Tools_Reference_Guide.pdf">(PDF)</ulink>
</para>
<para>
<emphasis role="bold">JBoss Server Manager Reference Guide</emphasis>
- <ulink url="../../../as/en/html/index.html">(html)</ulink>
- <ulink url="../../../as/en/html_single/index.html">(html single)</ulink>
- <ulink url="../../../as/en/pdf/server_manager_guide.pdf">(PDF)</ulink>
+ <ulink url="../../as/html/index.html">(html)</ulink>
+ <ulink url="../../as/html_single/index.html">(html single)</ulink>
+ <ulink url="../../as/pdf/server_manager_guide.pdf">(PDF)</ulink>
</para>
<para> This guide covers the basics of working with the JBoss server manager. You will read how to
install runtimes and servers and quickly learn how to configure, start, stop the server and know
@@ -87,9 +87,9 @@
<para>
<emphasis role="bold">jBPM Tools Reference Guide</emphasis>
- <ulink url="../../../jbpm/en/html/index.html">(html)</ulink>
- <ulink url="../../../jbpm/en/html_single/index.html">(html single)</ulink>
- <ulink url="../../../jbpm/en/pdf/jBPM_Tools_Ref.pdf">(PDF)</ulink>
+ <ulink url="../../jbpm/html/index.html">(html)</ulink>
+ <ulink url="../../jbpm/html_single/index.html">(html single)</ulink>
+ <ulink url="../../jbpm/pdf/jBPM_Tools_Ref.pdf">(PDF)</ulink>
</para>
<para>With jBPM Tools Reference Guide we'll help you to facilitate a cross-product
learning and know how you can speed your development using special editors and visual designers.
@@ -98,9 +98,9 @@
<para>
<emphasis role="bold">Hibernate Tools Reference Guide</emphasis>
- <ulink url="../../../hibernatetools/en/html/index.html">(html)</ulink>
- <ulink url="../../../hibernatetools/en/html_single/index.html">(html single)</ulink>
- <ulink url="../../../hibernatetools/en/pdf/hibernate_tools.pdf">(PDF)</ulink>
+ <ulink url="../../hibernatetools/html/index.html">(html)</ulink>
+ <ulink url="../../hibernatetools/html_single/index.html">(html single)</ulink>
+ <ulink url="../../hibernatetools/pdf/hibernate_tools.pdf">(PDF)</ulink>
</para>
<para>Throughout this guide you will learn how to install and use Hibernate Tools bath via Ant and
through Eclipse. We'll supply you with the information on how to create mapping files,
@@ -110,9 +110,9 @@
<para>
<emphasis role="bold">Exadel Studio Migration Guide</emphasis>
- <ulink url="../../../Exadel-migration/en/html/index.html">(html)</ulink>
- <ulink url="../../../Exadel-migration/en/html_single/index.html">(html single)</ulink>
- <ulink url="../../../Exadel-migration/en/pdf/exadel-migration.pdf">(PDF)</ulink>
+ <ulink url="../../Exadel-migration/html/index.html">(html)</ulink>
+ <ulink url="../../Exadel-migration/html_single/index.html">(html single)</ulink>
+ <ulink url="../../Exadel-migration/pdf/exadel-migration.pdf">(PDF)</ulink>
</para>
<para>This document is intended to help you to migrate an existing Exadel JSF or Struts projects
from Exadel Studio into JBoss Developer Studio. </para>
18 years
JBoss Tools SVN: r7486 - in trunk/struts/docs: struts_tools_tutorial/en/modules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: tromanovich
Date: 2008-04-10 10:02:22 -0400 (Thu, 10 Apr 2008)
New Revision: 7486
Modified:
trunk/struts/docs/struts_tools_ref_guide/en/modules/editors.xml
trunk/struts/docs/struts_tools_ref_guide/en/modules/projects.xml
trunk/struts/docs/struts_tools_tutorial/en/modules/introduction.xml
trunk/struts/docs/struts_tools_tutorial/en/modules/struts_validation.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-140 links in docs should be relative
Updating links between documents in the struts folder
Modified: trunk/struts/docs/struts_tools_ref_guide/en/modules/editors.xml
===================================================================
--- trunk/struts/docs/struts_tools_ref_guide/en/modules/editors.xml 2008-04-10 13:56:37 UTC (rev 7485)
+++ trunk/struts/docs/struts_tools_ref_guide/en/modules/editors.xml 2008-04-10 14:02:22 UTC (rev 7486)
@@ -153,9 +153,8 @@
</listitem>
</itemizedlist>
- <para>You can take advantage of <link
- linkend="CodeAssistAndDynamicCodeAssist42BasedOnProjectData">code assist</link>.</para>
-
+ <para>You can take advantage of <ulink
+ url="../../jsf/html_single/index.html#CodeAssistAndDynamicCodeAssist42BasedOnProjectData">code assist</ulink>.</para>
<figure>
<title>Code Assist</title>
<mediaobject>
@@ -189,8 +188,8 @@
</figure>
</section>
- <para>Find more information about editor features <link linkend="editors_features"
- >here</link>.</para>
+ <para>Find more information about editor features <ulink url="../../jsf/html_single/index.html#editors_features"
+ >here</ulink>.</para>
</section>
@@ -311,8 +310,8 @@
</imageobject>
</mediaobject>
</figure>
- <para><link linkend="CodeAssistAndDynamicCodeAssist42BasedOnProjectData">Code
- assist</link> is available in the Source mode.</para>
+ <para><ulink url="../../jsf/html_single/index.html#CodeAssistAndDynamicCodeAssist42BasedOnProjectData">Code
+ assist</ulink> is available in the Source mode.</para>
<figure>
<title>Code Assist</title>
<mediaobject>
Modified: trunk/struts/docs/struts_tools_ref_guide/en/modules/projects.xml
===================================================================
--- trunk/struts/docs/struts_tools_ref_guide/en/modules/projects.xml 2008-04-10 13:56:37 UTC (rev 7485)
+++ trunk/struts/docs/struts_tools_ref_guide/en/modules/projects.xml 2008-04-10 14:02:22 UTC (rev 7486)
@@ -157,7 +157,7 @@
<title>Importing an Existing Struts Project with Any Structure</title>
<para>For detailed information on migration projects to JBoss Developer Studio see <ulink
- url="../../../Exadel-migration/en/html_single/index.html">Migration Guide</ulink>.</para>
+ url="../../Exadel-migration/html_single/index.html">Migration Guide</ulink>.</para>
</section>
<section id="AddingStrutsCapabilityToAnExistingWebApplication532">
@@ -228,7 +228,7 @@
</figure>
<para>When done, you will see the default Struts module configuration information. See how
- to Edit <link linkend="SupportForMultipleStrutsModules75">Struts modules</link>.</para>
+ to Edit <link linkend="modules">Struts modules</link>.</para>
<figure>
<title>Project Configuration Information</title>
Modified: trunk/struts/docs/struts_tools_tutorial/en/modules/introduction.xml
===================================================================
--- trunk/struts/docs/struts_tools_tutorial/en/modules/introduction.xml 2008-04-10 13:56:37 UTC (rev 7485)
+++ trunk/struts/docs/struts_tools_tutorial/en/modules/introduction.xml 2008-04-10 14:02:22 UTC (rev 7486)
@@ -11,7 +11,7 @@
</chapterinfo>
<title>Introduction</title>
<para>The following chapters describe how to deal with classic/old style of Struts development. We
- recommend users to use <ulink url="../../../seam/en/html/create_new_seam.html">JBoss
+ recommend users to use <ulink url="../../seam/html_single/index.html">JBoss
Seam</ulink> to simplify development, but until then you can read about classical Struts
usage here.</para>
</chapter>
Modified: trunk/struts/docs/struts_tools_tutorial/en/modules/struts_validation.xml
===================================================================
--- trunk/struts/docs/struts_tools_tutorial/en/modules/struts_validation.xml 2008-04-10 13:56:37 UTC (rev 7485)
+++ trunk/struts/docs/struts_tools_tutorial/en/modules/struts_validation.xml 2008-04-10 14:02:22 UTC (rev 7486)
@@ -262,6 +262,6 @@
<section id="OtherResource">
<?dbhtml filename="OtherResource.html"?>
<title>Other Resources</title>
- <para>You can also read <ulink url="../../../../../../jsf/docs/build/userguide/en/html/Struts.html">Struts</ulink> chapter in our "Visual Web Tools" guide for more information on this topic.</para>
+ <para>You can also read <ulink url="../../struts_tools_ref_guide/html_single/index.html">Struts Tools Reference Guide</ulink> for more information on this topic.</para>
</section>
</chapter>
\ No newline at end of file
18 years
JBoss Tools SVN: r7485 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-04-10 09:56:37 -0400 (Thu, 10 Apr 2008)
New Revision: 7485
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/SeamFindQuickAssistProcessor.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1814 Seam EL Hyper Links don't not recognize "var" attributes in JSF tags.
fixed
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java 2008-04-10 13:55:21 UTC (rev 7484)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java 2008-04-10 13:56:37 UTC (rev 7485)
@@ -193,7 +193,7 @@
if (seamProject == null)
return;
- List<ELOperandToken> tokens = findTokensAtOffset(document, selectionOffset);
+ List<ELOperandToken> tokens = SeamELCompletionEngine.findTokensAtOffset(document, selectionOffset);
if (tokens == null)
return; // No EL Operand found
@@ -208,48 +208,6 @@
return;
}
- /**
- * Returns list of Seam ELOperandToken which are placed under the cursor position
- *
- * @param document
- * @param offset
- * @return
- */
- public static List<ELOperandToken> findTokensAtOffset(IDocument document, int offset) {
- List<ELOperandToken> result = new ArrayList<ELOperandToken>();
-
- int elStart = getELStart(document, offset);
-
- if (elStart == -1)
- elStart = offset;
-
- SeamELOperandTokenizerForward tokenizer = new SeamELOperandTokenizerForward(document, elStart);
- List<ELOperandToken> tokens = tokenizer.getTokens();
-
- ELOperandToken lastSeparator = null;
- for (int i = 0; tokens != null && i < tokens.size(); i++) {
- ELOperandToken token = tokens.get(i);
- if (token.getType() == ELOperandToken.EL_SEPARATOR_TOKEN) {
- lastSeparator = token;
- continue;
- }
- if (token.getType() == ELOperandToken.EL_VARIABLE_NAME_TOKEN ||
- token.getType() == ELOperandToken.EL_METHOD_TOKEN ||
- token.getType() == ELOperandToken.EL_PROPERTY_NAME_TOKEN) {
- if (token.getStart() <= offset) {
- if (lastSeparator != null)
- result.add(lastSeparator);
- result.add(token);
- } else {
- // Stop processing. We're not interrested of the rest of tokens
- break;
- }
- }
- }
-
- return result;
- }
-
/**
* Finds the variable names for the selected ELOperandToken tokens
*
@@ -339,36 +297,6 @@
fDelegatorAction = action;
}
- /*
- * Scans the document from the offset to the beginning to find start of Seam EL operand
- * Returns the start position of first Seam EL operand token
- */
- private static int getELStart(IDocument document, int offset) {
- SeamELOperandTokenizer tokenizer = new SeamELOperandTokenizer(document, offset);
- List<ELOperandToken> tokens = tokenizer.getTokens();
-
- if (tokens == null || tokens.size() == 0)
- return -1;
-
- ELOperandToken firstToken = tokens.get(0);
- return firstToken.getStart();
- }
-
- /*
- * Scans the document from the offset to the beginning to find start of Seam EL operand
- * Returns the end position of last Seam EL operand token
- */
- private static int getELEnd(IDocument document, int offset) {
- SeamELOperandTokenizer tokenizer = new SeamELOperandTokenizerForward(document, offset);
- List<ELOperandToken> tokens = tokenizer.getTokens();
-
- if (tokens == null || tokens.size() == 0)
- return -1;
-
- ELOperandToken lastToken = tokens.get(tokens.size() - 1);
- return lastToken.getStart() + lastToken.getLength();
- }
-
private SeamSearchQuery createQuery(List<ELOperandToken> tokens, IFile sourceFile) throws JavaModelException, InterruptedException {
SeamSearchScope scope = new SeamSearchScope(new IProject[] {sourceFile.getProject()}, getLimitTo());
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/SeamFindQuickAssistProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/SeamFindQuickAssistProcessor.java 2008-04-10 13:55:21 UTC (rev 7484)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/SeamFindQuickAssistProcessor.java 2008-04-10 13:56:37 UTC (rev 7485)
@@ -36,6 +36,7 @@
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.el.ELOperandToken;
+import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
import org.jboss.tools.seam.ui.SeamGuiPlugin;
import org.jboss.tools.seam.ui.SeamUIMessages;
import org.jboss.tools.seam.ui.SeamUiImages;
@@ -80,7 +81,7 @@
}
private String[] getVariableNames(ISeamProject seamProject, IDocument document, int offset) {
- List<ELOperandToken> tokens = FindSeamAction.findTokensAtOffset(
+ List<ELOperandToken> tokens = SeamELCompletionEngine.findTokensAtOffset(
document,
offset);
@@ -109,7 +110,7 @@
if (seamProject == null)
return result;
- List<ELOperandToken> tokens = FindSeamAction.findTokensAtOffset(
+ List<ELOperandToken> tokens = SeamELCompletionEngine.findTokensAtOffset(
document,
context.getSelectionOffset());
if (tokens == null || tokens.size() == 0)
18 years
JBoss Tools SVN: r7484 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-04-10 09:55:21 -0400 (Thu, 10 Apr 2008)
New Revision: 7484
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1814 Seam EL Hyper Links don't not recognize "var" attributes in JSF tags.
fixed
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2008-04-10 13:55:14 UTC (rev 7483)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2008-04-10 13:55:21 UTC (rev 7484)
@@ -971,12 +971,12 @@
members = newMembers;
}
} else { // Last segment
- Set<IJavaElement> javaElements = new HashSet<IJavaElement>();
+ List<IJavaElement> javaElements = new ArrayList<IJavaElement>();
if (token.getType() == ELOperandToken.EL_VARIABLE_NAME_TOKEN ||
token.getType() == ELOperandToken.EL_PROPERTY_NAME_TOKEN ||
token.getType() == ELOperandToken.EL_METHOD_TOKEN) {
// return filtered methods + properties
- Set<TypeInfoCollector.MemberInfo> javaElementInfosToFilter = new HashSet<TypeInfoCollector.MemberInfo>();
+ List<TypeInfoCollector.MemberInfo> javaElementInfosToFilter = new ArrayList<TypeInfoCollector.MemberInfo>();
for (TypeInfoCollector.MemberInfo mbr : members) {
TypeInfoCollector infos = SeamExpressionResolver.collectTypeInfo(mbr);
javaElementInfosToFilter.addAll(infos.getMethods());
@@ -1014,4 +1014,77 @@
}
return res;
}
+
+ /**
+ * Returns list of Seam ELOperandToken which are placed under the cursor position
+ *
+ * @param document
+ * @param offset
+ * @return
+ */
+ public static List<ELOperandToken> findTokensAtOffset(IDocument document, int offset) {
+ List<ELOperandToken> result = new ArrayList<ELOperandToken>();
+
+ int elStart = getELStart(document, offset);
+
+ if (elStart == -1)
+ elStart = offset;
+
+ SeamELOperandTokenizerForward tokenizer = new SeamELOperandTokenizerForward(document, elStart);
+ List<ELOperandToken> tokens = tokenizer.getTokens();
+
+ ELOperandToken lastSeparator = null;
+ for (int i = 0; tokens != null && i < tokens.size(); i++) {
+ ELOperandToken token = tokens.get(i);
+ if (token.getType() == ELOperandToken.EL_SEPARATOR_TOKEN) {
+ lastSeparator = token;
+ continue;
+ }
+ if (token.getType() == ELOperandToken.EL_VARIABLE_NAME_TOKEN ||
+ token.getType() == ELOperandToken.EL_METHOD_TOKEN ||
+ token.getType() == ELOperandToken.EL_PROPERTY_NAME_TOKEN) {
+ if (token.getStart() <= offset) {
+ if (lastSeparator != null)
+ result.add(lastSeparator);
+ result.add(token);
+ } else {
+ // Stop processing. We're not interrested of the rest of tokens
+ break;
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /*
+ * Scans the document from the offset to the beginning to find start of Seam EL operand
+ * Returns the start position of first Seam EL operand token
+ */
+ private static int getELStart(IDocument document, int offset) {
+ SeamELOperandTokenizer tokenizer = new SeamELOperandTokenizer(document, offset);
+ List<ELOperandToken> tokens = tokenizer.getTokens();
+
+ if (tokens == null || tokens.size() == 0)
+ return -1;
+
+ ELOperandToken firstToken = tokens.get(0);
+ return firstToken.getStart();
+ }
+
+ /*
+ * Scans the document from the offset to the beginning to find start of Seam EL operand
+ * Returns the end position of last Seam EL operand token
+ */
+ private static int getELEnd(IDocument document, int offset) {
+ SeamELOperandTokenizer tokenizer = new SeamELOperandTokenizerForward(document, offset);
+ List<ELOperandToken> tokens = tokenizer.getTokens();
+
+ if (tokens == null || tokens.size() == 0)
+ return -1;
+
+ ELOperandToken lastToken = tokens.get(tokens.size() - 1);
+ return lastToken.getStart() + lastToken.getLength();
+ }
+
}
\ No newline at end of file
18 years
JBoss Tools SVN: r7483 - trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-04-10 09:55:14 -0400 (Thu, 10 Apr 2008)
New Revision: 7483
Modified:
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1814 Seam EL Hyper Links don't not recognize "var" attributes in JSF tags.
fixed
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java 2008-04-10 13:05:57 UTC (rev 7482)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java 2008-04-10 13:55:14 UTC (rev 7483)
@@ -14,7 +14,9 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlinkPartitioner;
@@ -27,7 +29,11 @@
import org.jboss.tools.common.text.ext.util.Utils;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.el.ELOperandToken;
+import org.jboss.tools.seam.internal.core.el.ELToken;
+import org.jboss.tools.seam.internal.core.el.ElVarSearcher;
import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
+import org.jboss.tools.seam.internal.core.el.ElVarSearcher.Var;
import org.jboss.tools.seam.text.ext.SeamExtPlugin;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
@@ -195,38 +201,13 @@
if (n == null || !(n instanceof Attr || n instanceof Text)) return null;
- int start = Utils.getValueStart(n);
- int end = Utils.getValueEnd(n);
- if(start < 0 || end < start || start > offset) return null;
+ List<ELOperandToken> tokens = SeamELCompletionEngine.findTokensAtOffset(document, offset);
+ if (tokens == null || tokens.size() == 0)
+ return null; // No EL Operand found
- String attrText = document.get(start, end - start);
-
- StringBuffer sb = new StringBuffer(attrText);
- //find start of bean property
- int bStart = offset - start;
- while (bStart >= 0) {
- if (!Character.isJavaIdentifierPart(sb.charAt(bStart)) &&
- sb.charAt(bStart) != '.' && sb.charAt(bStart) != '[' && sb.charAt(bStart) != ']'
- && sb.charAt(bStart) != '(' && sb.charAt(bStart) != ')') {
- bStart++;
- break;
- }
+ int propStart = tokens.get(0).getStart();
+ int propLength = tokens.get(tokens.size() - 1).getStart() + tokens.get(tokens.size() - 1).getLength() - propStart;
- if (bStart == 0) break;
- bStart--;
- }
- // find end of bean property
- int bEnd = offset - start;
- while (bEnd < sb.length()) {
- if (!Character.isJavaIdentifierPart(sb.charAt(bEnd)) &&
- sb.charAt(bEnd) != '.' && sb.charAt(bEnd) != '[' && sb.charAt(bEnd) != ']'
- && sb.charAt(bStart) != '(' && sb.charAt(bStart) != ')') break;
- bEnd++;
- }
-
- int propStart = bStart + start;
- int propLength = bEnd - bStart;
-
if (propStart > offset || propStart + propLength < offset) return null;
IHyperlinkRegion region = new HyperlinkRegion(propStart, propLength);
@@ -285,12 +266,75 @@
SeamELCompletionEngine engine= new SeamELCompletionEngine();
- String prefix= engine.getJavaElementExpression(document.get(), region.getOffset(), r);
- prefix = (prefix == null ? "" : prefix);
+ List<ELOperandToken> tokens = SeamELCompletionEngine.findTokensAtOffset(document, r.getOffset() + r.getLength());
+ if (tokens == null)
+ return null; // No EL Operand found
- List<IJavaElement> javaElements = engine.getJavaElementsForExpression(
- seamProject, file, prefix);
+ List<IJavaElement> javaElements = null;
+ try {
+ javaElements = engine.getJavaElementsForELOperandTokens(seamProject, file, tokens);
+ } catch (StringIndexOutOfBoundsException e) {
+ SeamExtPlugin.getPluginLog().logError(e);
+ return null;
+ } catch (BadLocationException e) {
+ SeamExtPlugin.getPluginLog().logError(e);
+ return null;
+ }
+ if (javaElements == null || javaElements.size() == 0) {
+ // Try to find a local Var (a pair of variable-value attributes)
+ ElVarSearcher varSearcher = new ElVarSearcher(seamProject, file, new SeamELCompletionEngine());
+ // Find a Var in the EL
+ int start = tokens.get(0).getStart();
+ int end = tokens.get(tokens.size() - 1).getStart() +
+ tokens.get(tokens.size() - 1).getLength();
+
+ StringBuffer elText = new StringBuffer();
+ for (ELOperandToken token : tokens) {
+ if (token.getType() == ELOperandToken.EL_VARIABLE_NAME_TOKEN ||
+ token.getType() == ELOperandToken.EL_PROPERTY_NAME_TOKEN ||
+ token.getType() == ELOperandToken.EL_METHOD_TOKEN ||
+ token.getType() == ELOperandToken.EL_SEPARATOR_TOKEN) {
+ elText.append(token.getText());
+ }
+ }
+
+ if (elText.length() == 0)
+ return null;
+
+ List<Var> allVars= ElVarSearcher.findAllVars(file, start);
+ Var var = varSearcher.findVarForEl(elText.toString(), allVars, true);
+ if (var == null) {
+ // Find a Var in the current offset assuming that it's a node with var/value attribute pair
+ var = ElVarSearcher.findVar(file, tokens.get(0).getStart());
+ }
+ if (var == null)
+ return null;
+
+ String resolvedValue = var.getValue();
+ if (resolvedValue == null || resolvedValue.length() == 0)
+ return null;
+ if (resolvedValue.startsWith("#{") || resolvedValue.startsWith("${"))
+ resolvedValue = resolvedValue.substring(2);
+ if (resolvedValue.endsWith("}"))
+ resolvedValue = resolvedValue.substring(0, resolvedValue.lastIndexOf("}"));
+
+ // Replace the Var with its resolved value in tokens (Var is always the first token)
+ elText = new StringBuffer();
+ elText.append(resolvedValue);
+ for (int i = 1; i < tokens.size(); i++) {
+ ELOperandToken token = tokens.get(i);
+ if (token.getType() == ELOperandToken.EL_VARIABLE_NAME_TOKEN ||
+ token.getType() == ELOperandToken.EL_PROPERTY_NAME_TOKEN ||
+ token.getType() == ELOperandToken.EL_METHOD_TOKEN ||
+ token.getType() == ELOperandToken.EL_SEPARATOR_TOKEN) {
+ elText.append(token.getText());
+ }
+ }
+
+ javaElements = engine.getJavaElementsForExpression(
+ seamProject, file, elText.toString());
+ }
return javaElements;
} catch (Exception x) {
SeamExtPlugin.getPluginLog().logError(x);
18 years
JBoss Tools SVN: r7482 - in trunk: documentation/guides and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: afedosik
Date: 2008-04-10 09:05:57 -0400 (Thu, 10 Apr 2008)
New Revision: 7482
Removed:
trunk/as/docs/resources/
trunk/documentation/guides/resources/
trunk/documentation/jboss-tools-docs/build.xml
trunk/hibernatetools/docs/resources/
trunk/jsf/docs/resources/
trunk/seam/docs/resources/
trunk/struts/docs/resources/
Log:
http://jira.jboss.com/jira/browse/JBDS-306 Unused resources files delete
Deleted: trunk/documentation/jboss-tools-docs/build.xml
===================================================================
--- trunk/documentation/jboss-tools-docs/build.xml 2008-04-10 12:54:18 UTC (rev 7481)
+++ trunk/documentation/jboss-tools-docs/build.xml 2008-04-10 13:05:57 UTC (rev 7482)
@@ -1,49 +0,0 @@
-<project default="build-documentation">
-
- <property name="build-dir" location="${basedir}/build"></property>
- <property name="root-dir" location="${basedir}/../.."></property>
-
- <target name="clean">
- <delete dir="${build-dir}" failonerror="false"></delete>
- </target>
-
- <target name="build-documentation" depends="clean">
-
-
- <mkdir dir="${build-dir}"/>
-
- <copy tofile="${build-dir}/index.html" overwrite="true" file="index.html"/>
- <subant>
- <property name="no.clean" value="true"></property>
- <property name="doc-root" location="${build-dir}"></property>
- <fileset dir="${root-dir}">
- <include name="*/docs/reference/build.xml"/>
- <include name="*/docs/userguide/build.xml"/>
- <include name="documentation/guides/build.xml"/>
- </fileset>
- <!--
- <filelist>
- <file name="${basedir}/../guides/build.xml"/>
- </filelist-->
- </subant>
- <!--antcall target="move"></antcall-->
- </target>
-
- <target name="move">
- <mkdir dir="${build-dir}/g"/>
- <move todir="${build-dir}/g" includeemptydirs="true">
- <fileset dir="${build-dir}">
- <include name="**/*"/>
- <exclude name="${build-dir}/g"/>
- </fileset>
- <mapper type="regexp" from="^(.*)/en/(.*)" to="\1/\2">
- </mapper>
- </move>
- <move todir="${build-dir}" includeemptydirs="yes">
- <fileset dir="${build-dir}/g">
- <include name="**/*"/>
- </fileset>
- </move>
- <delete dir="${build-dir}/g"></delete>
- </target>
-</project>
\ No newline at end of file
18 years