JBoss Tools SVN: r4223 - branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2007-10-16 08:48:51 -0400 (Tue, 16 Oct 2007)
New Revision: 4223
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1091, code adjustment
Modified: branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java 2007-10-16 12:44:08 UTC (rev 4222)
+++ branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java 2007-10-16 12:48:51 UTC (rev 4223)
@@ -13,7 +13,6 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.jboss.tools.jst.jsp.editor.ITextFormatter;
@@ -163,11 +162,11 @@
}
@Override
public void setAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name, String value) {
- setAttribute(pageContext, sourceElement, (Map<?,?>)data, name, value);
+ setAttribute(pageContext, sourceElement, (Map<VpeTemplate,?>)data, name, value);
}
@Override
public void removeAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name) {
- removeAttribute(pageContext, sourceElement, (Map<?,?>)data, name);
+ removeAttribute(pageContext, sourceElement, (Map<VpeTemplate,?>)data, name);
}
@Override
public void beforeRemove(VpePageContext pageContext, Node sourceNode, nsIDOMNode visualNode, Object data) {
@@ -310,7 +309,7 @@
private String getPageLocale(VpePageContext pageContext, IDOMElement sourceElement) {
IStructuredModel model = null;
try {
- List taglibs = pageContext.getTagLibs();
+ List<TaglibData> taglibs = pageContext.getTagLibs();
// Find F tracker
TaglibData fTD = null;
for (int i = 0; i < taglibs.size(); i++) {
@@ -358,10 +357,10 @@
*/
@Override
public void openIncludeEditor(VpePageContext pageContext, Element sourceElement, Object data) {
- openIncludeEditor(pageContext, sourceElement, (Map) data);
+ openIncludeEditor(pageContext, sourceElement, (Map<?,?>) data);
}
- private void openIncludeEditor(VpePageContext pageContext, Element sourceElement, Map visualNodeMap) {
+ private void openIncludeEditor(VpePageContext pageContext, Element sourceElement, Map<?,?> visualNodeMap) {
if (sourceElement != null) {
String file = null;
if ("jsp:directive.include".equals(sourceElement.getNodeName())) {
@@ -464,16 +463,6 @@
visualElement.setAttribute(ATTR_STYLE, style);
}
- private boolean getCurrentSelect() {
- VpeCreator[] creators = dependencyMap.getCreators(VpeValueCreator.SIGNATURE_VPE_VALUE);
- for (int i = 0; i < creators.length; i++) {
- if (creators[i] instanceof VpeOutputAttributes) {
- return false;
- }
- }
- return true;
- }
-
private boolean getCurrentModify(VpePageContext pageContext, Element sourceElement, Map visualNodeMap) {
if (!modify || !dependencyFromBundle) {
return modify;
@@ -539,7 +528,7 @@
}
}
- private void setAttribute(VpePageContext pageContext, Element sourceElement, Map visualNodeMap, String name, String value) {
+ private void setAttribute(VpePageContext pageContext, Element sourceElement, Map<VpeTemplate,?> visualNodeMap, String name, String value) {
if (creator != null) {
setAttribute(dependencyMap.getCreators(VpeExpressionBuilder.SIGNATURE_ANY_ATTR), pageContext, sourceElement, visualNodeMap, name, value);
setAttribute(dependencyMap.getCreators(VpeExpressionBuilder.attrSignature(name, caseSensitive)), pageContext, sourceElement, visualNodeMap, name, value);
@@ -547,7 +536,7 @@
}
}
- private void removeAttribute(VpePageContext pageContext, Element sourceElement, Map visualNodeMap, String name) {
+ private void removeAttribute(VpePageContext pageContext, Element sourceElement, Map<VpeTemplate,?> visualNodeMap, String name) {
if (creator != null) {
removeAttribute(dependencyMap.getCreators(VpeExpressionBuilder.SIGNATURE_ANY_ATTR), pageContext, sourceElement, visualNodeMap, name);
removeAttribute(dependencyMap.getCreators(VpeExpressionBuilder.attrSignature(name, caseSensitive)), pageContext, sourceElement, visualNodeMap, name);
17 years, 3 months
JBoss Tools SVN: r4222 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-10-16 08:44:08 -0400 (Tue, 16 Oct 2007)
New Revision: 4222
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatHtmlContentAssistProcessor.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1078 Removed unnecessary NullPointerException
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatHtmlContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatHtmlContentAssistProcessor.java 2007-10-16 12:28:25 UTC (rev 4221)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatHtmlContentAssistProcessor.java 2007-10-16 12:44:08 UTC (rev 4222)
@@ -398,23 +398,25 @@
} catch(Exception e) {
JspEditorPlugin.getPluginLog().logError(e);
}
- for (Iterator iter = kbProposals.iterator(); iter.hasNext();) {
- KbProposal kbProposal = (KbProposal) iter.next();
- if(ignoreProposal(kbProposal)) {
- continue;
+ if(kbProposals!=null) {
+ for (Iterator iter = kbProposals.iterator(); iter.hasNext();) {
+ KbProposal kbProposal = (KbProposal) iter.next();
+ if(ignoreProposal(kbProposal)) {
+ continue;
+ }
+ String proposedInfo = kbProposal.getContextInfo();
+ String kbReplacementString = kbProposal.getReplacementString();
+ String replacementString = kbReplacementString + ">";
+ String displayString = kbProposal.getLabel();
+ boolean autoContentAssistant = replacementString.indexOf('\"')>-1 && replacementString.indexOf("=")>-1;
+ int cursorAdjustment = replacementString.length();
+ if(!kbReplacementString.endsWith("/")) {
+ replacementString = replacementString + "</" + displayString + ">";
+ }
+ Image image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
+ RedHatCustomCompletionProposal proposal = new RedHatCustomCompletionProposal(autoContentAssistant, replacementString, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), cursorAdjustment, image, displayString, null, proposedInfo, XMLRelevanceConstants.R_TAG_NAME);
+ contentAssistRequest.addProposal(proposal);
}
- String proposedInfo = kbProposal.getContextInfo();
- String kbReplacementString = kbProposal.getReplacementString();
- String replacementString = kbReplacementString + ">";
- String displayString = kbProposal.getLabel();
- boolean autoContentAssistant = replacementString.indexOf('\"')>-1 && replacementString.indexOf("=")>-1;
- int cursorAdjustment = replacementString.length();
- if(!kbReplacementString.endsWith("/")) {
- replacementString = replacementString + "</" + displayString + ">";
- }
- Image image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
- RedHatCustomCompletionProposal proposal = new RedHatCustomCompletionProposal(autoContentAssistant, replacementString, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), cursorAdjustment, image, displayString, null, proposedInfo, XMLRelevanceConstants.R_TAG_NAME);
- contentAssistRequest.addProposal(proposal);
}
super.addTagNameProposals(contentAssistRequest, childPosition);
}
@@ -471,7 +473,7 @@
public void addTaglib(String uri, String prefix) {
}
-
+
public void removeTaglib(String uri, String prefix) {
}
@@ -539,4 +541,4 @@
jspActiveCAP = new JSPActiveContentAssistProcessor();
jspActiveCAP.init();
}
-}
+}
\ No newline at end of file
17 years, 3 months
JBoss Tools SVN: r4221 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: asakharov
Date: 2007-10-16 08:28:25 -0400 (Tue, 16 Oct 2007)
New Revision: 4221
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java
Log:
vpe RichFaces panelMenuItem
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java 2007-10-16 12:23:12 UTC (rev 4220)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java 2007-10-16 12:28:25 UTC (rev 4221)
@@ -37,6 +37,8 @@
private static final String PANEL_MENU_NOWARP_CLASS = "dr-pmenu-nowrap";
private static final String PANEL_MENU_LABLE_CLASS = "dr-pmenu-group-self-label";
+
+ private static final String PANEL_MENU_DIV = "dr-pmenu-top-self-div";
private static final String PANEL_MENU_ITEM = "panelMenuItem";
@@ -89,7 +91,7 @@
ComponentUtil.setCSSLink(pageContext, STYLE_PATH, PANEL_MENU_ITEM);
Element parentDiv = visualDocument.createElement("div");
-
+ parentDiv.setAttribute("CLASS", PANEL_MENU_DIV);
parentVisualElement.appendChild(parentDiv);
Element div = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_DIV);
17 years, 3 months
JBoss Tools SVN: r4220 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-10-16 08:23:12 -0400 (Tue, 16 Oct 2007)
New Revision: 4220
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/ELToken.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELTokenizer.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-715 Ignore Strings and "required", "invalid"
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/ELToken.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/ELToken.java 2007-10-16 12:00:20 UTC (rev 4219)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/ELToken.java 2007-10-16 12:23:12 UTC (rev 4220)
@@ -22,6 +22,7 @@
public static final int EL_OPERATOR_TOKEN = 2;
public static final int EL_RESERVED_WORD_TOKEN = 3;
public static final int EL_SEPARATOR_TOKEN = 4;
+ public static final int EL_STRING_TOKEN = 5;
private int start;
private int length;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELTokenizer.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELTokenizer.java 2007-10-16 12:00:20 UTC (rev 4219)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELTokenizer.java 2007-10-16 12:23:12 UTC (rev 4220)
@@ -26,14 +26,16 @@
private static final int STATE_OPERATOR = 2;
private static final int STATE_RESERVED_WORD = 3;
private static final int STATE_SEPARATOR = 4;
+ private static final int STATE_STRING = 5;
private String expression;
private List<ELToken> fTokens;
private int index;
private int fState;
- private static final String OPERATOR_SYMBOLS = "!=&(){}[]:+-*%?',|/%<>";
- private static final String RESERVED_WORDS = " null empty div and or not mod eq ne lt gt le ge true false instanceof ";
+ private static final String OPERATOR_SYMBOLS = "!=&(){}[]:+-*%?,|/%<>";
+ private static final int STRING_SYMBOL = '\'';
+ private static final String RESERVED_WORDS = " null empty div and or not mod eq ne lt gt le ge true false instanceof invalid required ";
/**
* Constructs SeamELTokenizer object.
@@ -78,13 +80,14 @@
}
/*
- * Calculates and returns next token for expression
+ * Calculates and returns next token of expression
*
* @return
*/
private ELToken getNextToken() {
switch (fState) {
- case STATE_INITIAL: { // Just started
+ case STATE_INITIAL: // Just started
+ case STATE_STRING: { // String is read
int ch = readNextChar();
if (ch == -1) {
return ELToken.EOF;
@@ -96,13 +99,16 @@
if (OPERATOR_SYMBOLS.indexOf(ch)>-1) {
return readOperatorToken();
}
+ if (ch == STRING_SYMBOL) {
+ return readStringToken();
+ }
if (ch == ' ') {
return readSeparatorToken();
}
return ELToken.EOF;
}
- case STATE_RESERVED_WORD: // Reserved word is read - expecting a separator or operator
- case STATE_OPERAND: { // Operand is read - expecting a separator or operator
+ case STATE_RESERVED_WORD: // Reserved word is read - expecting a separator or operator or string
+ case STATE_OPERAND: { // Operand is read - expecting a separator or operator or string
int ch = readNextChar();
if (ch == -1) {
return ELToken.EOF;
@@ -111,12 +117,15 @@
if (OPERATOR_SYMBOLS.indexOf(ch)>-1) {
return readOperatorToken();
}
+ if (ch == STRING_SYMBOL) {
+ return readStringToken();
+ }
if (ch == ' ') {
return readSeparatorToken();
}
return ELToken.EOF;
}
- case STATE_OPERATOR: { // Operator is read - expecting a separator or operand
+ case STATE_OPERATOR: { // Operator is read - expecting a separator or operand or string
int ch = readNextChar();
if (ch == -1) {
return ELToken.EOF;
@@ -125,12 +134,15 @@
if (Character.isJavaIdentifierPart((char)ch)) {
return readOperandOrReservedWordToken();
}
+ if (ch == STRING_SYMBOL) {
+ return readStringToken();
+ }
if (ch == ' ') {
return readSeparatorToken();
}
return ELToken.EOF;
}
- case STATE_SEPARATOR: { // Separator is read - expecting a operand or operator
+ case STATE_SEPARATOR: { // Separator is read - expecting a operand or operator or string
int ch = readNextChar();
if (ch == -1) {
return ELToken.EOF;
@@ -142,6 +154,9 @@
if (OPERATOR_SYMBOLS.indexOf(ch)>-1) {
return readOperatorToken();
}
+ if (ch == STRING_SYMBOL) {
+ return readStringToken();
+ }
releaseChar();
return ELToken.EOF;
}
@@ -204,6 +219,25 @@
}
/*
+ * Reads and returns the string token from the expression
+ * @return
+ */
+ private ELToken readStringToken() {
+ fState = STATE_STRING;
+ int startOfToken = index;
+ int ch;
+ while((ch = readNextChar()) != -1) {
+ if (ch==STRING_SYMBOL) {
+ break;
+ }
+ }
+ releaseChar();
+ int length = index - startOfToken;
+
+ return (length > 0 ? new ELToken(startOfToken, length, getCharSequence(startOfToken, length), ELToken.EL_STRING_TOKEN) : ELToken.EOF);
+ }
+
+ /*
* Reads and returns the operand token from the expression
* @return
*/
17 years, 3 months
JBoss Tools SVN: r4219 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces: src/org/jboss/tools/jsf/vpe/richfaces/template and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: asakharov
Date: 2007-10-16 08:00:20 -0400 (Tue, 16 Oct 2007)
New Revision: 4219
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuItem/style.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java
Log:
vpe RichFaces panelMenuItem
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuItem/style.css
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuItem/style.css 2007-10-16 11:50:31 UTC (rev 4218)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuItem/style.css 2007-10-16 12:00:20 UTC (rev 4219)
@@ -36,29 +36,26 @@
width:100%;
}
-.dr-pmenu-selected-item {
- font-style:italic;
-}
.dr-pmenu-group-self-label {
padding-left:5px;
- width:100%;
}
.dr-pmenu-item-disabled {
- font-color:#B1ADA7;
color:#B1ADA7;
+ font-family:Arial,Verdana,sans-serif;
+ font-size:11px;
+ margin-top:1px;
+ padding:2px 1px 1px;
}
-.dr-pmenu-item {
- border-top:1px solid;
+.dr-pmenu-item {
cursor:pointer;
margin-top:1px;
padding:2px 1px 1px;
}
.dr-pmenu-item {
- border-top-color: #C4C0B9;
color:#000000;
font-family:Arial,Verdana,sans-serif;
font-size:11px;
@@ -66,4 +63,9 @@
.dr-pmenu-nowrap {
white-space:nowrap;
+}
+
+.dr-pmenu-top-self-div {
+ border-top: 1px solid;
+ border-color: #C4C0B9;
}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java 2007-10-16 11:50:31 UTC (rev 4218)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java 2007-10-16 12:00:20 UTC (rev 4219)
@@ -46,10 +46,32 @@
private static final String EMPTY_DIV_STYLE = "display: none;";
- private static final String DISABLED_STYLE = "color:#B1ADA7;";
-
private static final String DISABLED_CLASS = "dr-pmenu-item-disabled";
+ private static final String DISABLED_ITEM_STYLE = "disabledItemStyle";
+
+ private static final String ITEM_CLASS = "itemClass";
+
+ private static final String ICON_ITEM_TOP_POSITION = "iconItemTopPosition";
+
+ private static final String TOP_ITEM_STYLE = "topItemStyle";
+
+ private static final String ICON_TOP_DISABLED_ITEM = "iconTopDisabledItem";
+
+ private static final String DISABLE_ITEM_CLASS = "disableItemClass";
+
+ private static final String ICON_DISABLED_ITEM = "iconDisabledItem";
+
+ private static final String ICON_ITEM_POSITION = "iconItemPosition";
+
+ private static final String ICON_ITEM = "iconItem";
+
+ private static final String ICON_TOP_ITEM = "iconTopItem";
+
+ private static final String TOP_ITEM_CLASS = "topItemClass";
+
+ private static final String ITEM_STYLE = "itemStyle";
+
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
Document visualDocument) {
Element div = visualDocument
@@ -60,24 +82,29 @@
}
public static VpeCreationData encode(VpePageContext pageContext,
- VpeCreationData creationData, Element sourceParentElement, Element sourceElement,
- Document visualDocument, Element parentVisualElement, boolean active) {
+ VpeCreationData creationData, Element sourceParentElement,
+ Element sourceElement, Document visualDocument,
+ Element parentVisualElement, boolean active) {
ComponentUtil.setCSSLink(pageContext, STYLE_PATH, PANEL_MENU_ITEM);
+ Element parentDiv = visualDocument.createElement("div");
+
+ parentVisualElement.appendChild(parentDiv);
Element div = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_DIV);
- parentVisualElement.appendChild(div);
-
+
+ parentDiv.appendChild(div);
+
if (sourceElement.getParentNode().getNodeName().endsWith(
":panelMenuGroup")
|| (sourceElement.getParentNode().getNodeName()
.endsWith(":panelMenu"))) {
div.setAttribute("vpeSupport", PANEL_MENU_ITEM);
-
Element table = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
div.appendChild(table);
+
table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
PANEL_MENU_ITEM_CLASS);
table.setAttribute(HtmlComponentUtil.HTML_CELLPADDING_ATTR,
@@ -97,62 +124,82 @@
tdNowrap.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
PANEL_MENU_NOWARP_CLASS);
- Element imgSpacer1 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_IMG);
- tdNowrap.appendChild(imgSpacer1);
- setDefaultImgAttributes(imgSpacer1);
- ComponentUtil.setImg(imgSpacer1, IMG_SPACER_SRC);
-
- Element imgPoints = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_IMG);
- tdNowrap.appendChild(imgPoints);
-
- String icon = sourceElement.getAttribute("icon");
- //String iconStyle = sourceElement.getAttribute("iconStyle");
- //String iconClass = sourceElement.getAttribute("iconClass");
-
- if (icon == null || icon.length() == 0) {
- ComponentUtil.setImg(imgPoints, IMG_POINTS_SRC);
- } else {
- ComponentUtil.setImgFromResources(pageContext, imgPoints, icon,
- IMG_POINTS_SRC);
- }
-
- /*if ((iconStyle == null) || (iconStyle.length() == 0)) {
- setDefaultImgAttributes(imgPoints);
- } else {
- imgPoints.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
- iconStyle);
- }
-
- if ((iconClass == null) || (iconClass.length() == 0)) {
- setDefaultImgAttributes(imgPoints);
- } else {
- imgPoints.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- iconClass);
- }*/
-
Element tdLable = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TD);
tr.appendChild(tdLable);
- tdLable.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, PANEL_MENU_LABLE_CLASS);
+ tdLable.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ PANEL_MENU_LABLE_CLASS);
tdLable.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
"element.style");
String value = sourceElement.getAttribute("label");
Text text = visualDocument.createTextNode(value == null ? ""
: value);
+
tdLable.appendChild(text);
Element td = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TD);
tr.appendChild(td);
+ Element imgPoints = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_IMG);
+
+ Element imgSpacer1 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_IMG);
+
+ tdNowrap.appendChild(imgSpacer1);
+ setDefaultImgAttributes(imgSpacer1);
+ ComponentUtil.setImg(imgSpacer1, IMG_SPACER_SRC);
+
Element imgSpacer2 = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_IMG);
- td.appendChild(imgSpacer2);
- setDefaultImgAttributes(imgSpacer2);
- ComponentUtil.setImg(imgSpacer2, IMG_SPACER_SRC);
+ if (sourceElement.getParentNode().getNodeName().endsWith(
+ ":panelMenu")) {
+ String icon = sourceElement.getAttribute("icon");
+ if (icon == null || icon.length() == 0) {
+ setItemImage(sourceElement, sourceParentElement, td,
+ tdNowrap, ICON_ITEM_TOP_POSITION, pageContext,
+ visualDocument, sourceParentElement
+ .getAttribute(ICON_TOP_ITEM), imgPoints,
+ imgSpacer2);
+ } else {
+ setItemImage(sourceElement, sourceParentElement, td,
+ tdNowrap, ICON_ITEM_TOP_POSITION, pageContext,
+ visualDocument, icon, imgPoints, imgSpacer2);
+ }
+
+ setItemClassAndStyle(sourceElement, sourceParentElement,
+ imgPoints, pageContext, table, sourceParentElement
+ .getAttribute(TOP_ITEM_CLASS),
+ sourceParentElement.getAttribute(TOP_ITEM_STYLE),
+ sourceParentElement
+ .getAttribute(ICON_TOP_DISABLED_ITEM));
+
+ } else {
+ if (sourceElement.getParentNode().getNodeName().endsWith(
+ ":panelMenuGroup")) {
+ String icon = sourceElement.getAttribute("icon");
+ if (icon == null || icon.length() == 0) {
+ setItemImage(sourceElement, sourceParentElement, td,
+ tdNowrap, ICON_ITEM_POSITION, pageContext,
+ visualDocument, sourceParentElement
+ .getAttribute(ICON_ITEM), imgPoints,
+ imgSpacer2);
+ } else {
+ setItemImage(sourceElement, sourceParentElement, td,
+ tdNowrap, ICON_ITEM_POSITION, pageContext,
+ visualDocument, icon, imgPoints, imgSpacer2);
+ }
+ }
+
+ setItemClassAndStyle(sourceElement, sourceParentElement,
+ imgPoints, pageContext, table, sourceParentElement
+ .getAttribute(ITEM_CLASS), sourceParentElement
+ .getAttribute(ITEM_STYLE), sourceParentElement
+ .getAttribute(ICON_DISABLED_ITEM));
+ }
+
List<Node> children = ComponentUtil.getChildren(sourceElement);
if (!children.isEmpty()) {
@@ -165,48 +212,13 @@
}
}
}
-
- String styleClass = sourceElement.getAttribute("styleClass");
- if (!(styleClass == null || styleClass.length() == 0)) {
- div.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, styleClass);
- }
- else {
- styleClass="";
- }
-
- if ("true".equals(sourceElement.getAttribute("disabled"))) {
- String disabledStyle = sourceElement
- .getAttribute("disabledStyle");
- String disabledClass = sourceElement
- .getAttribute("disabledClass");
- String iconDisabled = sourceElement
- .getAttribute("iconDisabled");
- if (iconDisabled == null || iconDisabled.length() == 0) {
- ComponentUtil.setImg(imgPoints, IMG_POINTS_SRC);
- } else {
- ComponentUtil.setImgFromResources(pageContext, imgPoints,
- iconDisabled, IMG_SPACER_SRC);
- }
-
- if ((disabledStyle == null) || (disabledStyle.length() == 0)) {
- table.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
- DISABLED_STYLE);
- } else {
- table.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
- disabledStyle);
- }
- if ((disabledClass == null) || (disabledClass.length() == 0)) {
- div.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,styleClass+" "+ DISABLED_CLASS);
- } else {
- div.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- styleClass + " " + disabledClass);
- }
- }
}
return creationData;
}
-
- public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name, String value) {
+
+ public boolean isRecreateAtAttrChange(VpePageContext pageContext,
+ Element sourceElement, Document visualDocument, Node visualNode,
+ Object data, String name, String value) {
return true;
}
@@ -218,4 +230,115 @@
element.setAttribute(HtmlComponentUtil.HTML_ATR_HEIGHT,
DEFAULT_SIZE_VALUE);
}
+
+ private static void setImagePosition(Element place, Element image,
+ VpePageContext pageContext, String icon) {
+ place.appendChild(image);
+ setDefaultImgAttributes(image);
+ if (icon == null || icon.length() == 0) {
+ ComponentUtil.setImg(image, IMG_POINTS_SRC);
+ } else {
+ ComponentUtil.setImgFromResources(pageContext, image, icon,
+ IMG_SPACER_SRC);
+ }
+ }
+
+ private static void setItemImage(Element sourceElement,
+ Element sourceParentElement, Element td, Element tdNowrap,
+ String attribute, VpePageContext pageContext,
+ Document visualDocument, String image, Element imgPoints,
+ Element imgSpacer2) {
+ String iconPosition = sourceParentElement.getAttribute(attribute);
+ if (!(iconPosition == null)) {
+ if (iconPosition.equals("right")) {
+
+ setImagePosition(td, imgPoints, pageContext, image);
+
+ } else {
+ td.appendChild(imgSpacer2);
+ setDefaultImgAttributes(imgSpacer2);
+ ComponentUtil.setImg(imgSpacer2, IMG_SPACER_SRC);
+ if (iconPosition.equals("left")) {
+ setImagePosition(tdNowrap, imgPoints, pageContext, image);
+ }
+ }
+ } else {
+ setImagePosition(tdNowrap, imgPoints, pageContext, image);
+ td.appendChild(imgSpacer2);
+ setDefaultImgAttributes(imgSpacer2);
+ ComponentUtil.setImg(imgSpacer2, IMG_SPACER_SRC);
+ }
+ }
+
+ private static void setItemClassAndStyle(Element sourceElement,
+ Element sourceParentElement, Element imgPoints,
+ VpePageContext pageContext, Element table,
+ String parentClass, String parentStyle, String icon) {
+
+ if ("true".equals(sourceElement.getAttribute("disabled"))) {
+
+ String iconDisabled = sourceElement.getAttribute("iconDisabled");
+ if (iconDisabled == null || iconDisabled.length() == 0) {
+ if (!(icon == null || icon.length() == 0)) {
+ ComponentUtil.setImgFromResources(pageContext, imgPoints,
+ icon, IMG_POINTS_SRC);
+ } else {
+ ComponentUtil.setImg(imgPoints, IMG_POINTS_SRC);
+ }
+ } else {
+ ComponentUtil.setImgFromResources(pageContext, imgPoints,
+ iconDisabled, IMG_SPACER_SRC);
+ }
+
+ String resultDisabledClass = "";
+ String disabledItemClass = sourceParentElement
+ .getAttribute(DISABLE_ITEM_CLASS);
+ if (!(disabledItemClass == null || disabledItemClass.length() == 0)) {
+ resultDisabledClass += disabledItemClass;
+ }
+ String disabledClass = sourceElement.getAttribute("disabledClass");
+ if (!(disabledClass == null || disabledClass.length() == 0)) {
+ resultDisabledClass += disabledClass;
+ }
+ table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ DISABLED_CLASS + " " + resultDisabledClass);
+
+ String resultDisabledStyle = "";
+ String disabledItemStyle = sourceParentElement
+ .getAttribute(DISABLED_ITEM_STYLE);
+ if (!(disabledItemStyle == null || disabledItemStyle.length() == 0)) {
+ resultDisabledStyle += disabledItemStyle;
+ }
+ String disabledStyle = sourceElement.getAttribute("disabledStyle");
+ if (!(disabledStyle == null || disabledStyle.length() == 0)) {
+ resultDisabledStyle += disabledStyle;
+ }
+ table.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
+ resultDisabledStyle);
+
+ } else {
+ String resultClass = "";
+ String itemClass = parentClass;
+ if (!(itemClass == null || itemClass.length() == 0)) {
+ resultClass += itemClass;
+ }
+ String styleClass = sourceElement.getAttribute("styleClass");
+ if (!(styleClass == null || styleClass.length() == 0)) {
+ resultClass += styleClass;
+ }
+ table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ PANEL_MENU_ITEM_CLASS + " " + resultClass);
+
+ String resultStyle = "";
+ String itemStyle = parentStyle;
+ if (!(itemStyle == null || itemStyle.length() == 0)) {
+ resultStyle += itemStyle;
+ }
+ String style = sourceElement.getAttribute("style");
+ if (!(style == null || style.length() == 0)) {
+ resultStyle += style;
+ }
+ table.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, resultStyle);
+ }
+ }
}
\ No newline at end of file
17 years, 3 months
JBoss Tools SVN: r4218 - in trunk/common/plugins/org.jboss.tools.common.model.ui: src/org/jboss/tools/common/core/resources and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-10-16 07:50:31 -0400 (Tue, 16 Oct 2007)
New Revision: 4218
Added:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/NullEditorPart.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInput.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInputFactory.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartWrapper.java
Log:
JBIDE-765
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/META-INF/MANIFEST.MF 2007-10-16 11:10:30 UTC (rev 4217)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/META-INF/MANIFEST.MF 2007-10-16 11:50:31 UTC (rev 4218)
@@ -111,6 +111,7 @@
org.eclipse.jdt.launching,
org.eclipse.ant.ui,
org.eclipse.core.expressions,
+ org.eclipse.core.filesystem,
org.eclipse.wst.html.core
Bundle-Version: 2.0.0
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInput.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInput.java 2007-10-16 11:10:30 UTC (rev 4217)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInput.java 2007-10-16 11:50:31 UTC (rev 4218)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.common.core.resources;
-import java.io.File;
import java.lang.reflect.Field;
import java.net.MalformedURLException;
import java.net.URI;
@@ -22,6 +21,7 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.*;
import org.eclipse.ui.editors.text.ILocationProvider;
+import org.eclipse.ui.internal.part.NullEditorInput;
import org.eclipse.ui.part.FileEditorInput;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.impl.*;
@@ -233,7 +233,7 @@
String jarFile = entryInfo[0];
String entry = entryInfo[1];
IEditorInput result = createJarEntryEditorInput(jarFile, entry);
- return (result == null) ? input : result;
+ return (result == null || result instanceof NullEditorInput) ? input : result;
}
public static String[] parseJarEntryFileInput(IStorageEditorInput input) {
@@ -266,9 +266,10 @@
return (n == null) ? null : n.getModel().getByPath("/" + entry);
}
- public static IEditorInput createJarEntryEditorInput(String jarFile, String entry) {
+ public static IEditorInput createJarEntryEditorInput(String jarFile, final String entry) {
XModelObject o = getJarEntryObject(jarFile, entry);
- return (o != null) ? new ModelObjectJarEntryEditorInput(o, jarFile, entry) : null;
+ if(o != null) return new ModelObjectJarEntryEditorInput(o, jarFile, entry);
+ return XModelObjectEditorInputFactory.createNullEditorInput(entry);
}
public String getFactoryId() {
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInputFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInputFactory.java 2007-10-16 11:10:30 UTC (rev 4217)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInputFactory.java 2007-10-16 11:50:31 UTC (rev 4218)
@@ -11,9 +11,11 @@
package org.jboss.tools.common.core.resources;
import java.io.File;
+
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
import org.eclipse.ui.*;
+import org.eclipse.ui.internal.part.NullEditorInput;
import org.eclipse.ui.part.*;
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.model.filesystems.impl.FileSystemImpl;
@@ -53,6 +55,7 @@
private IAdaptable createStorageElement(IMemento memento) {
String projectPath = memento.getString(TAG_PROJECT);
XModelObject object = null;
+ String missingName = "";
if(projectPath == null) {
String fileLocation = memento.getString(TAG_FILE_LOCATION);
if(fileLocation != null) {
@@ -60,6 +63,8 @@
if(f.isFile()) {
object = EclipseResourceUtil.createObjectForLocation(fileLocation);
return (object == null) ? null : new ModelObjectLocationEditorInput(object, new Path(f.getAbsolutePath()));
+ } else {
+ missingName = f.getName();
}
}
} else if(memento.getString(TAG_ENTRY) != null) {
@@ -71,12 +76,15 @@
String objectPath = memento.getString(TAG_PATH);
IModelNature nature = EclipseResourceUtil.getModelNature(project);
if(nature == null) {
+ missingName = "" + objectPath;
} else {
XModel model = nature.getModel();
object = model.getByPath(objectPath);
}
}
- if(object == null) return null;
+ if(object == null) {
+ return createNullEditorInput(missingName);
+ }
return new ModelObjectStorageEditorInput(object);
}
@@ -129,5 +137,20 @@
}
return null;
}
+
+ public static IEditorInput createNullEditorInput(final String entry) {
+ return new NullEditorInput() {
+ public String getName() {
+ if(entry != null) {
+ int i = entry.lastIndexOf('/');
+ if(i > 0) return entry.substring(i + 1);
+ }
+ return entry;
+ }
+ public String getToolTipText() {
+ return entry;
+ }
+ };
+ }
}
Added: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/NullEditorPart.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/NullEditorPart.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/NullEditorPart.java 2007-10-16 11:50:31 UTC (rev 4218)
@@ -0,0 +1,51 @@
+package org.jboss.tools.common.editor;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.part.EditorPart;
+
+public class NullEditorPart extends EditorPart {
+
+ public NullEditorPart() {}
+
+ public void doSave(IProgressMonitor monitor) {
+ }
+
+ public void doSaveAs() {
+ }
+
+ public void createPartControl(Composite parent) {
+ Composite c = new Composite(parent, SWT.NONE);
+ c.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
+ c.setLayout(new GridLayout());
+ c.setLayoutData(new GridData(GridData.FILL_BOTH));
+ Label label = new Label(c, SWT.NONE);
+ label.setText("Resource has been externally removed.");
+ label.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
+ }
+
+ public void init(IEditorSite site, IEditorInput input) {
+ setSite(site);
+ setInput(input);
+ setPartName(input.getName());
+ }
+
+ public boolean isDirty() {
+ return false;
+ }
+
+ public boolean isSaveAsAllowed() {
+ return false;
+ }
+
+ public void setFocus() {
+ }
+
+}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartWrapper.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartWrapper.java 2007-10-16 11:10:30 UTC (rev 4217)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartWrapper.java 2007-10-16 11:50:31 UTC (rev 4218)
@@ -16,6 +16,7 @@
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.IProgressMonitor;
import org.jboss.tools.common.core.resources.XModelObjectEditorInput;
+import org.jboss.tools.common.editor.NullEditorPart;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IEditorInput;
@@ -25,6 +26,7 @@
import org.eclipse.ui.IReusableEditor;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.internal.part.NullEditorInput;
import org.eclipse.ui.part.EditorPart;
import org.eclipse.ui.part.WorkbenchPart;
@@ -68,6 +70,14 @@
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
input = XModelObjectEditorInput.checkInput(input);
+ if(input instanceof NullEditorInput) {
+ entity = "";
+ editor = new NullEditorPart();
+ editor.init(site, input);
+ setSite(site);
+ setInput(input);
+ return;
+ }
entity = computeEntity(input);
EditorPartWrapperExtension extension = EditorPartWrapperExtension.getInstance();
EditorPartFactory f = extension.getFactory(entity);
17 years, 3 months
JBoss Tools SVN: r4217 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: amakhtadui
Date: 2007-10-16 07:10:30 -0400 (Tue, 16 Oct 2007)
New Revision: 4217
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-847
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java 2007-10-16 10:48:25 UTC (rev 4216)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java 2007-10-16 11:10:30 UTC (rev 4217)
@@ -306,7 +306,7 @@
pathIconDisabled = sourceParentElement.getAttribute(PANEL_MENU_ATTR_ICON_TOP_DISABLE_GROUP);
}
- if ("right".equalsIgnoreCase(sourceParentElement.getAttribute(PANEL_MENU_ATTR_ICON_TOP_GROUP_POSITION))) {
+ if ("right".equals(sourceParentElement.getAttribute(PANEL_MENU_ATTR_ICON_TOP_GROUP_POSITION))) {
needChangePosition = true;
}
} else {
@@ -320,7 +320,7 @@
pathIconDisabled = sourceParentElement.getAttribute(PANEL_MENU_ATTR_ICON_DISABLE_GROUP);
}
- if ("right".equalsIgnoreCase(sourceParentElement.getAttribute(PANEL_MENU_ATTR_ICON_GROUP_POSITION))) {
+ if ("right".equals(sourceParentElement.getAttribute(PANEL_MENU_ATTR_ICON_GROUP_POSITION))) {
needChangePosition = true;
}
}
@@ -332,23 +332,23 @@
}
if (disabled) {
- if (pathIconDisabled != null && DEFAULT_ICON_MAP.containsKey(pathIconDisabled.toLowerCase())) {
- pathIconDisabled = DEFAULT_ICON_MAP.get(pathIconDisabled.toLowerCase());
+ if (pathIconDisabled != null && DEFAULT_ICON_MAP.containsKey(pathIconDisabled)) {
+ pathIconDisabled = DEFAULT_ICON_MAP.get(pathIconDisabled);
ComponentUtil.setImg(img1, pathIconDisabled);
} else {
ComponentUtil.setImgFromResources(pageContext, img1, pathIconDisabled, PANEL_MENU_GROUP_ICON_SPACER_PATH);
}
} else {
if (expanded) {
- if (pathIconExpanded != null && DEFAULT_ICON_MAP.containsKey(pathIconExpanded.toLowerCase())) {
- pathIconExpanded = DEFAULT_ICON_MAP.get(pathIconExpanded.toLowerCase());
+ if (pathIconExpanded != null && DEFAULT_ICON_MAP.containsKey(pathIconExpanded)) {
+ pathIconExpanded = DEFAULT_ICON_MAP.get(pathIconExpanded);
ComponentUtil.setImg(img1, pathIconExpanded);
} else {
ComponentUtil.setImgFromResources(pageContext, img1, pathIconExpanded, PANEL_MENU_GROUP_ICON_SPACER_PATH);
}
} else {
- if (pathIconCollapsed != null && DEFAULT_ICON_MAP.containsKey(pathIconCollapsed.toLowerCase())) {
- pathIconCollapsed = DEFAULT_ICON_MAP.get(pathIconCollapsed.toLowerCase());
+ if (pathIconCollapsed != null && DEFAULT_ICON_MAP.containsKey(pathIconCollapsed)) {
+ pathIconCollapsed = DEFAULT_ICON_MAP.get(pathIconCollapsed);
ComponentUtil.setImg(img1, pathIconCollapsed);
} else {
ComponentUtil.setImgFromResources(pageContext, img1, pathIconCollapsed, PANEL_MENU_GROUP_ICON_SPACER_PATH);
17 years, 3 months
JBoss Tools SVN: r4216 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces: src/org/jboss/tools/jsf/vpe/richfaces/template and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: amakhtadui
Date: 2007-10-16 06:48:25 -0400 (Tue, 16 Oct 2007)
New Revision: 4216
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/chevron.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/chevronDown.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/chevronUp.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/disc.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/grid.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/triangle.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/triangleDown.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/triangleUp.gif
Removed:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/collapsed.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/point.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/pointer.gif
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java
Log:
Add richFaces icons.
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/chevron.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/chevron.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/chevronDown.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/chevronDown.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/chevronUp.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/chevronUp.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/collapsed.gif
===================================================================
(Binary files differ)
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/disc.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/disc.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/grid.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/grid.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/point.gif
===================================================================
(Binary files differ)
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/pointer.gif
===================================================================
(Binary files differ)
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/triangle.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/triangle.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/triangleDown.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/triangleDown.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/triangleUp.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/triangleUp.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java 2007-10-16 10:44:26 UTC (rev 4215)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java 2007-10-16 10:48:25 UTC (rev 4216)
@@ -11,7 +11,9 @@
package org.jboss.tools.jsf.vpe.richfaces.template;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
@@ -81,18 +83,29 @@
private static final String PANEL_MENU_GROUP_ATTR_ICON_DISABLED = "iconDisabled";
private static final String PANEL_MENU_GROUP_ATTR_ICON_LABEL = "label";
-
- // private static final String PANEL_MENU_GROUP_ATTR_EXPANDED = "expanded";
-
+
private static final String COMPONENT_ATTR_VPE_SUPPORT = "vpeSupport";
private static final String COMPONENT_ATTR_VPE_USER_TOGGLE_ID = "vpe-user-toggle-id";
- private static final String DEFAULT_PANEL_MENU_GROUP_SPACER = "/panelMenuGroup/spacer.gif";
-
+ private static final String PANEL_MENU_GROUP_ICON_SPACER_PATH = "/panelMenuGroup/spacer.gif";
+
private static final String STYLE_PATH = "/panelMenuGroup/style.css";
private static final String EMPTY_DIV_STYLE = "display: none;";
+
+ private static final Map<String, String> DEFAULT_ICON_MAP = new HashMap<String, String>();
+
+ static {
+ DEFAULT_ICON_MAP.put("chevron", "/panelMenuGroup/chevron.gif");
+ DEFAULT_ICON_MAP.put("chevronUp", "/panelMenuGroup/chevronUp.gif");
+ DEFAULT_ICON_MAP.put("chevronDown", "/panelMenuGroup/chevronDown.gif");
+ DEFAULT_ICON_MAP.put("triangle", "/panelMenuGroup/triangle.gif");
+ DEFAULT_ICON_MAP.put("triangleUp", "/panelMenuGroup/triangleUp.gif");
+ DEFAULT_ICON_MAP.put("triangleDown", "/panelMenuGroup/triangleDown.gif");
+ DEFAULT_ICON_MAP.put("disc", "/panelMenuGroup/disc.gif");
+ DEFAULT_ICON_MAP.put("grid", "/panelMenuGroup/grid.gif");
+ }
public VpeCreationData create(VpePageContext pageContext, Node sourceNode, Document visualDocument) {
Element div = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
@@ -168,7 +181,6 @@
private static final void buildTable(VpePageContext pageContext, Element sourceParentElement, Element parent, Element sourceElement, Document visualDocument, Element div, boolean expanded,
boolean disabled, int activeChildId) {
-
String disabledStyle = sourceElement.getAttribute(PANEL_MENU_GROUP_ATTR_DISABLED_STYLE);
String disableClass = null;
String style = sourceElement.getAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
@@ -201,8 +213,8 @@
Element img1 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
column1.appendChild(img1);
+ ComponentUtil.setImg(img1, PANEL_MENU_GROUP_ICON_SPACER_PATH);
img1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "rich-pmenu-group-icon");
- ComponentUtil.setImg(img1, DEFAULT_PANEL_MENU_GROUP_SPACER);
Element column2 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
tableBody.appendChild(column2);
@@ -219,7 +231,7 @@
Element img2 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
column3.appendChild(img2);
img2.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "rich-pmenu-group-icon");
- ComponentUtil.setImg(img2, DEFAULT_PANEL_MENU_GROUP_SPACER);
+ ComponentUtil.setImg(img2, PANEL_MENU_GROUP_ICON_SPACER_PATH);
setIcon(pageContext, parent, sourceParentElement, sourceElement, img1, img2, expanded, disabled);
@@ -257,7 +269,7 @@
}
}
- if(!"".equals(style)) {
+ if(!"".equals(style.trim())) {
table.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, style);
}
table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, styleClass);
@@ -312,7 +324,7 @@
needChangePosition = true;
}
}
-
+
if (needChangePosition) {
Element temp = img2;
img2 = img1;
@@ -320,12 +332,27 @@
}
if (disabled) {
- ComponentUtil.setImgFromResources(pageContext, img1, pathIconDisabled, DEFAULT_PANEL_MENU_GROUP_SPACER);
+ if (pathIconDisabled != null && DEFAULT_ICON_MAP.containsKey(pathIconDisabled.toLowerCase())) {
+ pathIconDisabled = DEFAULT_ICON_MAP.get(pathIconDisabled.toLowerCase());
+ ComponentUtil.setImg(img1, pathIconDisabled);
+ } else {
+ ComponentUtil.setImgFromResources(pageContext, img1, pathIconDisabled, PANEL_MENU_GROUP_ICON_SPACER_PATH);
+ }
} else {
if (expanded) {
- ComponentUtil.setImgFromResources(pageContext, img1, pathIconExpanded, DEFAULT_PANEL_MENU_GROUP_SPACER);
+ if (pathIconExpanded != null && DEFAULT_ICON_MAP.containsKey(pathIconExpanded.toLowerCase())) {
+ pathIconExpanded = DEFAULT_ICON_MAP.get(pathIconExpanded.toLowerCase());
+ ComponentUtil.setImg(img1, pathIconExpanded);
+ } else {
+ ComponentUtil.setImgFromResources(pageContext, img1, pathIconExpanded, PANEL_MENU_GROUP_ICON_SPACER_PATH);
+ }
} else {
- ComponentUtil.setImgFromResources(pageContext, img1, pathIconCollapsed, DEFAULT_PANEL_MENU_GROUP_SPACER);
+ if (pathIconCollapsed != null && DEFAULT_ICON_MAP.containsKey(pathIconCollapsed.toLowerCase())) {
+ pathIconCollapsed = DEFAULT_ICON_MAP.get(pathIconCollapsed.toLowerCase());
+ ComponentUtil.setImg(img1, pathIconCollapsed);
+ } else {
+ ComponentUtil.setImgFromResources(pageContext, img1, pathIconCollapsed, PANEL_MENU_GROUP_ICON_SPACER_PATH);
+ }
}
}
}
17 years, 3 months
JBoss Tools SVN: r4215 - trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-10-16 06:44:26 -0400 (Tue, 16 Oct 2007)
New Revision: 4215
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java
Log:
JBIDE-926
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java 2007-10-16 10:44:19 UTC (rev 4214)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java 2007-10-16 10:44:26 UTC (rev 4215)
@@ -304,88 +304,13 @@
model.changeObjectAttribute(fs, "application name", registry.getApplicationName());
fs.setModified(true);
model.save();
- ModelPlugin.getDefault().getWorkbench().getDisplay().asyncExec(new Runnable() {
+ if(registry.isEnabled()) ModelPlugin.getDefault().getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
- Job job = new RegisterServerJob();
- job.schedule(100);
+ RegistrationHelper.runRegisterInServerJob(getProject(), registry.getTargetServers(), null);
}
});
}
- class RegisterServerJob extends Job {
- long counter = 100;
-
- public RegisterServerJob() {
- super("Register in Server");
- }
-
- protected IStatus run(IProgressMonitor monitor) {
- try {
- if(RegistrationHelper.findModule(getProject()) == null) {
- counter *= 2;
- if(counter > 10000) {
- String mesage = "Timeout expired for registering project " + getProject() + " in server. Please check the project and try context menu action.";
- return new Status(IStatus.ERROR, "org.jboss.tools.jst.web", 0, mesage, null);
- } else {
- schedule(counter);
- }
- } else {
- ModelPlugin.getWorkspace().run(new WR(), monitor);
- }
- } catch (Exception e) {
- WebUiPlugin.getPluginLog().logError(e);
- }
- return Status.OK_STATUS;
- }
- }
-
- class WR implements IWorkspaceRunnable {
- public void run(IProgressMonitor monitor) throws CoreException {
- try {
- registerServer(monitor);
- } catch (Exception e) {
- WebUiPlugin.getPluginLog().logError(e);
- }
- }
-
- }
-
- /*
- *
- */
- private void registerServer(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- if (!registry.isEnabled()) return;
- if(monitor != null) monitor.beginTask("", 100);
- if(monitor != null) monitor.worked(5);
- IServer[] servers = registry.getTargetServers();
- int step = 70;
- if(monitor != null) {
- monitor.worked(5);
- step = step / (2 * servers.length + 1);
- }
- for (int i = 0; i < servers.length; i++) {
- ComponentUtilities.setServerContextRoot(getProject(), registry.getApplicationName());
- if(monitor != null) {
- monitor.worked(step);
- monitor.subTask(servers[i].getName());
- }
- RegistrationHelper.register(getProject(), servers[i]);
- if(monitor != null) monitor.worked(step);
- }
- if(servers.length > 0) {
- IModule module = ServerUtil.getModule("com.ibm.wtp.web.server:" + getProject().getName());
- if(module == null) return;
- try {
- ServerCore.setDefaultServer(module, servers[0], null);
- } catch (CoreException e) {
- WebUiPlugin.getPluginLog().logError(e);
- }
- }
- if(monitor != null) monitor.worked(20);
- }
-
-
-
protected boolean checkOverwrite() {
return true;
}
17 years, 3 months
JBoss Tools SVN: r4214 - trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/server.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-10-16 06:44:19 -0400 (Tue, 16 Oct 2007)
New Revision: 4214
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/server/RegistrationHelper.java
Log:
JBIDE-926
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/server/RegistrationHelper.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/server/RegistrationHelper.java 2007-10-16 10:08:58 UTC (rev 4213)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/server/RegistrationHelper.java 2007-10-16 10:44:19 UTC (rev 4214)
@@ -11,10 +11,19 @@
package org.jboss.tools.jst.web.server;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities;
import org.eclipse.wst.server.core.*;
import org.eclipse.wst.server.core.internal.ServerType;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
+import org.jboss.tools.common.model.project.IModelNature;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.jst.web.WebModelPlugin;
import org.jboss.tools.jst.web.messages.xpl.WebUIMessages;
@@ -182,4 +191,90 @@
}
+ public static void runRegisterInServerJob(IProject p, IServer server) {
+ runRegisterInServerJob(p, new IServer[]{server}, null);
+ }
+
+ public static void runRegisterInServerJob(IProject p, IServer[] servers, String contextRoot) {
+ RegisterServerJob job = new RegisterServerJob(p, servers, contextRoot);
+ job.schedule(100);
+ }
+
+ // registerInJob
+
+ private static class RegisterServerJob extends Job {
+ long counter = 100;
+ IProject p;
+ IServer[] servers;
+ String contextRoot;
+ public RegisterServerJob(IProject p, IServer[] servers, String contextRoot) {
+ super("Register in Server");
+ this.p = p;
+ this.servers = servers;
+ this.contextRoot = contextRoot;
+ }
+
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ if(RegistrationHelper.findModule(p) == null) {
+ counter *= 2;
+ if(counter > 10000) {
+ String mesage = "Timeout expired for registering project " + p + " in server. Please check the project and try context menu action.";
+ return new Status(IStatus.ERROR, "org.jboss.tools.jst.web", 0, mesage, null);
+ } else {
+ schedule(counter);
+ }
+ } else {
+ ModelPlugin.getWorkspace().run(new WR(), monitor);
+ }
+ } catch (Exception e) {
+ WebModelPlugin.getPluginLog().logError(e);
+ }
+ return Status.OK_STATUS;
+ }
+
+ class WR implements IWorkspaceRunnable {
+ public void run(IProgressMonitor monitor) throws CoreException {
+ try {
+ register(p, servers, contextRoot, monitor);
+ } catch (Exception e) {
+ WebModelPlugin.getPluginLog().logError(e);
+ }
+ }
+
+ }
+ }
+
+ private static void register(IProject p, IServer[] servers, String contextRoot, IProgressMonitor monitor) throws Exception {
+ if(monitor != null) monitor.beginTask("", 100);
+ if(monitor != null) monitor.worked(5);
+
+ int step = 70;
+ if(monitor != null) {
+ monitor.worked(5);
+ step = step / (2 * servers.length + 1);
+ }
+ if(contextRoot != null && !contextRoot.equals(ComponentUtilities.getServerContextRoot(p))) {
+ ComponentUtilities.setServerContextRoot(p, contextRoot);
+ }
+ for (int i = 0; i < servers.length; i++) {
+ if(monitor != null) {
+ monitor.worked(step);
+ monitor.subTask(servers[i].getName());
+ }
+ RegistrationHelper.register(p, servers[i]);
+ if(monitor != null) monitor.worked(step);
+ }
+
+ if(contextRoot != null) {
+ IModelNature n = EclipseResourceUtil.getModelNature(p);
+ XModel model = n == null ? null : n.getModel();
+ if(model != null) {
+ XModelObject object = FileSystemsHelper.getFileSystems(model);
+ if(object != null) model.changeObjectAttribute(object, "application name", contextRoot);
+ }
+ }
+ if(monitor != null) monitor.worked(20);
+ }
+
}
17 years, 3 months