JBoss Tools SVN: r10399 - in trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui: dialogs and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-09-22 15:21:00 -0400 (Mon, 22 Sep 2008)
New Revision: 10399
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/ChangePortDialog.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java
Log:
JBIDE-2235 - ui for selecting ports in server editor
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2008-09-22 16:46:28 UTC (rev 10398)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2008-09-22 19:21:00 UTC (rev 10399)
@@ -63,8 +63,8 @@
public static String ServerDialogHeading;
public static String credentials_warning;
public static String credentials_save;
-
-
+
+
/* Module extension properties */
public static String ModulePropertyType;
public static String ModulePropertyProject;
@@ -116,12 +116,12 @@
public static String ActionDelegatePublishFailed;
public static String ActionDelegateFileResourcesOnly;
public static String ActionDelegateSelectServer;
-
+
/* Console */
public static String ConsoleResourceNotFound;
public static String ConsoleCouldNotLocateInWorkspace;
-
+
/* Twiddle Dialog */
public static String TwiddleDialog;
public static String TwiddleDialogExecute;
@@ -198,7 +198,7 @@
public static String DescriptorXPathComplex;
public static String DescriptorXPathMatch;
-
+
/* Filesets addition */
public static String FilesetsCreateFilter;
public static String FilesetsDeleteFilter;
@@ -209,11 +209,11 @@
public static String FilesetsNewName;
public static String FilesetsNewRootDir;
public static String FilesetsNewBrowse;
- public static String FilesetsNewIncludes;
- public static String FilesetsNewExcludes;
+ public static String FilesetsNewIncludes;
+ public static String FilesetsNewExcludes;
public static String FilesetsNewPreview;
-
-
+
+
/* Editor Strings */
public static String EditorSetDeployLabel;
public static String EditorSetTempDeployLabel;
@@ -232,29 +232,21 @@
public static String EditorChangeWebCommandName;
public static String EditorChangeUsernameCommandName;
public static String EditorChangePasswordCommandName;
- public static String EditorCPD_Name;
- public static String EditorCPD_XPath;
- public static String EditorCPD_Attribute;
- public static String EditorCPD_Count;
public static String EditorCPD_Value;
- public static String EditorCPD_Location;
- public static String EditorCPD_Default;
- public static String EditorCPD_NoDefault;
- public static String EditorCPD_SelectionDetails;
public static String EditorCPD_DefaultShellTitle;
public static String EditorCPD_DefaultDescription;
-
+
public static String Customize;
-
+
// misc
public static String ServerSaveFailed;
-
+
// Launch Config
public static String LaunchInvalidConfigChanged;
public static String LaunchInvalidHostChanged;
-
+
static {
NLS.initializeMessages(JBossServerUIPlugin.PLUGIN_ID + ".Messages",
Messages.class);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2008-09-22 16:46:28 UTC (rev 10398)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2008-09-22 19:21:00 UTC (rev 10399)
@@ -26,7 +26,7 @@
swf_NameInUse=Server name already in use
swf_DeployGroup=Deployment
swf_DeployEditorHeading=Deployment
-swf_DeploymentDescription=The temporary deployment location is where files will \nbe copied to before being renamed into the deploy directory. \nThis folder should be on the same file system \nas the deploy folder.
+swf_DeploymentDescription=The temporary deployment location is where files will \nbe copied to before being renamed into the deploy directory. \nThis folder should be on the same file system \nas the deploy folder.
swf_DeployDirectory=Deploy Directory
swf_TempDeployDirectory=Temporary Deploy Directory
sswf_Title=Create a new System Copy Server
@@ -85,7 +85,7 @@
ActionDelegateFileResourcesOnly=One or more selected objects are not Files.
ActionDelegateSelectServer=Select a server to publish to
-# Console
+# Console
ConsoleResourceNotFound=Resource not found
ConsoleCouldNotLocateInWorkspace=Could not locate {0} in workspace.
@@ -93,7 +93,7 @@
TwiddleDialog=Twiddle Dialog
TwiddleDialogExecute=Execute Twiddle
TwiddleDialogDone=Done
-TwiddleDialogArguments=Twiddle Arguments\:
+TwiddleDialogArguments=Twiddle Arguments\:
TwiddleDialogTutorial=Twiddle Tutorial
@@ -106,16 +106,16 @@
XPathNameInUse=Name already in use.
XPathColumnLocation=Location
XPathColumnAttributeVals=Value
-XPathName=Name\:
-XPathPattern=XPath Pattern\:
-XPathAttribute=Attribute Name\:
+XPathName=Name\:
+XPathPattern=XPath Pattern\:
+XPathAttribute=Attribute Name\:
#preference page
PreferencePageServerTimeouts=Server Timeouts
PreferencePageStartTimeouts=Start Timeout
PreferencePageStopTimeouts=Stop Timeout
-PreferencePageUponTimeout=Upon Timeout\:
+PreferencePageUponTimeout=Upon Timeout\:
PreferencePageUponTimeoutAbort=Abort Server Transition
PreferencePageUponTimeoutIgnore=Set Server State to Target State
@@ -129,27 +129,27 @@
JBoss Servers View. \n The enablement box designates whether the extension should be present.\
The weight field \ndesignates how "heavy" each extension is. (Heavier elements fall towards the bottom.)
-ViewExtensionPreferenceDescription=Below, you may set or clear any preferences specific to each view extension above. \nSome extensions may have no preferences to set.
+ViewExtensionPreferenceDescription=Below, you may set or clear any preferences specific to each view extension above. \nSome extensions may have no preferences to set.
# Upgrade Wizard
UpgradeWizardTitle=Convert JBoss AS Launch Configurations
- UpgradeWizardDescription=Starting and Stopping JBoss is no longer done through simple launch configurations.\nInstead, webtools and its server functionality is being used, which means your launch\nconfigurations must be converted into JBoss "servers" and "runtimes".\n\n This wizard will help with that.
+ UpgradeWizardDescription=Starting and Stopping JBoss is no longer done through simple launch configurations.\nInstead, webtools and its server functionality is being used, which means your launch\nconfigurations must be converted into JBoss "servers" and "runtimes".\n\n This wizard will help with that.
UpgradeWizardNoConvertableConfigs=You do not have any JBoss launch configurations to convert, so you can just skip this page.
- UpgradeWizardDetails=Details\:
- UpgradeWizardLaunchConfigName=Launch Configuration Name\:
- UpgradeWizardLaunchHomeDir=Home Directory\:
- UpgradeWizardLaunchJBossConfig=JBoss Configuration\:
- UpgradeWizardLaunchStartArgs=Start Args\:
- UpgradeWizardLaunchShutdownArgs=Shutdown Args\:
- UpgradeWizardLaunchJRE=JRE\:
+ UpgradeWizardDetails=Details\:
+ UpgradeWizardLaunchConfigName=Launch Configuration Name\:
+ UpgradeWizardLaunchHomeDir=Home Directory\:
+ UpgradeWizardLaunchJBossConfig=JBoss Configuration\:
+ UpgradeWizardLaunchStartArgs=Start Args\:
+ UpgradeWizardLaunchShutdownArgs=Shutdown Args\:
+ UpgradeWizardLaunchJRE=JRE\:
UpgradeWizardLaunchConvert=Convert?
UpgradeWizardLaunchConfigName2=Configuration Name
UpgradeWizardLaunchRuntimeName=Runtime Name
UpgradeWizardLaunchServerName=Server Name
UpgradeWizardLaunchMonitorMainTask=Converting Launch Configurations
- UpgradeWizardLaunchMonitorConverting=Converting
- UpgradeWizardLaunchRuntimeNamesInUse=The following runtime names are already in use\:
+ UpgradeWizardLaunchMonitorConverting=Converting
+ UpgradeWizardLaunchRuntimeNamesInUse=The following runtime names are already in use\:
UpgradeWizardLaunchServerNamesInUse=The following server names are already in use:
@@ -172,11 +172,11 @@
DescriptorXPathAttributeKeyValue=Attribute Key / Value
DescriptorXPathDescriptorValues=Descriptor Values
DescriptorXPathNameLocation=Name / Location
-DescriptorXPathServerName=Server Name\:
-DescriptorXPathPortCategory=Port Category\:
+DescriptorXPathServerName=Server Name\:
+DescriptorXPathPortCategory=Port Category\:
DescriptorXPathSimple=Show only xpath value in properties view.
DescriptorXPathComplex=Show all details in properties view.
-DescriptorXPathMatch=Match
+DescriptorXPathMatch=Match
#Filesets
@@ -186,11 +186,11 @@
FilesetsDeleteFile=Delete File
FilesetsEditFile=Edit File
FilesetsNewFileset=New File Filter
-FilesetsNewName=Name:
-FilesetsNewRootDir=Root Directory:
+FilesetsNewName=Name:
+FilesetsNewRootDir=Root Directory:
FilesetsNewBrowse=Browse...
-FilesetsNewIncludes=Includes:
-FilesetsNewExcludes=Excludes:
+FilesetsNewIncludes=Includes:
+FilesetsNewExcludes=Excludes:
FilesetsNewPreview=Preview
@@ -212,15 +212,7 @@
EditorChangeWebCommandName=Change Web Port Details
EditorChangeUsernameCommandName=Change Username
EditorChangePasswordCommandName=Change Password
-EditorCPD_Name=Name
-EditorCPD_XPath=XPath Pattern
-EditorCPD_Attribute=Attribute Name
-EditorCPD_Count=Number of Matches
-EditorCPD_Value=First Value
-EditorCPD_Location=File of first match
-EditorCPD_Default=The default xpath for {0} is "{1}".
-EditorCPD_NoDefault=There is no default xpath for {0}.
-EditorCPD_SelectionDetails=Selection Details
+EditorCPD_Value=Current Value
EditorCPD_DefaultShellTitle=Edit Port
EditorCPD_DefaultDescription=This wizard allows you to edit which xpath is used to locate a port used by the tooling.\nThis will not change any server files, only what ports are used to interact with it.
Customize=Customize...
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/ChangePortDialog.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/ChangePortDialog.java 2008-09-22 16:46:28 UTC (rev 10398)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/ChangePortDialog.java 2008-09-22 19:21:00 UTC (rev 10399)
@@ -9,7 +9,7 @@
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.osgi.util.NLS;
+import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
@@ -17,11 +17,10 @@
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Shell;
@@ -32,6 +31,7 @@
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
import org.jboss.ide.eclipse.as.ui.Messages;
+import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs.XPathDialog;
public class ChangePortDialog extends TitleAreaDialog {
@@ -43,26 +43,21 @@
public IServer server;
public String currentXPath;
}
-
+
private ChangePortDialogInfo info;
private String selected;
private XPathQuery currentQuery;
private boolean queriesLoaded = false;
private List listWidget;
- private Group group;
- private Label nameLabel; private Text nameValueLabel;
- private Label xpathLabel; private Text xpathValueLabel;
- private Label attributeLabel; private Text attributeValueLabel;
- private Label locationLabel; private Text locationValueLabel;
- private Label countLabel; private Text countValueLabel;
- private Label valueLabel; private Text valueValueLabel;
+ private Label currentValue;
+ private Text currentValueText;
+ private Button editXPathButton;
-
public ChangePortDialog(Shell parentShell, ChangePortDialogInfo info) {
super(parentShell);
this.info = info;
}
-
+
protected Control createDialogArea(Composite parent) {
Composite c = (Composite)super.createDialogArea(parent);
Composite main = new Composite(c, SWT.BORDER);
@@ -74,7 +69,7 @@
setTitle(info.port);
setMessage(info.description != null ? info.description
: Messages.EditorCPD_DefaultDescription);
- getShell().setText(info.shellTitle != null ? info.shellTitle
+ getShell().setText(info.shellTitle != null ? info.shellTitle
: Messages.EditorCPD_DefaultShellTitle);
return c;
}
@@ -87,61 +82,30 @@
d.bottom = new FormAttachment(100,-5);
d.right = new FormAttachment(0,150);
listWidget.setLayoutData(d);
-
- Label defaultLabel = new Label(main, SWT.NONE);
+
+ currentValue = new Label(main, SWT.NONE);
d = new FormData();
- d.right = new FormAttachment(100,-5);
- d.left = new FormAttachment(listWidget,5);
- d.bottom = new FormAttachment(100,-5);
- defaultLabel.setLayoutData(d);
-
- group = new Group(main, SWT.DEFAULT);
+ d.left = new FormAttachment(listWidget, 5);
+ d.top = new FormAttachment(0,7);
+ currentValue.setLayoutData(d);
+ currentValue.setText(Messages.EditorCPD_Value);
+
+ editXPathButton = new Button(main, SWT.NONE);
d = new FormData();
- d.right = new FormAttachment(100,-5);
- d.left = new FormAttachment(listWidget,5);
- d.bottom = new FormAttachment(defaultLabel,-5);
- d.top = new FormAttachment(0,5);
- group.setLayoutData(d);
+ d.right = new FormAttachment(100, -5);
+ d.top = new FormAttachment(currentValue, 5);
+ editXPathButton.setLayoutData(d);
+ editXPathButton.setText(Messages.DescriptorXPathEditXPath);
- GridLayout gl = new GridLayout(2, false);
- gl.marginRight = 5;
- group.setLayout(gl);
- GridData common = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
- nameLabel = new Label(group, SWT.NONE);
- nameValueLabel = new Text(group, SWT.DEFAULT | SWT.H_SCROLL);
- xpathLabel = new Label(group, SWT.NONE);
- xpathValueLabel = new Text(group, SWT.DEFAULT | SWT.H_SCROLL);
- attributeLabel = new Label(group, SWT.NONE);
- attributeValueLabel = new Text(group, SWT.DEFAULT | SWT.H_SCROLL);
- countLabel = new Label(group, SWT.NONE);
- countValueLabel = new Text(group, SWT.DEFAULT | SWT.H_SCROLL);
- valueLabel = new Label(group, SWT.NONE);
- valueValueLabel = new Text(group, SWT.DEFAULT | SWT.H_SCROLL);
- locationLabel = new Label(group, SWT.NONE);
- locationValueLabel = new Text(group, SWT.DEFAULT | SWT.H_SCROLL);
-
- nameValueLabel.setLayoutData(common);
- xpathValueLabel.setLayoutData(common);
- attributeValueLabel.setLayoutData(common);
- countValueLabel.setLayoutData(common);
- valueValueLabel.setLayoutData(common);
- locationValueLabel.setLayoutData(common);
-
- nameLabel.setText(Messages.EditorCPD_Name);
- xpathLabel.setText(Messages.EditorCPD_XPath);
- attributeLabel.setText(Messages.EditorCPD_Attribute);
- countLabel.setText(Messages.EditorCPD_Count);
- valueLabel.setText(Messages.EditorCPD_Value);
- locationLabel.setText(Messages.EditorCPD_Location);
- String defaultLabelText;
- if( info.defaultValue != null )
- defaultLabelText = NLS.bind(Messages.EditorCPD_Default, info.port, info.defaultValue);
- else
- defaultLabelText = NLS.bind(Messages.EditorCPD_NoDefault, info.port);
- defaultLabel.setText(defaultLabelText);
- group.setText(Messages.EditorCPD_SelectionDetails);
+ currentValueText = new Text(main, SWT.DEFAULT);
+ d = new FormData();
+ d.left = new FormAttachment(listWidget, 5);
+ d.right = new FormAttachment(editXPathButton,-5);
+ d.top = new FormAttachment(currentValue,5);
+ currentValueText.setLayoutData(d);
+ currentValueText.setEnabled(false);
}
-
+
protected void fillWidgets() {
ArrayList<String> list = new ArrayList<String>();
XPathCategory[] categories = XPathModel.getDefault().getCategories(info.server);
@@ -153,7 +117,7 @@
}
String[] stuff = (String[]) list.toArray(new String[list.size()]);
listWidget.setItems(stuff);
- for( int i = 0; i < stuff.length; i++ )
+ for( int i = 0; i < stuff.length; i++ )
if( stuff[i] == info.currentXPath)
listWidget.select(i);
}
@@ -166,11 +130,39 @@
public void widgetSelected(SelectionEvent e) {
selectionChanged();
} });
+
+ editXPathButton.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ public void widgetSelected(SelectionEvent e) {
+ editPressed();
+ } });
+
}
-
+
+ protected void editPressed() {
+ if( currentQuery != null ) {
+ XPathCategory category = currentQuery.getCategory();
+
+ XPathDialog d = new XPathDialog(Display.getCurrent().getActiveShell(),
+ info.server, category.getName(), currentQuery.getName());
+ d.setAttribute(currentQuery.getAttribute());
+ d.setXpath(currentQuery.getXpathPattern());
+
+ if( d.open() == Window.OK ) {
+ currentQuery.setAttribute(d.getAttribute());
+ currentQuery.setXpathPattern(d.getXpath());
+ currentQuery.setName(d.getName());
+ category.save();
+ fillWidgets();
+ }
+ }
+ }
+
protected synchronized void selectionChanged() {
- if( !queriesLoaded ) {
- try {
+ if( !queriesLoaded ) {
+ try {
final String[] items = listWidget.getItems();
ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell());
dialog.run(true, false, new IRunnableWithProgress() {
@@ -183,22 +175,22 @@
}
monitor.done();
queriesLoaded = true;
- Display.getDefault().asyncExec(new Runnable() {
+ Display.getDefault().asyncExec(new Runnable() {
public void run() {
selectionChanged2();
}
});
} });
- } catch( InvocationTargetException ite) {
+ } catch( InvocationTargetException ite) {
ite.printStackTrace();
- } catch(InterruptedException ie ) {
+ } catch(InterruptedException ie ) {
ie.printStackTrace();
}
} else {
selectionChanged2();
}
}
-
+
private void selectionChanged2() {
currentQuery = null;
int s = listWidget.getSelectionIndex();
@@ -207,26 +199,16 @@
currentQuery = XPathModel.getDefault().getQuery(info.server, new Path(selected));
}
if(currentQuery != null) {
- nameValueLabel.setText(safeString(currentQuery.getName()));
- xpathValueLabel.setText(safeString(currentQuery.getXpathPattern()));
- attributeValueLabel.setText(safeString(currentQuery.getAttribute()));
- locationValueLabel.setText(safeString(currentQuery.getBaseDir()));
- countValueLabel.setText(countMatches(currentQuery));
- valueValueLabel.setText(safeString(currentQuery.getFirstResult()));
+ editXPathButton.setEnabled(true);
+ currentValueText.setText(currentQuery.getFirstResult());
} else {
- nameValueLabel.setText(safeString(null));
- xpathValueLabel.setText(safeString(null));
- attributeValueLabel.setText(safeString(null));
- locationValueLabel.setText(safeString(null));
- countValueLabel.setText(safeString(null));
- valueValueLabel.setText(safeString(null));
}
}
-
+
private String countMatches(XPathQuery query) {
- if( query == null )
+ if( query == null )
return new Integer(-1).toString();
-
+
int count = 0;
XPathFileResult[] fResults = query.getResults();
for( int i = 0; i < fResults.length; i++ ) {
@@ -237,7 +219,7 @@
private String safeString(String s) {
return s == null ? "" : s;
}
-
+
public String getSelection() {
return selected;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java 2008-09-22 16:46:28 UTC (rev 10398)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java 2008-09-22 19:21:00 UTC (rev 10399)
@@ -87,7 +87,7 @@
private String currentText;
private IServer server;
private Label errorLabel;
-
+
public XPathCategoryDialog(Shell parentShell, IServer server) {
super(parentShell);
this.server = server;
@@ -96,17 +96,17 @@
this(parentShell, server);
this.initialName = initialName;
}
-
-
+
+
protected void configureShell(Shell shell) {
super.configureShell(shell);
shell.setText(Messages.XPathNewCategory);
}
-
+
protected Control createDialogArea(Composite parent) {
Composite c = (Composite)super.createDialogArea(parent);
c.setLayout(new FormLayout());
-
+
errorLabel = new Label(c, SWT.NONE);
errorLabel.setText(Messages.XPathNewCategoryNameInUse);
FormData errorData = new FormData();
@@ -114,7 +114,7 @@
errorData.top = new FormAttachment(0,5);
errorLabel.setLayoutData(errorData);
errorLabel.setVisible(false);
-
+
Label l = new Label(c, SWT.NONE);
l.setText(Messages.XPathCategoryName);
FormData labelData = new FormData();
@@ -122,8 +122,8 @@
labelData.top = new FormAttachment(errorLabel,5);
l.setLayoutData(labelData);
-
- final Text t = new Text(c, SWT.BORDER);
+
+ final Text t = new Text(c, SWT.BORDER);
FormData tData = new FormData();
tData.left = new FormAttachment(l,5);
tData.top = new FormAttachment(errorLabel,5);
@@ -133,16 +133,16 @@
if( currentText != null ) {
t.setText(currentText);
}
-
+
t.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
verifyText(t.getText());
- }
+ }
});
-
+
return c;
}
-
+
private void verifyText(String text) {
boolean valid = !XPathModel.getDefault().containsCategory(server, text) || (initialName != null && initialName.equals(text));
if( valid ) {
@@ -154,7 +154,7 @@
getButton(IDialogConstants.OK_ID).setEnabled(false);
}
}
-
+
public String getText() {
return currentText;
}
@@ -167,21 +167,21 @@
protected Combo categoryCombo, serverCombo;
protected Label nameLabel, serverLabel, categoryLabel, xpathLabel, attributeLabel;
protected Button previewButton;
-
+
protected XPathProposalProvider proposalProvider;
-
+
protected IServer server;
protected String name, xpath, attribute, category;
protected String originalName = null;
protected XPathQuery original = null;
protected int previewId = 48879;
-
+
protected Tree previewTree;
protected TreeColumn column, column2;
protected TreeViewer previewTreeViewer;
protected Composite main;
protected XMLDocumentRepository repository;
-
+
public XPathDialog(Shell parentShell) {
this(parentShell, null);
}
@@ -210,7 +210,7 @@
int ret = super.getShellStyle();
return ret | SWT.RESIZE;
}
-
+
protected void createButtonsForButtonBar(Composite parent) {
// create OK and Cancel buttons by default
super.createButtonsForButtonBar(parent);
@@ -220,7 +220,7 @@
checkErrors();
}
-
+
protected Control createDialogArea(Composite parent) {
main = (Composite)super.createDialogArea(parent);
main.setLayout(new FormLayout());
@@ -229,15 +229,15 @@
if( name != null ) nameText.setText(name);
if( attribute != null ) attributeText.setText(attribute);
if( xpath != null ) xpathText.setText(xpath);
-
+
proposalProvider = new XPathProposalProvider(repository);
- if( server != null )
+ if( server != null )
proposalProvider.setPath(getConfigFolder(server));
ContentProposalAdapter adapter = new
ContentProposalAdapter(xpathText, new TextContentAdapter(),
proposalProvider, null, null);
adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
-
+
XPathAttributeProposalProvider provider2 = new XPathAttributeProposalProvider(repository, xpathText);
if( server != null )
provider2.setPath(getConfigFolder(server));
@@ -245,10 +245,10 @@
ContentProposalAdapter(attributeText, new TextContentAdapter(),
provider2, null, null);
adapter2.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
-
+
return main;
- }
-
+ }
+
protected void fillCombos() {
if( serverCombo != null ) {
IServer servers[] = ServerConverter.getJBossServersAsIServers();
@@ -258,39 +258,39 @@
}
serverCombo.setItems(names);
}
-
- if( categoryCombo != null ) {
+
+ if( categoryCombo != null ) {
refreshCategoryCombo();
}
}
-
+
protected void addListeners() {
nameText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
checkErrors();
name = nameText.getText();
- }
+ }
});
attributeText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
attribute = attributeText.getText();
- }
+ }
});
xpathText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
xpath = xpathText.getText();
- }
+ }
});
-
+
previewButton.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
}
public void widgetSelected(SelectionEvent e) {
previewPressed();
- }
+ }
});
-
-
+
+
if( serverCombo != null ) {
serverCombo.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
@@ -305,16 +305,16 @@
return;
}
}
- }
+ }
});
}
-
+
if( categoryCombo != null ) {
categoryCombo.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
category = categoryCombo.getText();
checkErrors();
- }
+ }
});
categoryCombo.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
@@ -326,17 +326,17 @@
});
}
}
-
-
+
+
protected void checkErrors() {
ArrayList<String> errorList = getErrors();
- if( errorList.size() == 0 ) {
- setError(null);
+ if( errorList.size() == 0 ) {
+ setError(null);
getButton(IDialogConstants.OK_ID).setEnabled(true);
- return;
+ return;
}
setError(errorList.get(0));
- if( getButton(IDialogConstants.OK_ID) != null )
+ if( getButton(IDialogConstants.OK_ID) != null )
getButton(IDialogConstants.OK_ID).setEnabled(false);
return;
}
@@ -347,19 +347,19 @@
String categoryError = getCategoryError(); if( categoryError != null ) list.add(categoryError);
return list;
}
-
+
protected String getServerError() {
if( server == null ) return "Please Select a Server";
return null;
}
-
+
protected String getCategoryError() {
if( "".equals(category)) {
return "Category must not be blank";
}
return null;
}
-
+
protected void setError(String message) {
if( message == null ) {
errorImage.setVisible(false);
@@ -371,7 +371,7 @@
errorLabel.setText(message);
}
}
-
+
protected String getNameError() {
if( nameText.getText().equals("")) {
return Messages.XPathNameEmpty;
@@ -380,7 +380,7 @@
XPathCategory[] categories = XPathModel.getDefault().getCategories(server);
XPathCategory category = null;
for( int i = 0; i < categories.length; i++ ) {
- if( categories[i].getName().equals(this.category))
+ if( categories[i].getName().equals(this.category))
category = categories[i];
}
if( category != null ) {
@@ -388,8 +388,8 @@
boolean found = false;
for( int i = 0; i < queries.length; i++ ) {
if(nameText.getText().equals( ((XPathQuery)queries[i]).getName())) {
-
- if( originalName == null || !nameText.getText().equals(originalName))
+
+ if( originalName == null || !nameText.getText().equals(originalName))
return Messages.XPathNameInUse;
}
}
@@ -397,14 +397,14 @@
return null;
}
-
+
protected void setServer(IServer s) {
server = s;
proposalProvider.setPath(getConfigFolder(s));
refreshCategoryCombo();
checkErrors();
}
-
+
protected void refreshCategoryCombo() {
if( server != null ) {
XPathCategory[] categories = XPathModel.getDefault().getCategories(server);
@@ -415,21 +415,22 @@
categoryCombo.setItems(categoryNames);
}
}
-
+
protected void previewPressed() {
if( server == null ) {
checkErrors();
return;
}
-
+
+ final String xpText = xpathText.getText();
+ final String attText = attributeText.getText();
IRunnableWithProgress op = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- final IProgressMonitor monitor2 = monitor;
- XPathQuery tmp = new XPathQuery("", getConfigFolder(server), null, xpathText.getText(), attributeText.getText());
+ XPathQuery tmp = new XPathQuery("", getConfigFolder(server), null, xpText, attText);
tmp.setRepository(repository);
final ArrayList<XPathFileResult> list = new ArrayList<XPathFileResult>();
list.addAll(Arrays.asList(tmp.getResults()));
- Display.getDefault().asyncExec(new Runnable() {
+ Display.getDefault().asyncExec(new Runnable() {
public void run() {
previewTreeViewer.setInput(list);
if( list.size() == 0 ) {
@@ -447,7 +448,7 @@
}
};
try {
- new ProgressMonitorDialog(new Shell()).run(false, true, op);
+ new ProgressMonitorDialog(new Shell()).run(true, true, op);
} catch (InvocationTargetException e) {
} catch (InterruptedException e) {
}
@@ -455,25 +456,25 @@
protected void layoutWidgets(Composite c) {
// create widgets
descriptionLabel = new Label(c, SWT.WRAP);
- descriptionLabel.setText("An XPath is a way to find a specific XML element inside an xml file. \n" +
+ descriptionLabel.setText("An XPath is a way to find a specific XML element inside an xml file. \n" +
"This dialog will help you create one. These XPaths' values can then be modified\n"
+ "by using the JBoss Servers View with the Properties View.");
descriptionLabel.setVisible(true);
errorLabel = new Label(c, SWT.NONE);
errorImage = new Label(c, SWT.NONE);
errorImage.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK));
-
-
+
+
Composite middleComposite = createMiddleComposite(c);
-
-
+
+
// Now do the tree and viewer
previewTree = new Tree(c, SWT.BORDER);
previewTree.setHeaderVisible(true);
previewTree.setLinesVisible(true);
column = new TreeColumn(previewTree, SWT.NONE);
column2 = new TreeColumn(previewTree, SWT.NONE);
-
+
column.setText(Messages.XPathColumnLocation);
column2.setText(Messages.XPathColumnAttributeVals);
@@ -485,35 +486,35 @@
c.layout();
int pixel = Math.max(Math.max(nameLabel.getSize().x, xpathLabel.getSize().x), attributeLabel.getSize().x);
pixel += 5;
-
+
// Lay them out
FormData descriptionData = new FormData();
descriptionData.left = new FormAttachment(0, 5);
descriptionData.right = new FormAttachment(100, -5);
descriptionData.top = new FormAttachment(0,5);
descriptionLabel.setLayoutData(descriptionData);
-
+
FormData errorData = new FormData();
errorData.left = new FormAttachment(errorImage,5);
errorData.top = new FormAttachment(descriptionLabel,5);
errorData.right = new FormAttachment(0,300);
errorLabel.setLayoutData(errorData);
errorLabel.setVisible(false);
-
+
FormData errorImageData = new FormData();
errorImageData.left = new FormAttachment(0,5);
errorImageData.top = new FormAttachment(descriptionLabel,5);
errorImage.setLayoutData(errorImageData);
errorImage.setVisible(false);
-
-
+
+
FormData middleCompositeData = new FormData();
middleCompositeData.left = new FormAttachment(0,5);
middleCompositeData.right = new FormAttachment(100, -5);
middleCompositeData.top = new FormAttachment(errorLabel, 5);
middleComposite.setLayoutData(middleCompositeData);
-
+
// Tree layout data
FormData previewTreeData = new FormData();
previewTreeData.left = new FormAttachment(0,5);
@@ -521,20 +522,20 @@
previewTreeData.top = new FormAttachment(middleComposite,5);
previewTreeData.bottom = new FormAttachment(100,-5);
previewTree.setLayoutData(previewTreeData);
-
+
previewTreeViewer.setContentProvider(new ITreeContentProvider() {
public Object[] getChildren(Object parentElement) {
// we're a leaf
- if( parentElement instanceof XPathResultNode )
+ if( parentElement instanceof XPathResultNode )
return new Object[0];
-
- // we're a file node (blah.xml)
+
+ // we're a file node (blah.xml)
if( parentElement instanceof XPathFileResult ) {
- if( ((XPathFileResult)parentElement).getChildren().length > 1 )
+ if( ((XPathFileResult)parentElement).getChildren().length > 1 )
return ((XPathFileResult)parentElement).getChildren();
return new Object[0];
}
-
+
// we're the named element (JNDI)
if( parentElement instanceof XPathQuery ) {
XPathFileResult[] kids = ((XPathQuery)parentElement).getResults();
@@ -563,34 +564,34 @@
}
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
+ }
+
});
-
+
previewTreeViewer.setLabelProvider(new XPathPropertyLabelProvider());
-
+
}
protected Composite createMiddleComposite(Composite c) {
Composite gridComposite = new Composite(c, SWT.NONE);
gridComposite.setLayout(new GridLayout(2, false));
-
+
nameLabel = new Label(gridComposite, SWT.NONE);
nameText= new Text(gridComposite, SWT.BORDER);
nameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
-
+
if( server == null ) {
serverLabel = new Label(gridComposite, SWT.NONE);
serverCombo = new Combo(gridComposite, SWT.BORDER | SWT.READ_ONLY);
serverCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
}
-
+
if( category == null ) {
categoryLabel = new Label(gridComposite, SWT.NONE);
categoryCombo = new Combo(gridComposite, SWT.BORDER);
categoryCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
}
-
+
xpathLabel = new Label(gridComposite, SWT.NONE);
xpathText = new Text(gridComposite, SWT.BORDER);
xpathText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
@@ -607,7 +608,7 @@
attributeLabel.setText(Messages.XPathAttribute);
return gridComposite;
}
-
+
public String getAttribute() {
return attribute;
}
@@ -619,7 +620,7 @@
public String getXpath() {
return xpath;
}
-
+
public String getCategory() {
return category;
}
@@ -645,7 +646,7 @@
xpathText.setText(this.xpath);
}
}
-
+
public static class XPathAttributeProposalProvider extends XPathProposalProvider {
private Text elementText;
public XPathAttributeProposalProvider(XMLDocumentRepository repo, Text elementText) {
@@ -656,7 +657,7 @@
String[] strings = getAttributeNameProposalStrings(elementText.getText(), contents.trim());
return convertProposals(strings);
}
-
+
public String[] getAttributeNameProposalStrings(String parentPath, String remainder) {
ArrayList<String> names = new ArrayList<String>();
XPathResultNode[] items = getXPath(parentPath);
@@ -664,14 +665,14 @@
for( int i = 0; i < items.length; i++ ) {
attributes = items[0].getElementAttributeNames();
for( int j = 0; j < attributes.length; j++ ) {
- if( attributes[j].startsWith(remainder) && !names.contains(attributes[j]))
+ if( attributes[j].startsWith(remainder) && !names.contains(attributes[j]))
names.add(attributes[j]);
}
}
return names.toArray(new String[names.size()]);
}
}
-
+
public static class XPathProposalProvider implements IContentProposalProvider {
protected static final int NEW_ELEMENT = 1;
@@ -681,25 +682,25 @@
protected static final int IN_ATTRIBUTE = 5;
protected static final int IN_ATTRIBUTE_VALUE = 6;
protected static final int CLOSE_ATTRIBUTE = 7;
-
+
private String path;
private HashMap<String, ArrayList<XPathResultNode>> xpathCache;
protected XMLDocumentRepository repository;
-
+
public XPathProposalProvider(XMLDocumentRepository repository) {
xpathCache = new HashMap<String, ArrayList<XPathResultNode>>();
this.repository = repository;
}
-
+
public void setPath(String path) {
this.path = path;
}
-
+
public IContentProposal[] getProposals(String contents, int position) {
if( contents.equals("") || contents.equals("/") || contents.equals(" ")) {
return new IContentProposal[] { new XPathContentProposal("/server/", "/server/".length(), null, null)};
}
-
+
int type = getType(contents);
if( type == NEW_ELEMENT ) return getElementProposals(contents, "");
if( type == IN_ELEMENT ) return getElementProposals(contents);
@@ -709,11 +710,11 @@
if( type == IN_ATTRIBUTE_VALUE ) return getAttributeValueProposals(contents);
return new IContentProposal[]{};
}
-
+
protected XPathResultNode[] getXPath(String xpath) {
- if( path == null )
+ if( path == null )
return new XPathResultNode[0];
-
+
if( xpathCache.containsKey(xpath)) {
ArrayList list = xpathCache.get(xpath);
return (XPathResultNode[]) list.toArray(new XPathResultNode[list.size()]);
@@ -732,18 +733,18 @@
xpathCache.put(xpath, list);
return list.toArray(new XPathResultNode[list.size()]);
}
-
+
public IContentProposal[] getElementProposals(String path) {
String parentPath = path.substring(0, path.lastIndexOf('/') + 1);
String prefix = path.substring(path.lastIndexOf('/') + 1);
return getElementProposals(parentPath, prefix);
}
-
+
public IContentProposal[] getElementProposals(String parentPath, String elementPrefix ) {
String[] strings = getElementProposalStrings(parentPath, elementPrefix );
return convertProposals(strings);
}
-
+
public String[] getElementProposalStrings(String parentPath, String elementPrefix) {
TreeSet<String> set = new TreeSet<String>();
XPathResultNode[] items = getXPath(parentPath + "*");
@@ -758,14 +759,14 @@
}
return set.toArray(new String[set.size()]);
}
-
+
public IContentProposal[] getAttributeNameProposals(String path) {
String parent = path.substring(0, path.lastIndexOf('['));
int attName = path.lastIndexOf('[') > path.lastIndexOf('@') ? path.lastIndexOf('[') : path.lastIndexOf('@');
String[] props = getAttributeNameProposalStrings(parent, path.substring(attName+1));
return convertProposals(props);
}
-
+
public IContentProposal[] getAttributeNameProposals(String parentPath, String remainder) {
return convertProposals(getAttributeNameProposalStrings(parentPath, remainder));
}
@@ -777,18 +778,18 @@
for( int i = 0; i < items.length; i++ ) {
attributes = items[0].getElementAttributeNames();
for( int j = 0; j < attributes.length; j++ ) {
- if( attributes[j].startsWith(remainder) && !names.contains(attributes[j]))
+ if( attributes[j].startsWith(remainder) && !names.contains(attributes[j]))
names.add(attributes[j]);
}
}
-
+
String[] results = new String[names.size()];
for( int i = 0; i < results.length; i++ ) {
results[i] = parentPath + "[@" + names.get(i) + "=";
}
return results;
}
-
+
public IContentProposal[] getAttributeValueProposals(String path) {
return getAttributeValueProposals(path.substring(0, path.lastIndexOf('=')), path.substring(path.lastIndexOf('=')+1));
}
@@ -807,11 +808,11 @@
for( int i = 0; i < items.length; i++ ) {
attributes = items[i].getElementAttributeValues(attName);
for( int j = 0; j < attributes.length; j++ ) {
- if( attributes[j].startsWith(remainder) && !values.contains(attributes[j]))
+ if( attributes[j].startsWith(remainder) && !values.contains(attributes[j]))
values.add(attributes[j]);
}
}
-
+
String[] results = new String[values.size()];
String prefix = parentElementPath + "[@" + attName + "='";
for( int i = 0; i < results.length; i++ ) {
@@ -820,7 +821,7 @@
Arrays.sort(results);
return convertProposals(results);
}
-
+
public int getType(String contents) {
switch(contents.charAt(contents.length()-1)) {
case '/':
@@ -837,7 +838,7 @@
int lastOpenBracket = contents.lastIndexOf('['); max = (lastOpenBracket > max ? lastOpenBracket : max);
int lastCloseBracket = contents.lastIndexOf(']'); max = (lastCloseBracket > max ? lastCloseBracket : max);
int lastEquals = contents.lastIndexOf('='); max = (lastEquals > max ? lastEquals : max);
-
+
if( max == lastSlash ) return IN_ELEMENT;
if( max == lastOpenBracket ) return IN_ATTRIBUTE;
if( max == lastCloseBracket ) return CLOSE_ATTRIBUTE;
@@ -846,7 +847,7 @@
}
return -1;
}
-
+
public IContentProposal[] convertProposals(String[] strings) {
ArrayList<XPathContentProposal> list = new ArrayList<XPathContentProposal>();
for( int i = 0; i < strings.length; i++ ) {
@@ -854,7 +855,7 @@
}
return list.toArray(new IContentProposal[list.size()]);
}
-
+
public class XPathContentProposal implements IContentProposal {
private String content,description,label;
private int position;
@@ -881,7 +882,7 @@
}
}
}
-
+
public static String getConfigFolder(IServer server) {
JBossServer jbs = (JBossServer)server.loadAdapter(JBossServer.class, new NullProgressMonitor());
if( jbs != null ) {
15 years, 9 months
JBoss Tools SVN: r10398 - in trunk: documentation/guides/Exadel-migration/en/images and 10 other directories.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2008-09-22 12:46:28 -0400 (Mon, 22 Sep 2008)
New Revision: 10398
Modified:
trunk/as/docs/reference/en/images/new.png
trunk/as/docs/reference/en/images/updated.png
trunk/documentation/guides/Exadel-migration/en/images/new.png
trunk/documentation/guides/Exadel-migration/en/images/updated.png
trunk/documentation/guides/GettingStartedGuide/en/images/new.png
trunk/documentation/guides/GettingStartedGuide/en/images/updated.png
trunk/esb/docs/esb_ref_guide/en/images/new.png
trunk/esb/docs/esb_ref_guide/en/images/updated.png
trunk/jbpm/docs/reference/en/images/new.png
trunk/jbpm/docs/reference/en/images/updated.png
trunk/jsf/docs/jsf_tools_ref_guide/en/images/new.png
trunk/jsf/docs/jsf_tools_ref_guide/en/images/updated.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/new.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/updated.png
trunk/jsf/docs/userguide/en/images/new.png
trunk/jsf/docs/userguide/en/images/updated.png
trunk/portlet/docs/reference/en/images/new.png
trunk/portlet/docs/reference/en/images/updated.png
trunk/seam/docs/reference/en/images/new.png
trunk/seam/docs/reference/en/images/updated.png
trunk/struts/docs/struts_tools_ref_guide/en/images/new.png
trunk/struts/docs/struts_tools_ref_guide/en/images/updated.png
trunk/struts/docs/struts_tools_tutorial/en/images/new.png
trunk/struts/docs/struts_tools_tutorial/en/images/updated.png
Log:
https://jira.jboss.org/jira/browse/JBDS-320
markers font is improved
Modified: trunk/as/docs/reference/en/images/new.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en/images/updated.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/guides/Exadel-migration/en/images/new.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/guides/Exadel-migration/en/images/updated.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/guides/GettingStartedGuide/en/images/new.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/guides/GettingStartedGuide/en/images/updated.png
===================================================================
(Binary files differ)
Modified: trunk/esb/docs/esb_ref_guide/en/images/new.png
===================================================================
(Binary files differ)
Modified: trunk/esb/docs/esb_ref_guide/en/images/updated.png
===================================================================
(Binary files differ)
Modified: trunk/jbpm/docs/reference/en/images/new.png
===================================================================
(Binary files differ)
Modified: trunk/jbpm/docs/reference/en/images/updated.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/jsf_tools_ref_guide/en/images/new.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/jsf_tools_ref_guide/en/images/updated.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/jsf_tools_tutorial/en/images/new.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/jsf_tools_tutorial/en/images/updated.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/new.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/updated.png
===================================================================
(Binary files differ)
Modified: trunk/portlet/docs/reference/en/images/new.png
===================================================================
(Binary files differ)
Modified: trunk/portlet/docs/reference/en/images/updated.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en/images/new.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en/images/updated.png
===================================================================
(Binary files differ)
Modified: trunk/struts/docs/struts_tools_ref_guide/en/images/new.png
===================================================================
(Binary files differ)
Modified: trunk/struts/docs/struts_tools_ref_guide/en/images/updated.png
===================================================================
(Binary files differ)
Modified: trunk/struts/docs/struts_tools_tutorial/en/images/new.png
===================================================================
(Binary files differ)
Modified: trunk/struts/docs/struts_tools_tutorial/en/images/updated.png
===================================================================
(Binary files differ)
15 years, 9 months
JBoss Tools SVN: r10397 - in trunk: jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-09-22 12:23:36 -0400 (Mon, 22 Sep 2008)
New Revision: 10397
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCheckboxSelectItemTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOptionSelectItemTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfRadioSelectItemTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectManyListbox.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfVerbatim.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/NodesManagingUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2797
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCheckboxSelectItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCheckboxSelectItemTemplate.java 2008-09-22 14:22:21 UTC (rev 10396)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCheckboxSelectItemTemplate.java 2008-09-22 16:23:36 UTC (rev 10397)
@@ -14,6 +14,7 @@
import org.jboss.tools.vpe.editor.VpeSourceDomBuilder;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
@@ -75,7 +76,7 @@
input.setAttribute(HTML.ATTR_DIR, dir);
}
- if (attrPresents(disabled) && "true".equalsIgnoreCase(disabled)) { //$NON-NLS-1$
+ if (attrPresents(disabled) && Constants.TRUE.equalsIgnoreCase(disabled)) {
label.setAttribute(HTML.ATTR_CLASS, disabledClass);
} else if (attrPresents(enabledClass)) {
label.setAttribute(HTML.ATTR_CLASS, enabledClass);
@@ -100,7 +101,7 @@
* @return true, if successful
*/
private boolean attrPresents(String attr) {
- return ((null != attr) && (!"".equals(attr))); //$NON-NLS-1$
+ return ((null != attr) && (attr.length() != 0));
}
/**
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOptionSelectItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOptionSelectItemTemplate.java 2008-09-22 14:22:21 UTC (rev 10396)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOptionSelectItemTemplate.java 2008-09-22 16:23:36 UTC (rev 10397)
@@ -35,8 +35,6 @@
*/
public class JsfOptionSelectItemTemplate extends AbstractOutputJsfTemplate /* VpeAbstractTemplate */{
- public static final String EMPTY_STRING = ""; //$NON-NLS-1$
-
/* "escape" attribute of f:selectItem */
private String escape;
@@ -101,7 +99,7 @@
// if escape then contents of value (or other attribute) is only
// text
if (!sourceElement.hasAttribute(JSF.ATTR_ESCAPE)
- || Constants.TRUE.equalsIgnoreCase(sourceElement //$NON-NLS-1$
+ || Constants.TRUE.equalsIgnoreCase(sourceElement
.getAttribute(JSF.ATTR_ESCAPE))) {
String value = outputAttr.getNodeValue();
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfRadioSelectItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfRadioSelectItemTemplate.java 2008-09-22 14:22:21 UTC (rev 10396)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfRadioSelectItemTemplate.java 2008-09-22 16:23:36 UTC (rev 10397)
@@ -16,6 +16,7 @@
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
@@ -44,9 +45,6 @@
// style of span
private static final String SPAN_STYLE_VALUE = "-moz-user-modify: read-write;"; //$NON-NLS-1$
- private static final String CONSTANT_TRUE = "true"; //$NON-NLS-1$
- private static final String CONSTANT_EMPTY = ""; //$NON-NLS-1$
-
private String dir;
/**
@@ -77,10 +75,10 @@
table.setAttribute(HTML.ATTR_TITLE, getTitle(sourceNode));
nsIDOMElement radio = visualDocument.createElement(HTML.TAG_INPUT);
if (disabledItem)
- radio.setAttribute(ITEM_DISABLED, CONSTANT_TRUE);
+ radio.setAttribute(ITEM_DISABLED, Constants.TRUE);
nsIDOMElement label = visualDocument.createElement(HTML.TAG_LABEL);
if (disabledItem)
- label.setAttribute(ITEM_DISABLED, CONSTANT_TRUE);
+ label.setAttribute(ITEM_DISABLED, Constants.TRUE);
table.appendChild(radio);
table.appendChild(label);
@@ -169,7 +167,7 @@
* @return true, if successful
*/
private boolean attrPresents(String attr) {
- return ((null != attr) && (!CONSTANT_EMPTY.equals(attr)));
+ return ((null != attr) && (attr.length()!=0));
}
@Override
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectManyListbox.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectManyListbox.java 2008-09-22 14:22:21 UTC (rev 10396)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectManyListbox.java 2008-09-22 16:23:36 UTC (rev 10397)
@@ -11,7 +11,10 @@
package org.jboss.tools.jsf.vpe.jsf.template;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
+import java.util.Set;
import org.jboss.tools.jsf.vpe.jsf.template.util.JSF;
import org.jboss.tools.vpe.editor.context.VpePageContext;
@@ -47,13 +50,14 @@
/**
* list of copied attributes
*/
- private static List<String> ATTR_LIST_COPY = new ArrayList<String>();
+ private static Map<String, String> ATTR_LIST_COPY = new HashMap<String, String>();
static {
- ATTR_LIST_COPY.add("style"); //$NON-NLS-1$
- ATTR_LIST_COPY.add("styleClass"); //$NON-NLS-1$
+ ATTR_LIST_COPY.put(JSF.ATTR_STYLE, HTML.ATTR_STYLE);
+ ATTR_LIST_COPY.put(JSF.ATTR_STYLE_CLASS, HTML.ATTR_CLASS);
}
+
/**
*
*/
@@ -79,14 +83,17 @@
Element element = (Element) sourceNode;
// import attributes from source
- for (String attributeName : ATTR_LIST_COPY) {
+ Set<String> jsfAttributes = ATTR_LIST_COPY.keySet();
+ for (String attributeName : jsfAttributes) {
+
// get attribute
String attr = element.getAttribute(attributeName);
// add attribute to "select"
- if (attr != null)
- select.setAttribute(HTML.ATTR_STYLE, attr);
+ if (attr != null) {
+ select.setAttribute(ATTR_LIST_COPY.get(attributeName), attr);
+ }
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfVerbatim.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfVerbatim.java 2008-09-22 14:22:21 UTC (rev 10396)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfVerbatim.java 2008-09-22 16:23:36 UTC (rev 10397)
@@ -18,7 +18,7 @@
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.HTML;
-import org.jboss.tools.vpe.editor.util.TemplateManagingUtil;
+import org.jboss.tools.vpe.editor.util.NodesManagingUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Element;
@@ -34,8 +34,10 @@
/*
* (non-Javadoc)
*
- * @see org.jboss.tools.vpe.editor.template.VpeTemplate#create(org.jboss.tools.vpe.editor.context.VpePageContext,
- * org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMDocument)
+ * @see
+ * org.jboss.tools.vpe.editor.template.VpeTemplate#create(org.jboss.tools
+ * .vpe.editor.context.VpePageContext, org.w3c.dom.Node,
+ * org.mozilla.interfaces.nsIDOMDocument)
*/
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
@@ -72,7 +74,7 @@
} else {
// get text by positions and add to span
- String text = TemplateManagingUtil.getSourceText(pageContext,
+ String text = NodesManagingUtil.getSourceText(pageContext,
((IDOMNode) child).getStartOffset(), ((IDOMNode) child)
.getEndOffset() - 1);
span.appendChild(visualDocument.createTextNode(text));
@@ -95,10 +97,11 @@
/*
* (non-Javadoc)
*
- * @see org.jboss.tools.vpe.editor.template.VpeAbstractTemplate#isRecreateAtAttrChange(org.jboss.tools.vpe.editor.context.VpePageContext,
- * org.w3c.dom.Element, org.mozilla.interfaces.nsIDOMDocument,
- * org.mozilla.interfaces.nsIDOMElement, java.lang.Object,
- * java.lang.String, java.lang.String)
+ * @seeorg.jboss.tools.vpe.editor.template.VpeAbstractTemplate#
+ * isRecreateAtAttrChange(org.jboss.tools.vpe.editor.context.VpePageContext,
+ * org.w3c.dom.Element, org.mozilla.interfaces.nsIDOMDocument,
+ * org.mozilla.interfaces.nsIDOMElement, java.lang.Object, java.lang.String,
+ * java.lang.String)
*/
public boolean isRecreateAtAttrChange(VpePageContext pageContext,
Element sourceElement, nsIDOMDocument visualDocument,
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-09-22 14:22:21 UTC (rev 10396)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-09-22 16:23:36 UTC (rev 10397)
@@ -103,9 +103,6 @@
<vpe:tag name="h:inputHidden" case-sensitive="yes">
<vpe:template children="no" modify="no" >
- <input type="text" value="{jsfvalue(@value)}"
- title="{tagstring()}" />
-
<vpe:dnd>
<vpe:drag start-enable="yes" />
<vpe:drop container="yes">
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java 2008-09-22 14:22:21 UTC (rev 10396)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java 2008-09-22 16:23:36 UTC (rev 10397)
@@ -119,7 +119,7 @@
}
public void testSelectOneRadio() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performContentTest("components/selectOneRadio.jsp"); //$NON-NLS-1$
}
/*
@@ -147,7 +147,7 @@
}
public void testFacet() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performContentTest("components/facet.jsp"); //$NON-NLS-1$
}
public void testLoadBundle() throws Throwable {
@@ -163,11 +163,11 @@
}
public void testSelectItem() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performContentTest("components/selectItem.jsp"); //$NON-NLS-1$
}
public void testSelectItems() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performContentTest("components/selectItems.jsp"); //$NON-NLS-1$
}
public void testSetPropertyActionListener() throws Throwable {
@@ -175,7 +175,8 @@
}
public void testSubview() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performContentTest("components/subview.jsp"); //$NON-NLS-1$
+
}
public void testValidateDoubleRange() throws Throwable {
@@ -199,11 +200,11 @@
}
public void testVerbatim() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performContentTest("components/verbatim.jsp"); //$NON-NLS-1$
}
public void testView() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performContentTest("components/view.jsp"); //$NON-NLS-1$
}
protected String getTestProjectName() {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/NodesManagingUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/NodesManagingUtil.java 2008-09-22 14:22:21 UTC (rev 10396)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/NodesManagingUtil.java 2008-09-22 16:23:36 UTC (rev 10397)
@@ -136,5 +136,19 @@
return locale;
}
+
+ /**
+ *
+ * @param pageContext
+ * @param startPosition
+ * @param endPosition
+ * @return
+ */
+ public static String getSourceText(VpePageContext pageContext,
+ int startPosition, int endPosition) {
+ return pageContext.getSourceBuilder().getStructuredTextViewer()
+ .getTextWidget().getText(startPosition, endPosition);
+ }
+
}
15 years, 9 months
JBoss Tools SVN: r10396 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-09-22 10:22:21 -0400 (Mon, 22 Sep 2008)
New Revision: 10396
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java
Log:
JBIDE-2444
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java 2008-09-22 12:54:18 UTC (rev 10395)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java 2008-09-22 14:22:21 UTC (rev 10396)
@@ -78,21 +78,19 @@
assertNotNull(results);
assertTrue("The lenft should be more than 0",results.length>0); //$NON-NLS-1$
for (ICompletionProposal completionProposal : results) {
- String displayString = ((ICompletionProposal) completionProposal).getDisplayString();
-
+ String displayString = ((ICompletionProposal) completionProposal).getDisplayString();
if(!displayString.startsWith("${msg.")) { //$NON-NLS-1$
- //TODO Max Areshkau Fix When JBIDE-2498 will be fixed
fail("String doesn't matches"); //$NON-NLS-1$
}
}
- results = checkOfCAByStartString(CA_NAME, "JBIDE/788/testCAPathProposals.xhtml","",11,41,false); //$NON-NLS-1$//$NON-NLS-2$
+ results = checkOfCAByStartString(CA_NAME, "JBIDE/788/testCAPathProposals.xhtml","",11,43,false); //$NON-NLS-1$//$NON-NLS-2$
assertNotNull(results);
for(ICompletionProposal completionProposal : results) {
String displayString = ((ICompletionProposal) completionProposal).getDisplayString();
- if(!displayString.contains("temp")) { //$NON-NLS-1$
+ if(!displayString.contains("temp") && !displayString.startsWith("#{")) { //$NON-NLS-1$ //$NON-NLS-2$
fail("String doesn't matches"); //$NON-NLS-1$
}
}
15 years, 9 months
JBoss Tools SVN: r10395 - trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-09-22 08:54:18 -0400 (Mon, 22 Sep 2008)
New Revision: 10395
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEditPart.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2611
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEditPart.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEditPart.java 2008-09-22 12:48:08 UTC (rev 10394)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEditPart.java 2008-09-22 12:54:18 UTC (rev 10395)
@@ -118,10 +118,10 @@
String text = "";
// if (getLink().getJSFModel().getOptions().showShortcutPath())
-// text = getLink().getToGroup().getVisiblePath();
+ text = getLink().getToElement().getName();
shortcutLabel = new GEFLabel(text, FigureFactory.normalColor);
// if (getLink().getJSFModel().getOptions().showShortcutIcon())
-// shortcutLabel.setIcon(icon);
+ shortcutLabel.setIcon(icon);
// shortcutLabel.setFont(getLink().getJSFModel().getOptions()
// .getLinkPathFont());
shortcutLabel.setTextAlignment(Label.LEFT);
@@ -212,11 +212,11 @@
public void linkChange(Link source) {
pathLabel.setText(getLink().getName());
// if (getLinkModel().getJSFModel().getOptions().showShortcutPath())
-// shortcutLabel.setText(getLink().getToGroup().getVisiblePath());
+ shortcutLabel.setText(getLink().getToElement().getName());
// else
// shortcutLabel.setText("");
// if (getLinkModel().getJSFModel().getOptions().showShortcutIcon())
-// shortcutLabel.setIcon(icon);
+ shortcutLabel.setIcon(icon);
// else
// shortcutLabel.setIcon(null);
@@ -269,6 +269,7 @@
* @see org.eclipse.emf.common.notify.Adapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
*/
public void notifyChanged(Notification notification) {
+ linkChange(getLink());
pathLabel.setText(getLinkModel().getName());
if (getLinkFigure().isManual()
&& getLink().getPathFromModel().equals("")) {
15 years, 9 months
JBoss Tools SVN: r10394 - in trunk: vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2008-09-22 08:48:08 -0400 (Mon, 22 Sep 2008)
New Revision: 10394
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTldVersionCheck.java
Log:
code adjustment
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-09-22 12:37:01 UTC (rev 10393)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-09-22 12:48:08 UTC (rev 10394)
@@ -278,8 +278,12 @@
</vpe:textFormatting>
</vpe:template>
</vpe:if>
- <vpe:if test="tld_version('max=1.2')" >
- <vpe:template children="yes" modify="yes" class="org.jboss.tools.jsf.vpe.jsf.template.JsfOutputLinkTemplate">
+ <vpe:if test="tld_version('min=1.2')">
+ <vpe:template children="yes" modify="yes">
+ <vpe:a class="{@styleClass}"
+ style="{@style}"
+ dir="{@dir}"
+ title="{tagstring()}"/>
<vpe:textFormatting use-default-formats="yes">
<vpe:format type="UnderlineFormat" setDefault="true">
<vpe:formatAttribute type="style" />
@@ -287,18 +291,13 @@
</vpe:textFormatting>
</vpe:template>
</vpe:if>
- <vpe:template children="yes" modify="yes">
- <vpe:a class="{@styleClass}"
- style="{@style}"
- dir="{@dir}"
- title="{tagstring()}"/>
+ <vpe:template children="yes" modify="yes" class="org.jboss.tools.jsf.vpe.jsf.template.JsfOutputLinkTemplate">
<vpe:textFormatting use-default-formats="yes">
<vpe:format type="UnderlineFormat" setDefault="true">
<vpe:formatAttribute type="style" />
</vpe:format>
</vpe:textFormatting>
</vpe:template>
-
</vpe:tag>
<vpe:tag name="h:outputLabel" case-sensitive="yes">
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTldVersionCheck.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTldVersionCheck.java 2008-09-22 12:37:01 UTC (rev 10393)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTldVersionCheck.java 2008-09-22 12:48:08 UTC (rev 10394)
@@ -127,18 +127,14 @@
private double getStartVersion(String tagValue) {
- DecimalFormat decimalFormat = new DecimalFormat("#*.#*"); //$NON-NLS-1$
-
try {
if(tagValue.indexOf(MIN_VERSION_KEYWORD)!=-1){
-
- return (-1)*decimalFormat.parse(tagValue.
- substring(tagValue.indexOf(MIN_VERSION_KEYWORD)+4)).doubleValue();
+ return Double.parseDouble(tagValue.substring(tagValue.indexOf(MIN_VERSION_KEYWORD)+4));
} else {
return (-1)*Double.MAX_VALUE;
}
- } catch (ParseException e) {
+ } catch (NumberFormatException e) {
VpePlugin.getPluginLog().logError(e);
}
@@ -147,18 +143,13 @@
private double getEndVersion(String tagValue) {
- DecimalFormat decimalFormat = new DecimalFormat("#*.#*"); //$NON-NLS-1$
-
try{
if(tagValue.indexOf(MAX_VERSION_KEYWORD)!=-1) {
-
- return (-1)*decimalFormat.parse(tagValue.substring(tagValue.
- indexOf(MAX_VERSION_KEYWORD)+4)).doubleValue();
+ return Double.parseDouble(tagValue.substring(tagValue.indexOf(MAX_VERSION_KEYWORD)+4));
}else {
return Double.MAX_VALUE;
}
- } catch (ParseException e) {
-
+ } catch (NumberFormatException e) {
VpePlugin.getPluginLog().logError(e);
}
return Double.MAX_VALUE;
15 years, 9 months
JBoss Tools SVN: r10393 - in trunk/vpe/plugins/org.jboss.tools.vpe: src/org/jboss/tools/vpe/editor and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-09-22 08:37:01 -0400 (Mon, 22 Sep 2008)
New Revision: 10393
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
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/preferences/ELVariablesPreferencePage.java
Log:
JBIDE-2773
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-09-22 11:59:11 UTC (rev 10392)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-09-22 12:37:01 UTC (rev 10393)
@@ -141,7 +141,7 @@
PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
displayName="Add El Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPEElReference">
- <AttributeData AttributeName="location" Mandatory="no"/>
+ <AttributeData AttributeName="location"/>
<AttributeData AttributeName="scope" Mandatory="no"/>
<AttributeData AttributeName="prefix" Mandatory="no"/>
</EntityData>
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 2008-09-22 11:59:11 UTC (rev 10392)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-09-22 12:37:01 UTC (rev 10393)
@@ -56,7 +56,6 @@
import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
import org.jboss.tools.vpe.editor.template.IEditableTemplate;
-import org.jboss.tools.vpe.editor.template.InvisibleTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.template.VpeCreatorUtil;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/ELVariablesPreferencePage.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/ELVariablesPreferencePage.java 2008-09-22 11:59:11 UTC (rev 10392)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/ELVariablesPreferencePage.java 2008-09-22 12:37:01 UTC (rev 10393)
@@ -24,7 +24,6 @@
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.jboss.tools.common.el.ui.GlobalElVariablesComposite;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
-import org.jboss.tools.common.resref.core.ResourceReference;
import org.jboss.tools.vpe.resref.VpeResourcesDialog;
/**
@@ -34,8 +33,6 @@
*/
public class ELVariablesPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
-
- private static final ResourceReference[] EMPTY_RESOURCE = new ResourceReference[0];
/** The el. */
private GlobalElVariablesComposite el = new GlobalElVariablesComposite();
15 years, 9 months
JBoss Tools SVN: r10392 - trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-09-22 07:59:11 -0400 (Mon, 22 Sep 2008)
New Revision: 10392
Modified:
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesPageRefUpdateManager.java
Log:
JBIDE-2611 Autolayout for links that have identical source and target nodes.
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesPageRefUpdateManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesPageRefUpdateManager.java 2008-09-22 11:33:22 UTC (rev 10391)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesPageRefUpdateManager.java 2008-09-22 11:59:11 UTC (rev 10392)
@@ -118,7 +118,7 @@
private void onChildAdded(XModelTreeEvent event) {
XModelObject c = (XModelObject)event.getInfo();
- if(!c.getModelEntity().getName().equals("JSFProcessGroup")) return;
+ if(!c.getModelEntity().getName().equals(SeamPagesConstants.ENT_DIAGRAM_ITEM)) return;
SeamPagesDiagramImpl pi = (SeamPagesDiagramImpl)event.getModelObject();
PageLinks pl = getPageLinks(c);
if(pl == null || pi.getHelper() == null) return;
15 years, 9 months
JBoss Tools SVN: r10391 - in trunk/seam/plugins/org.jboss.tools.seam.pages.xml: resources/meta and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-09-22 07:33:22 -0400 (Mon, 22 Sep 2008)
New Revision: 10391
Added:
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/ModifyLinkHandler.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/meta/seam-pages.meta
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesDiagramHelper.java
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/autolayout/SeamPagesItems.java
Log:
JBIDE-2611 Autolayout for links that have identical source and target nodes.
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/plugin.xml 2008-09-22 11:32:33 UTC (rev 10390)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/plugin.xml 2008-09-22 11:33:22 UTC (rev 10391)
@@ -87,6 +87,9 @@
<xclass id="org.jboss.tools.seam.pages.xml.model.handlers.RenameViewSupport"
class="org.jboss.tools.seam.pages.xml.model.handlers.RenameViewSupport"/>
+ <xclass id="org.jboss.tools.seam.pages.xml.model.handlers.ModifyLinkHandler"
+ class="org.jboss.tools.seam.pages.xml.model.handlers.ModifyLinkHandler"/>
+
<xclass id="org.jboss.tools.seam.pages.xml.model.helpers.autolayout.SeamPagesItems"
class="org.jboss.tools.seam.pages.xml.model.helpers.autolayout.SeamPagesItems"/>
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/meta/seam-pages.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/meta/seam-pages.meta 2008-09-22 11:32:33 UTC (rev 10390)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/meta/seam-pages.meta 2008-09-22 11:33:22 UTC (rev 10391)
@@ -3089,15 +3089,15 @@
ICON="action.empty" displayName="Select in Tree Views" kind="action" name="Select"/>
<XActionItem kind="list" name="LinkActions">
<XActionItem HIDE="disabled"
- HandlerClassName="org.jboss.tools.jsf.model.handlers.ModifyLinkHandler"
+ HandlerClassName="org.jboss.tools.seam.pages.xml.model.handlers.ModifyLinkHandler"
ICON="action.empty" PROPERTIES="value=no;property=shortcut"
displayName="Show as Transition" kind="action" name="AsTransition"/>
<XActionItem HIDE="disabled"
- HandlerClassName="org.jboss.tools.jsf.model.handlers.ModifyLinkHandler"
+ HandlerClassName="org.jboss.tools.seam.pages.xml.model.handlers.ModifyLinkHandler"
ICON="action.empty" PROPERTIES="value=yes;property=shortcut"
displayName="Show as Shortcut" kind="action" name="AsSrortcut"/>
<XActionItem HIDE="always"
- HandlerClassName="org.jboss.tools.jsf.model.handlers.ModifyLinkHandler"
+ HandlerClassName="org.jboss.tools.seam.pages.xml.model.handlers.ModifyLinkHandler"
ICON="action.empty" PROPERTIES="value=yes;property=hidden"
displayName="Hide" kind="action" name="Hide"/>
</XActionItem>
@@ -3156,15 +3156,15 @@
ICON="action.empty" displayName="Auto Layout" kind="action" name="Autolayout"/>
<XActionItem kind="list" name="LinkActions">
<XActionItem HIDE="disabled"
- HandlerClassName="org.jboss.tools.jsf.model.handlers.ModifyLinkHandler"
+ HandlerClassName="org.jboss.tools.seam.pages.xml.model.handlers.ModifyLinkHandler"
ICON="action.empty" PROPERTIES="value=no;property=shortcut"
displayName="Show as Transition" kind="action" name="AsTransition"/>
<XActionItem HIDE="disabled"
- HandlerClassName="org.jboss.tools.jsf.model.handlers.ModifyLinkHandler"
+ HandlerClassName="org.jboss.tools.seam.pages.xml.model.handlers.ModifyLinkHandler"
ICON="action.empty" PROPERTIES="value=yes;property=shortcut"
displayName="Show as Shortcut" kind="action" name="AsSrortcut"/>
<XActionItem HIDE="always"
- HandlerClassName="org.jboss.tools.jsf.model.handlers.ModifyLinkHandler"
+ HandlerClassName="org.jboss.tools.seam.pages.xml.model.handlers.ModifyLinkHandler"
ICON="action.empty" PROPERTIES="value=yes;property=hidden"
displayName="Hide" kind="action" name="Hide"/>
</XActionItem>
Added: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/ModifyLinkHandler.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/ModifyLinkHandler.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/ModifyLinkHandler.java 2008-09-22 11:33:22 UTC (rev 10391)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.pages.xml.model.handlers;
+
+import java.util.*;
+import org.jboss.tools.common.model.*;
+import org.jboss.tools.common.meta.action.impl.*;
+import org.jboss.tools.seam.pages.xml.model.SeamPagesConstants;
+
+public class ModifyLinkHandler extends AbstractHandler implements SeamPagesConstants {
+
+ public ModifyLinkHandler() {}
+
+ public boolean isEnabled(XModelObject object) {
+ if(object == null || !object.isObjectEditable()) return false;
+ if(!ENT_DIAGRAM_ITEM_OUTPUT.equals(object.getModelEntity().getName())) return false;
+ String pn = action.getProperty("property");
+ String pv = action.getProperty("value");
+ return !pv.equals(object.getAttributeValue(pn));
+ }
+
+ public void executeHandler(XModelObject object, Properties p) throws XModelException {
+ if(!isEnabled(object)) return;
+ String pn = action.getProperty("property");
+ String pv = action.getProperty("value");
+ object.setAttributeValue(pn, pv);
+ }
+
+}
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesDiagramHelper.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesDiagramHelper.java 2008-09-22 11:32:33 UTC (rev 10390)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesDiagramHelper.java 2008-09-22 11:33:22 UTC (rev 10391)
@@ -8,6 +8,7 @@
import java.util.Map;
import java.util.Set;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.util.XModelObjectUtil;
import org.jboss.tools.jst.web.model.ReferenceObject;
@@ -203,7 +204,6 @@
}
updatePageItem(gs[i]);
if(hadReference && ts == gs[i].getTimeStamp()) {
- System.out.println("fire " + gs[i].getPath());
gs[i].fireReferenceChanged();
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/autolayout/SeamPagesItems.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/autolayout/SeamPagesItems.java 2008-09-22 11:32:33 UTC (rev 10390)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/autolayout/SeamPagesItems.java 2008-09-22 11:33:22 UTC (rev 10391)
@@ -1,7 +1,15 @@
package org.jboss.tools.seam.pages.xml.model.helpers.autolayout;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.tools.common.model.XModelException;
+import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.jst.web.model.helpers.autolayout.Items;
import org.jboss.tools.jst.web.model.helpers.autolayout.LayuotConstants;
+import org.jboss.tools.jst.web.model.helpers.autolayout.TransitionArranger;
+import org.jboss.tools.seam.pages.xml.model.SeamPagesConstants;
+import org.jboss.tools.seam.pages.xml.model.helpers.SeamPagesDiagramStructureHelper;
public class SeamPagesItems extends Items {
@@ -13,6 +21,9 @@
return new SeamLayoutConstants();
}
+ protected TransitionArranger createTransitionArranger() {
+ return new SeamPagesTransitionArranger();
+ }
}
class SeamLayoutConstants extends LayuotConstants {
@@ -22,3 +33,31 @@
}
}
+
+class SeamPagesTransitionArranger extends TransitionArranger {
+ public void execute() {
+ super.execute();
+
+ for (int i = 0; i < items.length; i++) {
+ XModelObject[] links = items[i].getObject().getChildren();
+ if(links.length < 2) continue;
+ Set<String> paths = new HashSet<String>();
+ for (int j = 0; j < links.length; j++) {
+ String path = links[j].getAttributeValue(SeamPagesConstants.ATTR_PATH);
+ if(paths.contains(path)) {
+ if(!SeamPagesDiagramStructureHelper.getInstance().isShortcut(links[j])) {
+ try {
+ links[j].getModel().changeObjectAttribute(links[j], "shortcut", "yes");
+ } catch (XModelException e) {
+ e.printStackTrace();
+ }
+ System.out.println("Set shortcut " + path);
+ }
+ } else {
+ paths.add(path);
+ }
+ }
+ }
+ }
+
+}
15 years, 9 months
JBoss Tools SVN: r10390 - trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-09-22 07:32:33 -0400 (Mon, 22 Sep 2008)
New Revision: 10390
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/AutoLayout.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/Items.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/TransitionArranger.java
Log:
JBIDE-2611 Autolayout for links that have identical source and target nodes.
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/AutoLayout.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/AutoLayout.java 2008-09-22 10:48:56 UTC (rev 10389)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/AutoLayout.java 2008-09-22 11:32:33 UTC (rev 10390)
@@ -34,7 +34,7 @@
items.setProcess(process);
apply();
if(items.override) {
- TransitionArranger a = new TransitionArranger();
+ TransitionArranger a = items.createTransitionArranger();
a.setItems(items.items);
a.execute();
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/Items.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/Items.java 2008-09-22 10:48:56 UTC (rev 10389)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/Items.java 2008-09-22 11:32:33 UTC (rev 10390)
@@ -119,6 +119,10 @@
}
}
+ protected TransitionArranger createTransitionArranger() {
+ return new TransitionArranger();
+ }
+
private void print() {
for (int i = 0; i < items.length; i++)
items[i].print();
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/TransitionArranger.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/TransitionArranger.java 2008-09-22 10:48:56 UTC (rev 10389)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/TransitionArranger.java 2008-09-22 11:32:33 UTC (rev 10390)
@@ -14,7 +14,7 @@
import org.jboss.tools.common.model.XModelObject;
public class TransitionArranger {
- Item[] items;
+ protected Item[] items;
public void setItems(Item[] items) {
this.items = items;
15 years, 9 months