Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjechoi2006-06-22 08:29:24 +0000
committerjechoi2006-06-22 08:29:24 +0000
commit4236c89f746d2dfce8ac735b4eefbc778973a821 (patch)
tree92746beb0810a77f485be9b8914425e180191bdf
parenteb3b88c747f24ab1aa839ee2c9f716b87823a1ff (diff)
downloadwebtools.jsf-4236c89f746d2dfce8ac735b4eefbc778973a821.tar.gz
webtools.jsf-4236c89f746d2dfce8ac735b4eefbc778973a821.tar.xz
webtools.jsf-4236c89f746d2dfce8ac735b4eefbc778973a821.zip
bug fix 148071: From-Outcome browser from Link property sheet always displays empty listv20060622
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/pageflow/properties/ActionOutcomeSelectionDialog.java42
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/pageflow/util/JSPUtil.java16
2 files changed, 21 insertions, 37 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/pageflow/properties/ActionOutcomeSelectionDialog.java b/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/pageflow/properties/ActionOutcomeSelectionDialog.java
index 90e70c88d..c8cee09e2 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/pageflow/properties/ActionOutcomeSelectionDialog.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/pageflow/properties/ActionOutcomeSelectionDialog.java
@@ -24,8 +24,8 @@ import org.eclipse.jst.jsf.facesconfig.ui.pageflow.util.JSPUtil;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -195,21 +195,13 @@ public class ActionOutcomeSelectionDialog extends Dialog {
actionCol
.setText(PageflowMessages.Pageflow_Property_Action_OutcomeSelectionDialog_ActionListTable_Action);//$NON-NLS-1$
- actionTable.addSelectionListener(new SelectionListener() {
-
+ actionTable.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
TableItem selItem = (TableItem) e.item;
String action = selItem.getText(1);
- if (action != null && action.length() > 0) {
+ if (action != null && action.length() > 0)
actionText.setText(action);
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- // TODO Auto-generated method stub
-
}
-
});
addActionsInJSP();
@@ -306,7 +298,7 @@ public class ActionOutcomeSelectionDialog extends Dialog {
* @return
*/
private boolean isValidName() {
- return (actionText.getText().length() > 0);
+ return actionText.getText().length() > 0;
}
/**
@@ -326,33 +318,29 @@ public class ActionOutcomeSelectionDialog extends Dialog {
List actionNodes = JSPUtil.getActionListInJSPFile(jspName);
if (actionNodes != null) {
- for (int i = 0; i < actionNodes.size(); i++) {
+ for (int i = 0, n = actionNodes.size(); i < n; i++) {
Element node = (Element) actionNodes.get(i);
+ StringBuffer componentName = new StringBuffer();
- String tagName = node.getTagName();
Attr idAttr = node.getAttributeNode("id");
- String id = "";
- if (idAttr != null) {
- id = idAttr.getNodeValue(); //$NON-NLS-1$
- }
+ if (idAttr != null)
+ componentName.append(idAttr.getNodeValue());
+
+ componentName.append("(").append(node.getTagName()).append(")"); //$NON-NLS-1$
- String componentName = id + "(" + tagName + ")"; //$NON-NLS-1$
Attr actionAttr = node.getAttributeNode("action");
- String action = "";
if (actionAttr != null) {
- action = actionAttr.getValue();
- if (!isValidEL(action)) {
- addActionTableItem(componentName, action);
- }
+ String action = actionAttr.getValue();
+ if (isValidEL(action))
+ addActionTableItem(componentName.toString(), action);
}
}
}
}
public static boolean isValidEL(String expressionString) {
- if (expressionString == null || expressionString.length() == 0) {
+ if (expressionString == null || expressionString.length() == 0)
return true;
- }
return expressionString.startsWith(JSF_EL_LEFT_BRACE)
&& expressionString.endsWith(JSF_EL_RIGHT_BRACE);
@@ -373,7 +361,5 @@ public class ActionOutcomeSelectionDialog extends Dialog {
item.setText(0, componentName);
item.setText(1, action);
}
-
}
-
}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/pageflow/util/JSPUtil.java b/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/pageflow/util/JSPUtil.java
index 527e7c3f3..dbd215154 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/pageflow/util/JSPUtil.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/pageflow/util/JSPUtil.java
@@ -69,9 +69,9 @@ public class JSPUtil {
List trackers = m.getTaglibTrackers();
for (Iterator iter = trackers.iterator(); iter.hasNext();) {
TaglibTracker tracker = (TaglibTracker) iter.next();
- if (uri.equals(tracker.getURI())) {
+ if (uri.equals(tracker.getURI()))
return tracker.getPrefix();
- } else {
+ else {
CMDocument cmdoc = tracker.getDocument();
if (cmdoc instanceof TLDDocument
&& uri.equals(((TLDDocument) cmdoc).getUri())) {
@@ -122,15 +122,15 @@ public class JSPUtil {
TaglibTracker tracker = (TaglibTracker) iter.next();
if (prefix.equals(tracker.getPrefix())) {
CMDocument cmdoc = tracker.getDocument();
- if (cmdoc instanceof TLDDocument) {
+ if (cmdoc instanceof TLDDocument)
return ((TLDDocument) cmdoc).getUri();
- } else
+ else
return null;
}
}
return null;
}
-
+
/**
* get the action list in the jsp file
*
@@ -160,16 +160,14 @@ public class JSPUtil {
// get the command butonns
List buttonActions = jspAdapter.getElementsByTagNameNS(
prefix, "commandButton");//$NON-NLS-1$
- if (buttonActions != null) {
+ if (buttonActions != null)
actions.addAll(buttonActions);
- }
// get the command links
List linkActions = jspAdapter.getElementsByTagNameNS(
prefix, "commandLink");//$NON-NLS-1$
- if (linkActions != null) {
+ if (linkActions != null)
actions.addAll(linkActions);
- }
}
}
}

Back to the top