JBoss Tools SVN: r14260 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2009-03-19 04:07:07 -0400 (Thu, 19 Mar 2009)
New Revision: 14260
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3888
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java 2009-03-19 08:04:16 UTC (rev 14259)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java 2009-03-19 08:07:07 UTC (rev 14260)
@@ -96,7 +96,9 @@
List<TaglibData> taglibs =XmlUtil.getTaglibsForJSPDocument(iDocument,getIncludeTaglibs());
//if we on jsp page we will set taglibs
//TODO Max Areshkau Find other passability to check if we on jsp page
- if(taglibs!=null && taglibs.size()>0) {
+ // FIX FOR https://jira.jboss.org/jira/browse/JBIDE-3888
+ // in some cases list of taglibs is not refreshed
+ if(taglibs!=null /*&& taglibs.size()>0*/) {
setTaglibs(taglibs);
}
try {
15 years, 3 months
JBoss Tools SVN: r14259 - in trunk/vpe/plugins/org.jboss.tools.vpe: src/org/jboss/tools/vpe/editor/menu and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2009-03-19 04:04:16 -0400 (Thu, 19 Mar 2009)
New Revision: 14259
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/SetupTemplateContributionItem.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/SetupTemplateAction.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/MenuCreationHelper.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-3978
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml 2009-03-18 19:02:26 UTC (rev 14258)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml 2009-03-19 08:04:16 UTC (rev 14259)
@@ -92,6 +92,13 @@
id="org.jboss.tools.vpe.editor.menu.InsertContributionItem">
</dynamic>
</menuContribution>
+ <menuContribution
+ locationURI="popup:org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor.source.EditorContext?after=org.jboss.tools.vpe.editor.menu.InsertContributionItem">
+ <dynamic
+ class="org.jboss.tools.vpe.editor.menu.SetupTemplateContributionItem"
+ id="org.jboss.tools.vpe.editor.menu.SetupTemplateContributionItem">
+ </dynamic>
+ </menuContribution>
</extension>
<extension
point="org.eclipse.ui.menus">
@@ -105,5 +112,12 @@
id="org.jboss.tools.vpe.editor.menu.InsertContributionItem">
</dynamic>
</menuContribution>
+ <menuContribution
+ locationURI="popup:org.jboss.tools.jst.jsp.jspeditor.HTMLTextEditor.source.EditorContext?after=org.jboss.tools.vpe.editor.menu.InsertContributionItem">
+ <dynamic
+ class="org.jboss.tools.vpe.editor.menu.SetupTemplateContributionItem"
+ id="org.jboss.tools.vpe.editor.menu.SetupTemplateContributionItem">
+ </dynamic>
+ </menuContribution>
</extension>
</plugin>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/MenuCreationHelper.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/MenuCreationHelper.java 2009-03-18 19:02:26 UTC (rev 14258)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/MenuCreationHelper.java 2009-03-19 08:04:16 UTC (rev 14259)
@@ -214,7 +214,7 @@
&& elementMapping.getTemplate().getType() == VpeHtmlTemplate.TYPE_ANY) {
final VpeTemplate selectedTemplate = elementMapping.getTemplate();
manager.add(new VpeAction(NLS.bind(VpeUIMessages.SETUP_TEMPLATE_FOR_MENU,
- "<" + node.getNodeName() + ">"), node) { //$NON-NLS-1$ //$NON-NLS-2$
+ node.getNodeName() ), node) {
public void run() {
boolean isCorrectNS = pageContext.isCorrectNS(actionNode);
VpeAnyData data = null;
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/SetupTemplateContributionItem.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/SetupTemplateContributionItem.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/SetupTemplateContributionItem.java 2009-03-19 08:04:16 UTC (rev 14259)
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.vpe.editor.menu;
+
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.editor.VpeEditorPart;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.mapping.VpeElementMapping;
+import org.jboss.tools.vpe.editor.menu.action.SetupTemplateAction;
+import org.jboss.tools.vpe.editor.template.VpeHtmlTemplate;
+import org.jboss.tools.vpe.editor.util.Constants;
+import org.jboss.tools.vpe.messages.VpeUIMessages;
+import org.w3c.dom.Element;
+
+/**
+ * @author Sergey Dzmitrovich
+ *
+ */
+public class SetupTemplateContributionItem extends ActionContributionItem {
+
+ private VpePageContext pageContext;
+
+ private StructuredTextEditor sourceEditor;
+
+ /**
+ *
+ */
+ public SetupTemplateContributionItem() {
+ super(new SetupTemplateAction());
+ JSPMultiPageEditor editor = (JSPMultiPageEditor) PlatformUI
+ .getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .getActiveEditor();
+ this.sourceEditor = editor.getSourceEditor();
+ this.pageContext = ((VpeEditorPart) editor.getVisualEditor())
+ .getController().getPageContext();
+ ((SetupTemplateAction) getAction()).setPageContext(pageContext);
+ }
+
+ /**
+ *
+ */
+ public SetupTemplateContributionItem(VpePageContext pageContext,
+ StructuredTextEditor sourceEditor) {
+ super(new SetupTemplateAction(pageContext));
+ this.pageContext = pageContext;
+ this.sourceEditor = sourceEditor;
+
+ }
+
+ @Override
+ public void fill(Menu menu, int index) {
+
+ IStructuredSelection selection = (IStructuredSelection) sourceEditor
+ .getSelectionProvider().getSelection();
+
+ if (selection != null && selection.size() == 1
+ && selection.getFirstElement() instanceof Element) {
+ Element element = (Element) selection.getFirstElement();
+ VpeElementMapping elementMapping = (VpeElementMapping) pageContext
+ .getDomMapping().getNodeMapping(element);
+ if (elementMapping != null
+ && elementMapping.getTemplate() != null
+ && elementMapping.getTemplate().getType() == VpeHtmlTemplate.TYPE_ANY) {
+
+ ((SetupTemplateAction) getAction()).setText(NLS.bind(
+ VpeUIMessages.SETUP_TEMPLATE_FOR_MENU, element
+ .getNodeName()));
+ ((SetupTemplateAction) getAction()).setActionNode(element);
+ ((SetupTemplateAction) getAction()).setData(elementMapping
+ .getTemplate().getAnyData());
+ MenuItem item = new MenuItem(menu, SWT.SEPARATOR, index );
+ super.fill(menu, index+1);
+ }
+ }
+
+ }
+
+}
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/SetupTemplateAction.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/SetupTemplateAction.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/SetupTemplateAction.java 2009-03-19 08:04:16 UTC (rev 14259)
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.vpe.editor.menu.action;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeAnyData;
+import org.jboss.tools.vpe.editor.template.VpeEditAnyDialog;
+import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
+import org.jboss.tools.vpe.messages.VpeUIMessages;
+import org.w3c.dom.Node;
+
+/**
+ * @author Sergey Dzmitrovich
+ *
+ */
+public class SetupTemplateAction extends Action {
+
+ private Node actionNode;
+
+ private VpePageContext pageContext;
+
+ public void setActionNode(Node actionNode) {
+ this.actionNode = actionNode;
+ }
+
+ public void setPageContext(VpePageContext pageContext) {
+ this.pageContext = pageContext;
+ }
+
+ public void setData(VpeAnyData data) {
+ this.data = data;
+ }
+
+ private VpeAnyData data;
+
+ /**
+ * @param text
+ */
+ public SetupTemplateAction(String title, Node actionNode, VpeAnyData data,
+ VpePageContext pageContext) {
+ super(title);
+ this.actionNode = actionNode;
+ this.pageContext = pageContext;
+ this.data = data;
+
+ }
+
+ public SetupTemplateAction(VpePageContext pageContext) {
+ this.pageContext = pageContext;
+ }
+
+ public SetupTemplateAction() {
+ }
+
+ @Override
+ public void run() {
+ boolean isCorrectNS = pageContext.isCorrectNS(actionNode);
+ if (isCorrectNS) {
+ data.setUri(pageContext.getSourceTaglibUri(actionNode));
+ data.setName(actionNode.getNodeName());
+ }
+
+ Shell shell = PlatformUI
+ .getWorkbench().getActiveWorkbenchWindow().getShell();
+
+ if (isCorrectNS) {
+ VpeEditAnyDialog editDialog = new VpeEditAnyDialog(shell, data);
+ editDialog.open();
+ } else {
+ MessageBox message = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK);
+ message.setMessage(VpeUIMessages.NAMESPACE_NOT_DEFINED);
+ message.open();
+ }
+ if (data != null && data.isChanged())
+ VpeTemplateManager.getInstance().setAnyTemplate(data);
+ }
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2009-03-18 19:02:26 UTC (rev 14258)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2009-03-19 08:04:16 UTC (rev 14259)
@@ -73,7 +73,7 @@
MAX_VISUAL_PANE=Maximize Visual Pane
RESTORE_PREVIOUS_LOCATION=Restore Previous Location
BACKGROUND_COLOR_TIP=Choose background color
-SETUP_TEMPLATE_FOR_MENU=Setup Template for {0}
+SETUP_TEMPLATE_FOR_MENU=Setup Template for <{0}>
INSERT_AROUND=Insert Around
INSERT_BEFORE=Insert Before
INSERT_AFTER=Insert After
15 years, 3 months
JBoss Tools SVN: r14258 - in trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog: common and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2009-03-18 15:02:26 -0400 (Wed, 18 Mar 2009)
New Revision: 14258
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSValidator.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/StyleAttributes.java
Log:
RESOLVED - issue JBIDE-3910: Need extended validator for CSS class name
https://jira.jboss.org/jira/browse/JBIDE-3910
- validator has been added.
- now css dialog does not format CSS before save
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java 2009-03-18 14:03:03 UTC (rev 14257)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java 2009-03-18 19:02:26 UTC (rev 14258)
@@ -51,6 +51,7 @@
import org.jboss.tools.common.model.ui.widgets.Split;
import org.jboss.tools.jst.jsp.messages.JstUIMessages;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.CSSModel;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.CSSValidator;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.Constants;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.Util;
import org.jboss.tools.jst.jsp.outline.cssdialog.events.ChangeStyleEvent;
@@ -360,14 +361,16 @@
InputDialog dlg = new InputDialog(parent.getShell(),
JstUIMessages.ENTER_CSS_CLASS_NAME, JstUIMessages.ENTER_CSS_CLASS_NAME, classCombo.getText(),
new IInputValidator(){
+ private CSSValidator cssValidator = CSSValidator.getInstance();
/**
* Simple validation of new CSS Class Name, now we just check that it's not empty string
*/
public String isValid(String newText) {
- if(newText==null || newText.trim().length()==0){
+ if (cssValidator.isValidSelector(newText)) {
+ return null;
+ } else {
return JstUIMessages.CSS_CLASS_NAME_NOT_VALID;
}
- return null;
}
});
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java 2009-03-18 14:03:03 UTC (rev 14257)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java 2009-03-18 19:02:26 UTC (rev 14258)
@@ -33,6 +33,7 @@
import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
+import org.eclipse.wst.css.core.internal.provisional.document.ICSSRuleContainer;
import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet;
import org.eclipse.wst.css.core.internal.text.StructuredTextPartitionerForCSS;
import org.eclipse.wst.sse.core.StructuredModelManager;
@@ -273,9 +274,9 @@
// formatProcessorCSS.formatModel(model);
CSSStyleRule rule = getRulesMapping().get(selector);
if (rule == null) {
- styleSheet.insertRule(selector + startBraces
- + styleAttributes.getStyle() + endBraces, list
- .getLength());
+ rule = (CSSStyleRule)((ICSSDocument)styleSheet).createCSSRule(
+ selector + startBraces + styleAttributes.getStyle() + endBraces);
+ ((ICSSStyleSheet)styleSheet).appendRule(rule);
} else {
CSSStyleDeclaration declaration = rule.getStyle();
@@ -290,9 +291,6 @@
Constants.EMPTY);
}
}
-
- formatProcessorCSS.formatModel(model);
-
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSValidator.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSValidator.java 2009-03-18 14:03:03 UTC (rev 14257)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSValidator.java 2009-03-18 19:02:26 UTC (rev 14258)
@@ -10,13 +10,17 @@
******************************************************************************/
package org.jboss.tools.jst.jsp.outline.cssdialog.common;
+import java.lang.ref.Reference;
+import java.lang.ref.SoftReference;
import java.lang.reflect.Field;
import java.util.ArrayList;
import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.w3c.dom.css.CSSRuleList;
import org.w3c.dom.css.CSSStyleDeclaration;
import org.w3c.dom.css.CSSStyleRule;
import org.w3c.dom.css.CSSStyleSheet;
@@ -25,111 +29,133 @@
* CSS Validator
*
* @author yradtsevich
- *
+ *
*/
+@SuppressWarnings("restriction")
public class CSSValidator {
- // FIXME: this hard-coded string have to be replaced by reference
- private static final String CSS_CONTENT_TYPE_IDENTIFIER = "org.eclipse.wst.css.core.csssource"; //$NON-NLS-1$
- private final CSSStyleSheet validatingCSS;
- private final LogHacker logHacker = new LogHacker();
-
- @SuppressWarnings("restriction")
- public CSSValidator() {
- IModelManager modelManager = StructuredModelManager.getModelManager();
- ICSSModel validatingModel = (ICSSModel) modelManager.createUnManagedStructuredModelFor(CSS_CONTENT_TYPE_IDENTIFIER);
-
- validatingCSS = (CSSStyleSheet) validatingModel.getDocument();
- }
+ // FIXME: this hard-coded string have to be replaced by reference
+ private static final String CSS_CONTENT_TYPE_IDENTIFIER = "org.eclipse.wst.css.core.csssource"; //$NON-NLS-1$
+ private final CSSStyleSheet validatingCSS;
+ private final IStructuredDocument validatingDocument;
+ private final LogHacker logHacker = new LogHacker();
+ private static Reference<CSSValidator> instanceCache;
- private void cleanValidatingCSS() {
- int ruleNumber;
+ public static CSSValidator getInstance() {
+ CSSValidator instance = null;
+ if (instanceCache != null) {
+ instance = instanceCache.get();
+ }
+ if (instance == null) {
+ instance = new CSSValidator();
+ instanceCache = new SoftReference<CSSValidator>(instance);
+ }
+ return instance;
+ }
+
+ private CSSValidator() {
+ IModelManager modelManager = StructuredModelManager.getModelManager();
+ ICSSModel validatingModel = (ICSSModel) modelManager
+ .createUnManagedStructuredModelFor(CSS_CONTENT_TYPE_IDENTIFIER);
+ validatingDocument = validatingModel.getStructuredDocument();
+ validatingCSS = (CSSStyleSheet) validatingModel.getDocument();
+ }
- while ((ruleNumber = validatingCSS.getCssRules().getLength()) > 0) {
- validatingCSS.deleteRule(ruleNumber - 1);
- }
- }
+ private void cleanValidatingDocument() {
+ validatingDocument.set(""); //$NON-NLS-1$
+ }
- /**
- * Validates value of a CSS attribute.
- *
- * @param value the
- * @return {@code true} if the attribute is valid, {@code false} otherwise
- */
- public boolean isValidValue(String value) {
- logHacker.disableLogging();
- boolean valid = true;
- try {
- validatingCSS.insertRule(".testSelector {}", 0); //$NON-NLS-1$
- CSSStyleRule cssRule = ((CSSStyleRule) validatingCSS.getCssRules().item(0));
- CSSStyleDeclaration declaration = cssRule.getStyle();
- declaration.setProperty("background", value, Constants.EMPTY); //$NON-NLS-1$
- } catch (Throwable e) {
- valid = false;
- } finally {
- logHacker.enableLogging();
- cleanValidatingCSS();
- }
+ /**
+ * Validates value of a CSS attribute.
+ *
+ * @param value
+ * the
+ * @return {@code true} if the attribute is valid, {@code false} otherwise
+ */
+ public boolean isValidValue(String value) {
+ logHacker.disableLogging();
+ boolean valid = true;
+ try {
+ validatingCSS.insertRule(".testSelector {}", 0); //$NON-NLS-1$
+ CSSStyleRule cssRule = ((CSSStyleRule) validatingCSS.getCssRules().item(0));
+ CSSStyleDeclaration declaration = cssRule.getStyle();
+ declaration.setProperty("background", value, Constants.EMPTY); //$NON-NLS-1$
+ } catch (Throwable e) {
+ valid = false;
+ } finally {
+ logHacker.enableLogging();
+ cleanValidatingDocument();
+ }
- return valid;
- }
+ return valid;
+ }
- /**
- * Validates CSS selector value.
- *
- * @param selector the selector value
- * @return {@code true} if the selector is valid, {@code false} otherwise
- */
- public boolean isValidSelector(String selector) {
- boolean valid = true;
- try {
- validatingCSS.insertRule(selector + " {}", 0); //$NON-NLS-1$
- } catch (Throwable e) {
- valid = false;
- } finally {
- cleanValidatingCSS();
- }
+ /**
+ * Validates CSS selector value.
+ *
+ * @param selector
+ * the selector value
+ * @return {@code true} if the selector is valid, {@code false} otherwise
+ */
+ public boolean isValidSelector(String selector) {
+ validatingDocument.set(selector + "{}"); //$NON-NLS-1$
- return valid;
- }
+ CSSRuleList cssRules = validatingCSS.getCssRules();
+ if (cssRules.getLength() != 1) {
+ // if the selector is like 'a{} b', or it is empty, or the rule cannot be created
+ return false;
+ }
- /**
- * Gives opportunity to delete all loggers from {@link org.eclipse.core.internal.runtime.RuntimeLog}
- *
- * @author yradtsevich
- *
- */
- private class LogHacker {
- private Field logListeners = null;
- private Object oldValue = null;
-
- public LogHacker() {
- try {
- logListeners = org.eclipse.core.internal.runtime.RuntimeLog.class.getDeclaredField("logListeners");
- logListeners.setAccessible(true);
- } catch (Throwable e) {
- JspEditorPlugin.getPluginLog().logError(e);
- }
- }
+ CSSStyleRule cssRule = (CSSStyleRule) cssRules.item(0);
+ if (!selector.equals(cssRule.getSelectorText())) {
+ // if the selector is like 'a{{{'
+ return false;
+ }
- public void disableLogging() {
- try {
- oldValue = logListeners.get(null);
- logListeners.set(null, new ArrayList(0));
- } catch (Throwable e) {
- JspEditorPlugin.getPluginLog().logError(e);
- }
- }
+ cleanValidatingDocument();
- public void enableLogging() {
- try {
- if (oldValue != null) {
- logListeners.set(null, oldValue);
- }
- } catch (Throwable e) {
- JspEditorPlugin.getPluginLog().logError(e);
- } finally {
- oldValue = null;
- }
- }
- }
+ return true;
+ }
+
+ /**
+ * Provides a way to temporarily delete all loggers from
+ * {@link org.eclipse.core.internal.runtime.RuntimeLog}
+ *
+ * @author yradtsevich
+ *
+ */
+ private class LogHacker {
+ private Field logListeners = null;
+ private Object oldValue = null;
+
+ public LogHacker() {
+ try {
+ logListeners = org.eclipse.core.internal.runtime.RuntimeLog.class
+ .getDeclaredField("logListeners");
+ logListeners.setAccessible(true);
+ } catch (Throwable e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ }
+ }
+
+ public void disableLogging() {
+ try {
+ oldValue = logListeners.get(null);
+ logListeners.set(null, new ArrayList<Object>(0));
+ } catch (Throwable e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ }
+ }
+
+ public void enableLogging() {
+ try {
+ if (oldValue != null) {
+ logListeners.set(null, oldValue);
+ }
+ } catch (Throwable e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ } finally {
+ oldValue = null;
+ }
+ }
+ }
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/StyleAttributes.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/StyleAttributes.java 2009-03-18 14:03:03 UTC (rev 14257)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/StyleAttributes.java 2009-03-18 19:02:26 UTC (rev 14258)
@@ -33,7 +33,7 @@
*/
public StyleAttributes() {
this.attributeMap = new HashMap<String, String>();
- cssValidator = new CSSValidator();
+ cssValidator = CSSValidator.getInstance();
}
/**
15 years, 3 months
JBoss Tools SVN: r14257 - in trunk: jsf/plugins/org.jboss.tools.jsf.vpe.myfaces/src/org/jboss/tools/jsf/vpe/myfaces/template and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2009-03-18 10:03:03 -0400 (Wed, 18 Mar 2009)
New Revision: 14257
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.myfaces/src/org/jboss/tools/jsf/vpe/myfaces/template/VpeMyFacesDataScrollerTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSubTableTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarGroupTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractCreator.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreator.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableColumnCreator.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeFacetCreator.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3954, code adjustment
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineTemplate.java 2009-03-18 11:12:45 UTC (rev 14256)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineTemplate.java 2009-03-18 14:03:03 UTC (rev 14257)
@@ -39,7 +39,7 @@
}
@Override
- public Node getNodeForUptate(VpePageContext pageContext, Node sourceNode, nsIDOMNode visualNode, Object data) {
+ public Node getNodeForUpdate(VpePageContext pageContext, Node sourceNode, nsIDOMNode visualNode, Object data) {
return sourceNode.getParentNode();
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.myfaces/src/org/jboss/tools/jsf/vpe/myfaces/template/VpeMyFacesDataScrollerTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.myfaces/src/org/jboss/tools/jsf/vpe/myfaces/template/VpeMyFacesDataScrollerTemplate.java 2009-03-18 11:12:45 UTC (rev 14256)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.myfaces/src/org/jboss/tools/jsf/vpe/myfaces/template/VpeMyFacesDataScrollerTemplate.java 2009-03-18 14:03:03 UTC (rev 14257)
@@ -148,17 +148,6 @@
}
/* (non-Javadoc)
- * @see org.jboss.tools.vpe.editor.template.VpeTemplate#getNodeForUptate(org.jboss.tools.vpe.editor.context.VpePageContext, org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMNode, java.lang.Object)
- */
- @Override
- public Node getNodeForUptate(VpePageContext pageContext, Node sourceNode,
- nsIDOMNode visualNode, Object data) {
- // TODO Auto-generated method stub
- return null;
- }
-
-
- /* (non-Javadoc)
* @see org.jboss.tools.vpe.editor.template.VpeTemplate#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)
*/
@Override
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java 2009-03-18 11:12:45 UTC (rev 14256)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java 2009-03-18 14:03:03 UTC (rev 14257)
@@ -118,10 +118,10 @@
}
/* (non-Javadoc)
- * @see org.jboss.tools.vpe.editor.template.VpeAbstractTemplate#getNodeForUptate(org.jboss.tools.vpe.editor.context.VpePageContext, org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMNode, java.lang.Object)
+ * @see org.jboss.tools.vpe.editor.template.VpeAbstractTemplate#getNodeForUpdate(org.jboss.tools.vpe.editor.context.VpePageContext, org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMNode, java.lang.Object)
*/
@Override
- public Node getNodeForUptate(VpePageContext pageContext, Node sourceNode,
+ public Node getNodeForUpdate(VpePageContext pageContext, Node sourceNode,
nsIDOMNode visualNode, Object data) {
/* XXX: The implementation is a little tricky, it returns first n-th parent
* that has a nodeMapping. */
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSubTableTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSubTableTemplate.java 2009-03-18 11:12:45 UTC (rev 14256)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSubTableTemplate.java 2009-03-18 14:03:03 UTC (rev 14257)
@@ -301,9 +301,9 @@
/* (non-Javadoc)
- * @see org.jboss.tools.vpe.editor.template.VpeAbstractTemplate#getNodeForUptate(org.jboss.tools.vpe.editor.context.VpePageContext, org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMNode, java.lang.Object) */
+ * @see org.jboss.tools.vpe.editor.template.VpeAbstractTemplate#getNodeForUpdate(org.jboss.tools.vpe.editor.context.VpePageContext, org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMNode, java.lang.Object) */
@Override
- public Node getNodeForUptate(VpePageContext pageContext, Node sourceNode,
+ public Node getNodeForUpdate(VpePageContext pageContext, Node sourceNode,
nsIDOMNode visualNode, Object data) {
Node parent = sourceNode.getParentNode();
return parent;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarGroupTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarGroupTemplate.java 2009-03-18 11:12:45 UTC (rev 14256)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarGroupTemplate.java 2009-03-18 14:03:03 UTC (rev 14257)
@@ -222,7 +222,7 @@
@Override
- public Node getNodeForUptate(VpePageContext pageContext, Node sourceNode, nsIDOMNode visualNode, Object data) {
+ public Node getNodeForUpdate(VpePageContext pageContext, Node sourceNode, nsIDOMNode visualNode, Object data) {
String prefix = sourceNode.getPrefix();
if (prefix == null) {
return null;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2009-03-18 11:12:45 UTC (rev 14256)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2009-03-18 14:03:03 UTC (rev 14257)
@@ -990,7 +990,7 @@
elementMapping = (VpeElementMapping) nodeMapping;
if (elementMapping != null && elementMapping.getTemplate() != null) {
Node updateNode = elementMapping.getTemplate()
- .getNodeForUptate(pageContext,
+ .getNodeForUpdate(pageContext,
elementMapping.getSourceNode(),
elementMapping.getVisualNode(),
elementMapping.getData());
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractCreator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractCreator.java 2009-03-18 11:12:45 UTC (rev 14256)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractCreator.java 2009-03-18 14:03:03 UTC (rev 14257)
@@ -120,7 +120,7 @@
return false;
}
- public Node getNodeForUptate(VpePageContext pageContext, Node sourceNode, nsIDOMNode visualNode, Map visualNodeMap) {
+ public Node getNodeForUpdate(VpePageContext pageContext, Node sourceNode, nsIDOMNode visualNode, Map visualNodeMap) {
return null;
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java 2009-03-18 11:12:45 UTC (rev 14256)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java 2009-03-18 14:03:03 UTC (rev 14257)
@@ -868,7 +868,7 @@
* @return For this node of an source tree the method update is invoked. If
* null, that is invoked update for current source node
*/
- public Node getNodeForUptate(VpePageContext pageContext, Node sourceNode,
+ public Node getNodeForUpdate(VpePageContext pageContext, Node sourceNode,
nsIDOMNode visualNode, Object data) {
return null;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreator.java 2009-03-18 11:12:45 UTC (rev 14256)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreator.java 2009-03-18 14:03:03 UTC (rev 14257)
@@ -111,5 +111,5 @@
*/
boolean nonctrlKeyPressHandler(VpePageContext pageContext, Document sourceDocument, Node sourceNode, Object data, long charCode, VpeSourceSelection selection, ITextFormatter formatter);
- Node getNodeForUptate(VpePageContext pageContext, Node sourceNode, nsIDOMNode visualNode, Map<VpeTemplate,?> visualNodeMap);
+ Node getNodeForUpdate(VpePageContext pageContext, Node sourceNode, nsIDOMNode visualNode, Map<VpeTemplate,?> visualNodeMap);
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableColumnCreator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableColumnCreator.java 2009-03-18 11:12:45 UTC (rev 14256)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableColumnCreator.java 2009-03-18 14:03:03 UTC (rev 14257)
@@ -155,10 +155,10 @@
}
/* (non-Javadoc)
- * @see org.jboss.tools.vpe.editor.template.VpeAbstractCreator#getNodeForUptate(org.jboss.tools.vpe.editor.context.VpePageContext, org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMNode, java.util.Map)
+ * @see org.jboss.tools.vpe.editor.template.VpeAbstractCreator#getNodeForUpdate(org.jboss.tools.vpe.editor.context.VpePageContext, org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMNode, java.util.Map)
*/
@Override
- public Node getNodeForUptate(VpePageContext pageContext, Node sourceNode,
+ public Node getNodeForUpdate(VpePageContext pageContext, Node sourceNode,
nsIDOMNode visualNode, Map visualNodeMap) {
return sourceNode.getParentNode();
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeFacetCreator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeFacetCreator.java 2009-03-18 11:12:45 UTC (rev 14256)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeFacetCreator.java 2009-03-18 14:03:03 UTC (rev 14257)
@@ -107,7 +107,7 @@
return true;
}
- public Node getNodeForUptate(VpePageContext pageContext, Node sourceNode, Node visualNode, Map visualNodeMap) {
+ public Node getNodeForUpdate(VpePageContext pageContext, Node sourceNode, Node visualNode, Map visualNodeMap) {
return sourceNode.getParentNode();
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java 2009-03-18 11:12:45 UTC (rev 14256)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java 2009-03-18 14:03:03 UTC (rev 14257)
@@ -584,14 +584,14 @@
return false;
}
@Override
- public Node getNodeForUptate(VpePageContext pageContext, Node sourceNode, nsIDOMNode visualNode, Object data) {
+ public Node getNodeForUpdate(VpePageContext pageContext, Node sourceNode, nsIDOMNode visualNode, Object data) {
// TODO Sergey Vasilyev redevelop JSF's facet template
if (sourceNode.getNodeName().endsWith(":facet")) {
return sourceNode.getParentNode();
}
if (creator != null) {
- return creator.getNodeForUptate(pageContext, sourceNode, visualNode, (Map<VpeTemplate,?>)data);
+ return creator.getNodeForUpdate(pageContext, sourceNode, visualNode, (Map<VpeTemplate,?>)data);
}
return null;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplate.java 2009-03-18 11:12:45 UTC (rev 14256)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplate.java 2009-03-18 14:03:03 UTC (rev 14257)
@@ -173,7 +173,7 @@
* @return For this node of an source tree the method update is invoked. If
* null, that is invoked update for current source node
*/
- Node getNodeForUptate(VpePageContext pageContext, Node sourceNode,
+ Node getNodeForUpdate(VpePageContext pageContext, Node sourceNode,
nsIDOMNode visualNode, Object data);
/**
15 years, 3 months
JBoss Tools SVN: r14256 - trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-03-18 07:12:45 -0400 (Wed, 18 Mar 2009)
New Revision: 14256
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3917, resizer will be repaint on window resize event.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2009-03-18 10:19:32 UTC (rev 14255)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2009-03-18 11:12:45 UTC (rev 14256)
@@ -114,7 +114,13 @@
public void handleEvent(Event event) {
Display.getCurrent().asyncExec(new Thread(){
public void run(){
- showSelectionRectangle();
+ /*
+ * https://jira.jboss.org/jira/browse/JBIDE-3917
+ * Resizer should be updated together with selection rectangle.
+ * Otherwise after window maximizing/restoring resizer shows old position.
+ */
+ showResizer();
+ showSelectionRectangle();
}
});
}};
@@ -152,9 +158,16 @@
// addListener(SWT.Activate, eventListenet);
addListener(SWT.Paint, eventListenet);
+ /*
+ * https://jira.jboss.org/jira/browse/JBIDE-3917
+ * Resizer and selection rectangle should be updated
+ * after eclipse window resizing.
+ * Need to test on Mac OS.
+ */
//Commented by Max Areshkau (bug on Mac OS X10.4
//when switch from visual to preview selection rectangle doen't disappear
-// addListener(SWT.Resize, eventListenet);
+ addListener(SWT.Resize, eventListenet);
+
addListener(SWT.Show, eventListenet);
addListener(SWT.FocusIn, eventListenet);
//Commented by Max Areshkau (bug on Mac OS X10.4
@@ -325,7 +338,7 @@
* @param scroll
*/
public void setSelectionRectangle(nsIDOMNode node, int resizerConstrains, boolean scroll) {
- if (getIFlasher() == null) {
+ if (getIFlasher() == null) {
return;
}
15 years, 3 months
JBoss Tools SVN: r14255 - trunk/as/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-03-18 06:19:32 -0400 (Wed, 18 Mar 2009)
New Revision: 14255
Modified:
trunk/as/docs/reference/en/modules/perspective.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-595 - adding the note about more strict server launches;
Modified: trunk/as/docs/reference/en/modules/perspective.xml
===================================================================
--- trunk/as/docs/reference/en/modules/perspective.xml 2009-03-18 10:13:28 UTC (rev 14254)
+++ trunk/as/docs/reference/en/modules/perspective.xml 2009-03-18 10:19:32 UTC (rev 14255)
@@ -548,8 +548,8 @@
<para>Starting from 2.0.0.CR2 version of <property>JBoss AS Tools</property> the
<property>JBoss Server View</property> supports drag-n-drop of deployable and
- runnable projects/resources.</para>
-
+ runnable projects/resources.</para>
+
<figure>
<title>Dragging to the JBoss Server View</title>
<mediaobject>
@@ -558,9 +558,9 @@
</imageobject>
</mediaobject>
</figure>
-
+
<para>With drag-n-drop the following actions can be performed:</para>
-
+
<itemizedlist>
<listitem>
<para>dragging a project to a server will deploy it to the server and run it by
@@ -578,9 +578,9 @@
<listitem>
<para>dragging a deployable resource (i.e. a datasource (<emphasis>
- <property>-ds.xml</property></emphasis>) file that has
- been made deployable) will simply deploy that resource directly to the
- server</para>
+ <property>-ds.xml</property>
+ </emphasis>) file that has been made deployable) will simply deploy that
+ resource directly to the server</para>
</listitem>
</itemizedlist>
@@ -769,6 +769,21 @@
url="http://docs.jboss.org/jbossas/guides/installguide/r1/en/html/start-stop.html"
>here</ulink> to find parameters which can be specified for <property>JBoss
Server</property>.</para>
+
+ <note>
+ <title>Note:</title>
+ <para>The Launch Configurations for JBoss Servers are enough strict in enforcing the
+ configured values in the server in order to avoid inconsistencies between
+ server's and their configured runtime.</para>
+
+ <para>For example, if you change the launch configuration program arguments to <emphasis>"-c
+ myConfig"</emphasis> but do not change the targeted runtime configuration, then your program
+ arguments will be ignored. The server runtime "wins" so to speak. This ensures
+ consistency and if you change the location of the runtime, your launch
+ configurations will automatically pick that up.</para>
+
+ <para>Values are not controlled by the server and its runtime setup will be passed on unaltered.</para>
+ </note>
</section>
<section>
15 years, 3 months
JBoss Tools SVN: r14254 - in trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el: internal/core/parser/token and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-03-18 06:13:28 -0400 (Wed, 18 Mar 2009)
New Revision: 14254
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/Tokenizer.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/PrimitiveValueTokenDescription.java
Log:
JBIDE-3951
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/Tokenizer.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/Tokenizer.java 2009-03-18 09:59:04 UTC (rev 14253)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/Tokenizer.java 2009-03-18 10:13:28 UTC (rev 14254)
@@ -157,6 +157,10 @@
return copy;
}
+ public void addSyntaxError(SyntaxError error) {
+ errors.add(error);
+ }
+
public void addToken(int type, int start, int end) {
if(end < 0) return;
int lastEnd = last.getStart() + last.getLength();
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/PrimitiveValueTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/PrimitiveValueTokenDescription.java 2009-03-18 09:59:04 UTC (rev 14253)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/PrimitiveValueTokenDescription.java 2009-03-18 10:13:28 UTC (rev 14254)
@@ -141,7 +141,7 @@
&& dotCount < 1) {
SyntaxError error = new SyntaxError(dotOffset, BasicStates.STATE_EXPECTING_ARG);
error.setProblem("Argument must resolve to integer or string.");
- tokenizer.getErrors().add(error);
+ tokenizer.addSyntaxError(error);
}
tokenizer.addToken(getType(), offset, i);
return true;
15 years, 3 months
JBoss Tools SVN: r14253 - trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-03-18 05:59:04 -0400 (Wed, 18 Mar 2009)
New Revision: 14253
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java
Log:
made code more readable
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java 2009-03-18 06:10:43 UTC (rev 14252)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java 2009-03-18 09:59:04 UTC (rev 14253)
@@ -665,16 +665,16 @@
CollectEntityInfo finder = new CollectEntityInfo();
cu.accept(finder);
EntityInfo result = finder.getEntityInfo();
- Iterator<String> it = null;
+
if (result != null) {
result.adjustParameters();
mapCUs_Info.put(fullyQualifiedName, result);
- it = result.getDependences();
+ Iterator<String> it = result.getDependences();
+ while (it.hasNext()) {
+ String fullyQualifiedNameTmp = it.next();
+ collect(fullyQualifiedNameTmp);
+ }
}
- if (it != null) while (it.hasNext()) {
- String fullyQualifiedNameTmp = it.next();
- collect(fullyQualifiedNameTmp);
- }
}
/**
15 years, 3 months
JBoss Tools SVN: r14252 - in branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui: wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-03-18 02:10:43 -0400 (Wed, 18 Mar 2009)
New Revision: 14252
Modified:
branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
Log:
JBIDE-4034 - wizard warning part 2
Modified: branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
===================================================================
--- branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2009-03-18 06:10:24 UTC (rev 14251)
+++ branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2009-03-18 06:10:43 UTC (rev 14252)
@@ -11,7 +11,7 @@
rwf_BaseName=JBoss _VERSION_ Runtime
rwf_NameInUse=Runtime name already in use
rwf_homeMissingFiles=The home directory does not exist or is missing the run.jar.
-rwf_homeIncorrectVersion=The server's home directory is of the incorrect version.
+rwf_homeIncorrectVersion=This server type expects a version of {0} but the server directory is of version {1}.
rwf_nameTextBlank=The name field must not be blank
rwf_homeDirBlank=The directory field must not be blank
rwf_NoVMSelected=No VM selected
Modified: branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
===================================================================
--- branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2009-03-18 06:10:24 UTC (rev 14251)
+++ branches/jbosstools-3.0.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2009-03-18 06:10:43 UTC (rev 14252)
@@ -481,25 +481,22 @@
}
private String getWarningString() {
- if( !isHomeVersionValid())
- return Messages.rwf_homeIncorrectVersion;
+ if( getHomeVersionWarning() != null )
+ return getHomeVersionWarning();
return null;
}
protected boolean isHomeValid() {
if( homeDir == null || !(new File(homeDir).exists())) return false;
- IRuntime rt = (IRuntime) getTaskModel().getObject(
- TaskModel.TASK_RUNTIME);
- String v = rt.getRuntimeType().getVersion();
return new Path(homeDir).append("bin").append("run.jar").toFile().exists();
}
- protected boolean isHomeVersionValid() {
+ protected String getHomeVersionWarning() {
String version = new ServerBeanLoader().getFullServerVersion(new File(homeDir, JBossServerType.AS.getSystemJarPath()));
IRuntime rt = (IRuntime) getTaskModel().getObject(
TaskModel.TASK_RUNTIME);
String v = rt.getRuntimeType().getVersion();
- return version.startsWith(v);
+ return version.startsWith(v) ? null : NLS.bind(Messages.rwf_homeIncorrectVersion, v, version);
}
private void browseHomeDirClicked() {
15 years, 3 months
JBoss Tools SVN: r14251 - in trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui: wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-03-18 02:10:24 -0400 (Wed, 18 Mar 2009)
New Revision: 14251
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/wizards/JBossRuntimeWizardFragment.java
Log:
JBIDE-4034 - wizard warning part 2
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 2009-03-18 05:45:00 UTC (rev 14250)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2009-03-18 06:10:24 UTC (rev 14251)
@@ -11,7 +11,7 @@
rwf_BaseName=JBoss _VERSION_ Runtime
rwf_NameInUse=Runtime name already in use
rwf_homeMissingFiles=The home directory does not exist or is missing the run.jar.
-rwf_homeIncorrectVersion=The server's home directory is of the incorrect version.
+rwf_homeIncorrectVersion=This server type expects a version of {0} but the server directory is of version {1}.
rwf_nameTextBlank=The name field must not be blank
rwf_homeDirBlank=The directory field must not be blank
rwf_NoVMSelected=No VM selected
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2009-03-18 05:45:00 UTC (rev 14250)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2009-03-18 06:10:24 UTC (rev 14251)
@@ -481,25 +481,22 @@
}
private String getWarningString() {
- if( !isHomeVersionValid())
- return Messages.rwf_homeIncorrectVersion;
+ if( getHomeVersionWarning() != null )
+ return getHomeVersionWarning();
return null;
}
protected boolean isHomeValid() {
if( homeDir == null || !(new File(homeDir).exists())) return false;
- IRuntime rt = (IRuntime) getTaskModel().getObject(
- TaskModel.TASK_RUNTIME);
- String v = rt.getRuntimeType().getVersion();
return new Path(homeDir).append("bin").append("run.jar").toFile().exists();
}
- protected boolean isHomeVersionValid() {
+ protected String getHomeVersionWarning() {
String version = new ServerBeanLoader().getFullServerVersion(new File(homeDir, JBossServerType.AS.getSystemJarPath()));
IRuntime rt = (IRuntime) getTaskModel().getObject(
TaskModel.TASK_RUNTIME);
String v = rt.getRuntimeType().getVersion();
- return version.startsWith(v);
+ return version.startsWith(v) ? null : NLS.bind(Messages.rwf_homeIncorrectVersion, v, version);
}
private void browseHomeDirClicked() {
15 years, 3 months