JBoss Tools SVN: r28976 - in trunk/vpe/plugins: org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2011-02-03 11:03:28 -0500 (Thu, 03 Feb 2011)
New Revision: 28976
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/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
Log:
https://issues.jboss.org/browse/JBIDE-8115 : Support for multiple selection in visual part
- small refactoring has been done
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 2011-02-03 15:46:48 UTC (rev 28975)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2011-02-03 16:03:28 UTC (rev 28976)
@@ -1088,14 +1088,8 @@
}
public void setSelectionRectangle(/* nsIDOMElement */nsIDOMNode visualElement) {
- setSelectionRectangle(visualElement, true);
- }
-
- void setSelectionRectangle(/* nsIDOMElement */nsIDOMNode visualElement,
- boolean scroll) {
int resizerConstrains = getResizerConstrains(visualElement);
- visualEditor.setSelectionRectangle(visualElement, resizerConstrains,
- scroll);
+ visualEditor.setSelectionRectangle(visualElement, resizerConstrains);
}
/**
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2011-02-03 15:46:48 UTC (rev 28975)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2011-02-03 16:03:28 UTC (rev 28976)
@@ -956,8 +956,8 @@
// getContentAreaEventListener().setVisualEditor(null);
}
- public void setSelectionRectangle(/*nsIDOMElement*/nsIDOMNode element, int resizerConstrains, boolean scroll) {
- xulRunnerEditor.setSelectionRectangle(element, resizerConstrains, scroll);
+ public void setSelectionRectangle(/*nsIDOMElement*/nsIDOMNode element, int resizerConstrains) {
+ xulRunnerEditor.setSelectionRectangle(element, resizerConstrains);
}
/**
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 2011-02-03 15:46:48 UTC (rev 28975)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2011-02-03 16:03:28 UTC (rev 28976)
@@ -278,8 +278,7 @@
* @param resizerConstrains
* @param scroll
*/
- public void setSelectionRectangle(nsIDOMNode node, int resizerConstrains,
- boolean scroll) {
+ public void setSelectionRectangle(nsIDOMNode node, int resizerConstrains) {
if (getFlasher() == null) {
return;
}
@@ -289,24 +288,22 @@
if (element != null) {
repaint();
- if (scroll) {
- scrollToElement(element);
- scrollRegtangleFlag = true;
- }
+ scrollToElement(element);
+ scrollRegtangleFlag = true;
- if (checkVisibility(element)) {
- if ((element.getAttribute(VPE_INVISIBLE_ELEMENT) == null)
+ if (isVisible(element)) {
+ if (element.getAttribute(VPE_INVISIBLE_ELEMENT) == null
|| (!element.getAttribute(VPE_INVISIBLE_ELEMENT)
.equals(Boolean.TRUE.toString()))) {
-
getFlasher().setColor(FLASHER_VISUAL_ELEMENT_COLOR);
} else {
getFlasher().setColor(FLASHER_HIDDEN_ELEMENT_COLOR);
}
+
drawElementOutline(element);
} else {
getFlasher().setColor(FLASHER_HIDDEN_ELEMENT_COLOR);
- nsIDOMElement domElement = findVisbleParentElement(element);
+ nsIDOMElement domElement = findVisibleParentElement(element);
if (domElement != null) {
drawElementOutline(domElement);
@@ -371,12 +368,10 @@
* @return {@code false} for hidden elements and {@code true}
* for visible elements
*/
- private boolean checkVisibility(nsIDOMNode node) {
+ private boolean isVisible(nsIDOMNode node) {
nsIDOMElement domElement;
try {
-
domElement = XPCOM.queryInterface(node, nsIDOMElement.class);
-
} catch (XPCOMException exception) {
// if we can cast it's is invisible elenebt
return false;
@@ -396,27 +391,25 @@
*
* @return nearest visible node or null if can't find
*/
- private nsIDOMElement findVisbleParentElement(nsIDOMElement element) {
+ private nsIDOMElement findVisibleParentElement(nsIDOMElement element) {
nsIDOMElement parentElement;
try {
-
parentElement = XPCOM.queryInterface(element.getParentNode(), nsIDOMElement.class);
} catch (XPCOMException ex) {
// if parent node isn't nsIDOMElement just return null;
return null;
}
- while (parentElement != null && !checkVisibility(parentElement)) {
- if (checkVisibility(parentElement)) {
-
+
+ while (parentElement != null && !isVisible(parentElement)) {
+ if (isVisible(parentElement)) {
return parentElement;
} else {
-
parentElement = XPCOM.queryInterface(parentElement.getParentNode(), nsIDOMElement.class);
-
}
}
+
return parentElement;
}
@@ -455,54 +448,32 @@
}
public void showSelectionRectangle() {
-
- // (queryInterface(getWebBrowser(), nsIBaseWindow.class)).repaint(false);
-
- if (getLastSelectedElement() != null) {
+ nsIDOMElement element = getLastSelectedElement();
+ if (element != null) {
if (scrollRegtangleFlag) {
+ scrollToElement(element);
scrollRegtangleFlag = false;
-
- scrollToElement(getLastSelectedElement());
}
- // checks visibility of element
- if (checkVisibility(getLastSelectedElement())) {
- if ((getLastSelectedElement().getAttribute(
- VPE_INVISIBLE_ELEMENT) == null)
- || (!getLastSelectedElement().getAttribute(
- VPE_INVISIBLE_ELEMENT).equals(
- Boolean.TRUE.toString()))) {
-
+ if (isVisible(element)) {
+ if (element.getAttribute(VPE_INVISIBLE_ELEMENT) == null
+ || (!element.getAttribute(VPE_INVISIBLE_ELEMENT)
+ .equals(Boolean.TRUE.toString()))) {
getFlasher().setColor(FLASHER_VISUAL_ELEMENT_COLOR);
} else {
-
getFlasher().setColor(FLASHER_HIDDEN_ELEMENT_COLOR);
}
-
- drawElementOutline(getLastSelectedElement());
+
+ drawElementOutline(element);
} else {
-
getFlasher().setColor(FLASHER_HIDDEN_ELEMENT_COLOR);
- nsIDOMElement domElement = findVisbleParentElement(getLastSelectedElement());
+ nsIDOMElement domElement = findVisibleParentElement(element);
if (domElement != null) {
drawElementOutline(domElement);
}
}
}
- // else
- // if(getIFlasher()!=null&&Platform.OS_MACOSX.equals(Platform.getOS())){
- // //Max Areshkau (bug on Mac OS X, when we switch to preview from other
- // view, selection rectangle doesn't disappear
- // //TODO Max Areshkau (may be exist passability not draw selection on
- // resize event when we switches to other view)
- // try {
- // (queryInterface(getWebBrowser(), nsIBaseWindow.class)).repaint(true);
- // } catch(XPCOMException ex) {
- // //just ignore its
- // BrowserPlugin.getDefault().logInfo("repaint failed", ex); //$NON-NLS-1$
- // }
- // }
}
/**
13 years, 11 months
JBoss Tools SVN: r28975 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2011-02-03 10:46:48 -0500 (Thu, 03 Feb 2011)
New Revision: 28975
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMap.java
Log:
https://issues.jboss.org/browse/JBIDE-7003, initialization error fixed
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMap.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMap.java 2011-02-03 14:22:09 UTC (rev 28974)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMap.java 2011-02-03 15:46:48 UTC (rev 28975)
@@ -77,11 +77,10 @@
private IProject project;
public void init(IEditorInput input){
- IProject fileProject=null;
if (input instanceof IFileEditorInput) {
- fileProject=((IFileEditorInput)input).getFile().getProject();
+ project=((IFileEditorInput)input).getFile().getProject();
}
- init(fileProject);
+ init(project);
}
public void init(IProject project){
13 years, 11 months
JBoss Tools SVN: r28974 - in trunk: vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2011-02-03 09:22:09 -0500 (Thu, 03 Feb 2011)
New Revision: 28974
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/formattingbar/
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/formattingbar/FormattingBarTest.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/dialog/tabs/TabQuickEditControl.java
Log:
https://issues.jboss.org/browse/JBIDE-8220 , SWTBotTest was added, in CSSStyleDialg ":" was added on the quick edit tab.
Modified: trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/dialog/tabs/TabQuickEditControl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/dialog/tabs/TabQuickEditControl.java 2011-02-03 13:39:11 UTC (rev 28973)
+++ trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/dialog/tabs/TabQuickEditControl.java 2011-02-03 14:22:09 UTC (rev 28974)
@@ -20,6 +20,7 @@
import org.eclipse.swt.widgets.Label;
import org.jboss.tools.jst.css.dialog.common.StyleAttributes;
import org.jboss.tools.jst.jsp.messages.JstUIMessages;
+import org.jboss.tools.jst.jsp.util.Constants;
/**
* Class for creating control in Quick edit tab
@@ -63,7 +64,7 @@
String value = getStyleAttributes().get(key);
if (value != null && value.length() > 0) {
- addLabel(this, key);
+ addLabel(this, key + Constants.COLON);
createControl(this, key);
}
}
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/formattingbar/FormattingBarTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/formattingbar/FormattingBarTest.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/formattingbar/FormattingBarTest.java 2011-02-03 14:22:09 UTC (rev 28974)
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.bot.test.editor.formattingbar;
+
+import org.jboss.tools.jst.jsp.messages.JstUIMessages;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotEditorExt;
+import org.jboss.tools.ui.bot.test.WidgetVariables;
+import org.jboss.tools.vpe.messages.VpeUIMessages;
+import org.jboss.tools.vpe.ui.bot.test.editor.VPEEditorTestCase;
+
+/**
+ * Class for testing VPE Formatting Bar
+ * @author dmaliarevich
+ */
+public class FormattingBarTest extends VPEEditorTestCase {
+
+ private static final String DIV_TEXT = "<div> div with text </div>"; //$NON-NLS-1$
+ private static final String STYLE_TEXT = " style = \"color: red; font-size: 14px;\""; //$NON-NLS-1$
+ private static final String STYLE_TEXT2 = " style = \"color: red;font-size: 14px;\""; //$NON-NLS-1$
+ private static final String STYLE_TEXT3 = " style = \"color: red;font-size:20px;\""; //$NON-NLS-1$
+
+ private SWTBotExt botExt = null;
+ private SWTBotEditorExt jspEditor;
+
+ public FormattingBarTest() {
+ super();
+ botExt = new SWTBotExt();
+ }
+
+ public void testEditStyleButton() throws Throwable {
+ /*
+ * Open test page
+ */
+ openPage();
+ jspEditor = botExt.swtBotEditorExtByTitle(TEST_PAGE);
+ /*
+ * Set cursor to some html tag
+ */
+ jspEditor.insertText(7, 6, ""); //$NON-NLS-1$
+ bot.sleep(Timing.time2S());
+ /*
+ * Style formatting should be disabled
+ */
+ assertFalse("Style formatting should be disabled", bot //$NON-NLS-1$
+ .toolbarButtonWithTooltip(VpeUIMessages.EDIT_STYLE_ATTRIBUTE)
+ .isEnabled());
+ /*
+ * Add some html text
+ */
+ jspEditor.insertText(10, 0, DIV_TEXT);
+ /*
+ * Put the cursor
+ */
+ jspEditor.insertText(10, 2, ""); //$NON-NLS-1$
+ bot.sleep(Timing.time2S());
+ /*
+ * Check the button
+ */
+ assertTrue("Style formatting should be enabled", bot //$NON-NLS-1$
+ .toolbarButtonWithTooltip(VpeUIMessages.EDIT_STYLE_ATTRIBUTE)
+ .isEnabled());
+ /*
+ * Open the dialog
+ */
+ bot.toolbarButtonWithTooltip(VpeUIMessages.EDIT_STYLE_ATTRIBUTE).click();
+ bot.shell(JstUIMessages.CSS_STYLE_EDITOR_TITLE).setFocus();
+ bot.shell(JstUIMessages.CSS_STYLE_EDITOR_TITLE).activate();
+ /*
+ * Press OK with no changes
+ */
+ assertTrue("(OK) button should be enabled.", //$NON-NLS-1$
+ bot.button(WidgetVariables.OK_BUTTON).isEnabled());
+ bot.button(WidgetVariables.OK_BUTTON).click();
+ /*
+ * Check base style values
+ */
+ jspEditor.insertText(10, 4, STYLE_TEXT);
+ jspEditor.insertText(10, 2, ""); //$NON-NLS-1$
+ bot.sleep(Timing.time2S());
+ /*
+ * Check the button
+ */
+ assertTrue("Style formatting should be enabled", bot //$NON-NLS-1$
+ .toolbarButtonWithTooltip(VpeUIMessages.EDIT_STYLE_ATTRIBUTE)
+ .isEnabled());
+ /*
+ * Open the dialog
+ */
+ bot.toolbarButtonWithTooltip(VpeUIMessages.EDIT_STYLE_ATTRIBUTE).click();
+ bot.shell(JstUIMessages.CSS_STYLE_EDITOR_TITLE).setFocus();
+ bot.shell(JstUIMessages.CSS_STYLE_EDITOR_TITLE).activate();
+ /*
+ * Press OK with no changes
+ */
+ assertTrue("(OK) button should be enabled.", //$NON-NLS-1$
+ bot.button(WidgetVariables.OK_BUTTON).isEnabled());
+ bot.button(WidgetVariables.OK_BUTTON).click();
+ /*
+ * Check the updated style text
+ */
+ jspEditor.selectRange(10, 4, 38);
+ assertEquals("Style string should be updated", STYLE_TEXT2, jspEditor.getSelection()); //$NON-NLS-1$
+ /*
+ * Check the button
+ */
+ assertTrue("Style formatting should be enabled", bot //$NON-NLS-1$
+ .toolbarButtonWithTooltip(VpeUIMessages.EDIT_STYLE_ATTRIBUTE)
+ .isEnabled());
+ /*
+ * Open the dialog
+ */
+ bot.toolbarButtonWithTooltip(VpeUIMessages.EDIT_STYLE_ATTRIBUTE).click();
+ bot.shell(JstUIMessages.CSS_STYLE_EDITOR_TITLE).setFocus();
+ bot.shell(JstUIMessages.CSS_STYLE_EDITOR_TITLE).activate();
+ bot.comboBoxWithLabel("font-size:").setText("20"); //$NON-NLS-1$ //$NON-NLS-2$
+ /*
+ * Press OK with no changes
+ */
+ assertTrue("(OK) button should be enabled.", //$NON-NLS-1$
+ bot.button(WidgetVariables.OK_BUTTON).isEnabled());
+ bot.button(WidgetVariables.OK_BUTTON).click();
+ /*
+ * Check the updated style text
+ */
+ jspEditor.selectRange(10, 4, 37);
+ assertEquals("Style string should be updated", STYLE_TEXT3, jspEditor.getSelection()); //$NON-NLS-1$
+ /*
+ * Check the button
+ */
+ assertTrue("Style formatting should be enabled", bot //$NON-NLS-1$
+ .toolbarButtonWithTooltip(VpeUIMessages.EDIT_STYLE_ATTRIBUTE)
+ .isEnabled());
+ /*
+ * Open the dialog
+ */
+ bot.toolbarButtonWithTooltip(VpeUIMessages.EDIT_STYLE_ATTRIBUTE).click();
+ bot.shell(JstUIMessages.CSS_STYLE_EDITOR_TITLE).setFocus();
+ bot.shell(JstUIMessages.CSS_STYLE_EDITOR_TITLE).activate();
+ bot.comboBoxWithLabel("font-size:").setText("8"); //$NON-NLS-1$ //$NON-NLS-2$
+ /*
+ * Press OK with no changes
+ */
+ assertTrue("(Cancel) button should be enabled.", //$NON-NLS-1$
+ bot.button(WidgetVariables.CANCEL_BUTTON).isEnabled());
+ bot.button(WidgetVariables.CANCEL_BUTTON).click();
+ jspEditor.selectRange(10, 4, 37);
+ assertEquals("Style string should be updated", STYLE_TEXT3, jspEditor.getSelection()); //$NON-NLS-1$
+ }
+
+}
13 years, 11 months
JBoss Tools SVN: r28973 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/internal/deltacloud/ui/wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-02-03 08:39:11 -0500 (Thu, 03 Feb 2011)
New Revision: 28973
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
Log:
[JBIDE-8319] added columns imageId, ownerId, key, realm and profile to instance view. Made that labels in filter dialog match the column names.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-02-03 13:37:57 UTC (rev 28972)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-02-03 13:39:11 UTC (rev 28973)
@@ -1,8 +1,9 @@
2011-02-03 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
* src/org/jboss/tools/deltacloud/ui/views/DeltaCloudInstanceColumns.java (DeltaCloudInstanceColumns):
- [JBIDE-8319] added columns imageId, ownerId, key, realm and profile to instance view
* src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties:
+ [JBIDE-8319] added columns imageId, ownerId, key, realm and profile to instance view.
+ Made that labels in filter dialog match the column names.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilterPage.java:
[JBIDE-8187] added capability to filter for instance alias
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2011-02-03 13:37:57 UTC (rev 28972)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2011-02-03 13:39:11 UTC (rev 28973)
@@ -32,9 +32,9 @@
TestButton.label=Test
UnknownType.label=Unknown
IllegalCloudUrl.msg=Invalid url or non-deltacloud url.
-Id.label=ID:
-ImageId.label=Image ID:
-OwnerId.label=Owner ID:
+Id.label=Id:
+ImageId.label=Image Id:
+OwnerId.label=Owner Id:
Image.label=Image:
Arch.label=Architecture:
Desc.label=Description:
13 years, 11 months
JBoss Tools SVN: r28972 - in trunk: vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2011-02-03 08:37:57 -0500 (Thu, 03 Feb 2011)
New Revision: 28972
Added:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMapUtil.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMap.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/IELService.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/TextUtil.java
Log:
https://issues.jboss.org/browse/JBIDE-7003
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMap.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMap.java 2011-02-03 13:34:40 UTC (rev 28971)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMap.java 2011-02-03 13:37:57 UTC (rev 28972)
@@ -157,9 +157,10 @@
if(project!=null) {
if (project.exists() && project.isOpen()) {
for (int i = 0; i < JSF_PROJECT_NATURES.length; i++) {
- if (project.hasNature(JSF_PROJECT_NATURES[i]))
+ if (project.hasNature(JSF_PROJECT_NATURES[i])){
hasJsfProjectNatureType = true;
break;
+ }
}
}
}
@@ -664,7 +665,4 @@
return bundles;
}
-// private IEditorInput getEditorInput() {
-// return editorInput;
-// }
}
Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMapUtil.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMapUtil.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMapUtil.java 2011-02-03 13:37:57 UTC (rev 28972)
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.jsp.bundle;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+/**
+ * Contains Uril functions
+ *
+ * @author mareshkau
+ *
+ */
+public class BundleMapUtil {
+ /**
+ * Checks if node contains text information from resource bundle
+ * @param pageContext
+ * @param sourceNode
+ * @return
+ */
+ public static boolean isInResourcesBundle(BundleMap bundleMap, Node sourceNode) {
+ boolean rst = findInResourcesBundle(bundleMap, sourceNode);
+ return rst;
+ }
+
+
+ /**
+ * @param pageContext
+ * @param sourceNode
+ * @return
+ */
+ private static boolean findInResourcesBundle(BundleMap bundleMap, Node sourceNode) {
+ boolean rst = false;
+
+ if (bundleMap != null) {
+ String textValue = null;
+
+ if (sourceNode.getNodeType() == Node.TEXT_NODE) {
+ textValue = sourceNode.getNodeValue();
+
+ if ((textValue != null) && isContainsEl(textValue)) {
+ final String newValue = bundleMap.getBundleValue(textValue);
+
+ if (!textValue.equals(newValue)) {
+ rst = true;
+ }
+ }
+ }
+
+ if (!rst) {
+ final NamedNodeMap nodeMap = sourceNode.getAttributes();
+
+ if (nodeMap != null && nodeMap.getLength() > 0) {
+ for (int i = 0; i < nodeMap.getLength(); i++) {
+ final Attr attr = (Attr) nodeMap.item(i);
+ final String value = attr.getValue();
+
+ if (value != null && isContainsEl(value)) {
+ final String value2 = bundleMap.getBundleValue(value);
+
+ if (!value2.equals(value)) {
+ rst = true;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ return rst;
+ }
+
+ /**
+ * @param value
+ * @return
+ */
+ public static boolean isContainsEl(final String value) {
+ return (value.contains("#{") || value.contains("${")); //$NON-NLS-1$//$NON-NLS-2$
+ }
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java 2011-02-03 13:34:40 UTC (rev 28971)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java 2011-02-03 13:37:57 UTC (rev 28972)
@@ -23,6 +23,7 @@
import org.jboss.tools.common.el.core.GlobalELReferenceList;
import org.jboss.tools.common.resref.core.ResourceReference;
import org.jboss.tools.jst.jsp.bundle.BundleMap;
+import org.jboss.tools.jst.jsp.bundle.BundleMapUtil;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.w3c.dom.Attr;
import org.w3c.dom.NamedNodeMap;
@@ -184,7 +185,7 @@
final IFile file = (IFile) pageContext.getVisualBuilder().getCurrentIncludeInfo().getStorage();
if (((this.isAvailable(file) && this.isAvailableForNode(sourceNode, file)))
- || isInResourcesBundle(pageContext, sourceNode)){
+ || BundleMapUtil.isInResourcesBundle(pageContext.getBundle(), sourceNode)){
rst = true;
}else if(Jsf2ResourceUtil.isContainJSFContextPath(sourceNode)){
rst = true;
@@ -230,68 +231,8 @@
}
return false;
}
- /**
- *
- * @param pageContext
- * @param sourceNode
- * @return
- */
- public boolean isInResourcesBundle(VpePageContext pageContext, Node sourceNode) {
- boolean rst = findInResourcesBundle(pageContext, sourceNode);
- return rst;
- }
-
/**
- * @param pageContext
- * @param sourceNode
- * @return
- */
- private boolean findInResourcesBundle(VpePageContext pageContext, Node sourceNode) {
- boolean rst = false;
-
- BundleMap bundleMap = pageContext.getBundle();
- if (bundleMap != null) {
- String textValue = null;
-
- if (sourceNode.getNodeType() == Node.TEXT_NODE) {
- textValue = sourceNode.getNodeValue();
-
- if ((textValue != null) && TextUtil.isContainsEl(textValue)) {
- final String newValue = bundleMap.getBundleValue(textValue);
-
- if (!textValue.equals(newValue)) {
- rst = true;
- }
- }
- }
-
- if (!rst) {
- final NamedNodeMap nodeMap = sourceNode.getAttributes();
-
- if (nodeMap != null && nodeMap.getLength() > 0) {
- for (int i = 0; i < nodeMap.getLength(); i++) {
- final Attr attr = (Attr) nodeMap.item(i);
- final String value = attr.getValue();
-
- if (value != null && TextUtil.isContainsEl(value)) {
- final String value2 = bundleMap.getBundleValue(value);
-
- if (!value2.equals(value)) {
- rst = true;
- break;
- }
- }
- }
- }
- }
- }
- return rst;
- }
-
-
-
- /**
* Checks if is available for node.
*
* @param resourceFile the resource file
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/IELService.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/IELService.java 2011-02-03 13:34:40 UTC (rev 28971)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/IELService.java 2011-02-03 13:37:57 UTC (rev 28972)
@@ -13,6 +13,7 @@
import org.eclipse.core.resources.IFile;
+import org.jboss.tools.jst.jsp.bundle.BundleMap;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.w3c.dom.Node;
@@ -68,15 +69,4 @@
*/
public boolean isELNode(VpePageContext pageContext, Node sourceNode);
-
- /**
- * Checks if is in resources bundle.
- *
- * @param sourceNode the source node
- * @param pageContext the page context
- *
- * @return true, if is in resources bundle
- */
- boolean isInResourcesBundle(VpePageContext pageContext, Node sourceNode);
-
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/TextUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/TextUtil.java 2011-02-03 13:34:40 UTC (rev 28971)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/TextUtil.java 2011-02-03 13:37:57 UTC (rev 28972)
@@ -457,13 +457,4 @@
}
return -1;
}
-
- /**
- * @param value
- * @return
- */
- public static boolean isContainsEl(final String value) {
- return (value.contains("#{") || value.contains("${")); //$NON-NLS-1$//$NON-NLS-2$
- }
-
}
13 years, 11 months
JBoss Tools SVN: r28971 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/deltacloud/ui/views and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-02-03 08:34:40 -0500 (Thu, 03 Feb 2011)
New Revision: 28971
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/Columns.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudImageColumns.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudInstanceColumns.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java
Log:
[JBIDE-8319] added columns imageId, ownerId, key, realm and profile to instance view
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-02-03 13:06:52 UTC (rev 28970)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-02-03 13:34:40 UTC (rev 28971)
@@ -1,5 +1,7 @@
2011-02-03 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+ * src/org/jboss/tools/deltacloud/ui/views/DeltaCloudInstanceColumns.java (DeltaCloudInstanceColumns):
+ [JBIDE-8319] added columns imageId, ownerId, key, realm and profile to instance view
* src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties:
* src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilterPage.java:
[JBIDE-8187] added capability to filter for instance alias
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties 2011-02-03 13:06:52 UTC (rev 28970)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties 2011-02-03 13:34:40 UTC (rev 28971)
@@ -75,10 +75,15 @@
ConfirmCloudDelete.msg=Please choose the clouds that shall be disconnected by checking them:
CreateInstance.label=Launch Instance
-NAME=Name
-ALIAS=Alias
-ID=ID
-HOSTNAME=Public Hostname
-STATUS=State
-ARCH=Architecture
-DESC=Description
\ No newline at end of file
+DeltaCloudElementColumn.name.label=Name
+DeltaCloudElementColumn.alias.label=Alias
+DeltaCloudElementColumn.id.label=Id
+DeltaCloudElementColumn.imageId.label=Image Id
+DeltaCloudElementColumn.ownerId.label=Owner Id
+DeltaCloudElementColumn.keyId.label=Key Id
+DeltaCloudElementColumn.realm.label=Realm
+DeltaCloudElementColumn.profile.label=Profile
+DeltaCloudElementColumn.state.label=State
+DeltaCloudElementColumn.hostname.label=Public Hostname
+DeltaCloudElementColumn.architecture.label=Architecture
+DeltaCloudElementColumn.description.label=Description
\ No newline at end of file
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/Columns.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/Columns.java 2011-02-03 13:06:52 UTC (rev 28970)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/Columns.java 2011-02-03 13:34:40 UTC (rev 28971)
@@ -24,8 +24,8 @@
private String name;
private int weight;
- public Column(String name, int weight) {
- this.name = name;
+ public Column(String nameKey, int weight) {
+ this.name = CVMessages.getString(nameKey);
this.weight = weight;
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudImageColumns.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudImageColumns.java 2011-02-03 13:06:52 UTC (rev 28970)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudImageColumns.java 2011-02-03 13:34:40 UTC (rev 28971)
@@ -20,28 +20,28 @@
@SuppressWarnings("unchecked")
public DeltaCloudImageColumns() {
super(
- new Column<DeltaCloudImage>("NAME", 20) {
+ new Column<DeltaCloudImage>("DeltaCloudElementColumn.name.label", 20) {
@Override
public String getColumnText(DeltaCloudImage image) {
return image.getName();
}
},
- new Column<DeltaCloudImage>("ID", 20) {
+ new Column<DeltaCloudImage>("DeltaCloudElementColumn.id.label", 20) {
@Override
public String getColumnText(DeltaCloudImage image) {
return image.getId();
}
},
- new Column<DeltaCloudImage>("ARCH", 20) {
+ new Column<DeltaCloudImage>("DeltaCloudElementColumn.architecture.label", 20) {
@Override
public String getColumnText(DeltaCloudImage image) {
return image.getArchitecture();
}
},
- new Column<DeltaCloudImage>("DESC", 40) {
+ new Column<DeltaCloudImage>("DeltaCloudElementColumn.description.label", 40) {
@Override
public String getColumnText(DeltaCloudImage image) {
return image.getDescription();
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudInstanceColumns.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudInstanceColumns.java 2011-02-03 13:06:52 UTC (rev 28970)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudInstanceColumns.java 2011-02-03 13:34:40 UTC (rev 28971)
@@ -25,30 +25,65 @@
@SuppressWarnings("unchecked")
public DeltaCloudInstanceColumns() {
super(
- new Column<DeltaCloudInstance>("NAME", 20) {
+ new Column<DeltaCloudInstance>("DeltaCloudElementColumn.name.label", 20) {
@Override
public String getColumnText(DeltaCloudInstance image) {
return image.getName();
}
},
- new Column<DeltaCloudInstance>("ALIAS", 20) {
+ new Column<DeltaCloudInstance>("DeltaCloudElementColumn.alias.label", 20) {
@Override
public String getColumnText(DeltaCloudInstance image) {
return image.getAlias();
}
},
- new Column<DeltaCloudInstance>("ID", 20) {
+ new Column<DeltaCloudInstance>("DeltaCloudElementColumn.id.label", 20) {
@Override
public String getColumnText(DeltaCloudInstance image) {
return image.getId();
}
},
- new Column<DeltaCloudInstance>("STATUS", 20) {
+ new Column<DeltaCloudInstance>("DeltaCloudElementColumn.imageId.label", 20) {
@Override
+ public String getColumnText(DeltaCloudInstance image) {
+ return image.getImageId();
+ }
+ },
+ new Column<DeltaCloudInstance>("DeltaCloudElementColumn.ownerId.label", 20) {
+
+ @Override
+ public String getColumnText(DeltaCloudInstance image) {
+ return image.getOwnerId();
+ }
+ },
+ new Column<DeltaCloudInstance>("DeltaCloudElementColumn.keyId.label", 20) {
+
+ @Override
+ public String getColumnText(DeltaCloudInstance image) {
+ return image.getKeyId();
+ }
+ },
+ new Column<DeltaCloudInstance>("DeltaCloudElementColumn.realm.label", 20) {
+
+ @Override
+ public String getColumnText(DeltaCloudInstance image) {
+ return image.getRealmId();
+ }
+ },
+ new Column<DeltaCloudInstance>("DeltaCloudElementColumn.profile.label", 20) {
+
+ @Override
+ public String getColumnText(DeltaCloudInstance image) {
+ return image.getProfileId();
+ }
+ },
+ new Column<DeltaCloudInstance>("DeltaCloudElementColumn.state.label", 20) {
+
+ @Override
public Image getColumnImage(DeltaCloudInstance instance) {
State state = instance.getState();
if (DeltaCloudInstance.State.STOPPED.equals(state)) {
@@ -68,7 +103,8 @@
return image.getState().toString();
}
},
- new Column<DeltaCloudInstance>("HOSTNAME", 40) {
+
+ new Column<DeltaCloudInstance>("DeltaCloudElementColumn.hostname.label", 40) {
@Override
public String getColumnText(DeltaCloudInstance image) {
return image.getHostName();
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java 2011-02-03 13:06:52 UTC (rev 28970)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java 2011-02-03 13:34:40 UTC (rev 28971)
@@ -316,7 +316,7 @@
if (i == 0) {
table.setSortColumn(tc);
}
- tc.setText(CVMessages.getString(c.getName()));
+ tc.setText(c.getName());
tableLayout.setColumnData(tc, new ColumnWeightData(c.getWeight(), true));
tc.addSelectionListener(new ColumnListener(i));
}
13 years, 11 months
JBoss Tools SVN: r28970 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-02-03 08:06:52 -0500 (Thu, 03 Feb 2011)
New Revision: 28970
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractCloudElementFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllMatcher.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IFieldMatcher.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/StringMatcher.java
Log:
[JBIDE-8187][JBIDE-8320]
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractCloudElementFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractCloudElementFilter.java 2011-02-03 13:06:43 UTC (rev 28969)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractCloudElementFilter.java 2011-02-03 13:06:52 UTC (rev 28970)
@@ -44,6 +44,9 @@
}
protected Iterator<String> setRules(String rules) {
+ if (rules == null) {
+ return emptyRulesIterator();
+ }
Iterator<String> rulesIterator = Arrays.asList(rules.split(EXPRESSION_DELIMITER)).iterator();
setRules(createRule(rulesIterator), createRule(rulesIterator));
return rulesIterator;
@@ -94,8 +97,8 @@
@Override
public String toString() {
- return nameRule + ";" //$NON-NLS-1$
- + idRule + ";"; //$NON-NLS-1$
+ return nameRule + EXPRESSION_DELIMITER
+ + idRule + EXPRESSION_DELIMITER;
}
@Override
@@ -107,4 +110,14 @@
public IFieldMatcher getIdRule() {
return idRule;
}
+
+ protected Iterator<String> emptyRulesIterator() {
+ return new ArrayList<String>().iterator();
+ }
+
+ public boolean isFiltering() {
+ return idRule.isMatchesAll()
+ && nameRule.isMatchesAll();
+ }
+
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllMatcher.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllMatcher.java 2011-02-03 13:06:43 UTC (rev 28969)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllMatcher.java 2011-02-03 13:06:52 UTC (rev 28970)
@@ -1,5 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.deltacloud.core;
+/**
+ * @author Jeff Johnston
+ * @author André Dietisheim
+ */
public class AllMatcher implements IFieldMatcher {
@Override
@@ -9,7 +23,10 @@
@Override
public String toString() {
- return "*"; //$NON-NLS-1$
+ return ICloudElementFilter.ALL_MATCHER_EXPRESSION;
}
+ public boolean isMatchesAll() {
+ return true;
+ }
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2011-02-03 13:06:43 UTC (rev 28969)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2011-02-03 13:06:52 UTC (rev 28970)
@@ -69,8 +69,7 @@
public DeltaCloud(String name, String url, String username, String password, DeltaCloudDriver driver)
throws DeltaCloudException {
- this(name, url, username, password, driver, IImageFilter.ALL_STRING, IInstanceFilter.ALL_STRING,
- new ArrayList<IInstanceAliasMapping>());
+ this(name, url, username, password, driver, null, null, new ArrayList<IInstanceAliasMapping>());
}
public DeltaCloud(String name, String url, String username, DeltaCloudDriver driver, String imageFilterRules,
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java 2011-02-03 13:06:43 UTC (rev 28969)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java 2011-02-03 13:06:52 UTC (rev 28970)
@@ -105,7 +105,7 @@
DeltaCloudXMLBuilder.ENCODING); // $NON-NLS-1$
DeltaCloudDriver driver = DeltaCloudDriver.checkedValueOf(attrs.getNamedItem(DeltaCloudXMLBuilder.ATTR_TYPE).getNodeValue()); // $NON-NLS-1$
String imageFilterRules = getImageFilterRules(attrs.getNamedItem("imagefilter")); // $NON-NLS-1$
- String instanceFilterRules = getInstanceFilterRules(attrs.getNamedItem("instancefilter")); // $NON-NLS-1$
+ String instanceFilterRules = getNodeValue(attrs.getNamedItem("instancefilter")); // $NON-NLS-1$
String lastKeyName = getNodeValue(attrs.getNamedItem(DeltaCloudXMLBuilder.ATTR_LASTKEYNAME)); // $NON-NLS-1$
String lastImageId = getNodeValue(attrs.getNamedItem(DeltaCloudXMLBuilder.ATTR_LASTIMAGE)); // $NON-NLS-1$
Collection<IInstanceAliasMapping> aliasMappings = getInstanceMappings(n);
@@ -162,16 +162,8 @@
return null;
}
- private String getInstanceFilterRules(Node instanceFilterNode) {
- String instanceFilterRules = IInstanceFilter.ALL_STRING;
- if (instanceFilterNode != null) {
- instanceFilterRules = instanceFilterNode.getNodeValue();
- }
- return instanceFilterRules;
- }
-
private String getImageFilterRules(Node imageFilterNode) {
- String imageFilterRules = IImageFilter.ALL_STRING;
+ String imageFilterRules = null;
if (imageFilterNode != null) {
imageFilterRules = imageFilterNode.getNodeValue();
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java 2011-02-03 13:06:43 UTC (rev 28969)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java 2011-02-03 13:06:52 UTC (rev 28970)
@@ -29,13 +29,6 @@
public static final String ALL_MATCHER_EXPRESSION = "*"; //$NON-NLS-1$
- public static final String ALL_STRING =
- ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // alias
- + ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // name
- + ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // id
- + ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // arch
- + ALL_MATCHER_EXPRESSION; // desc
-
public Collection<CLOUDELEMENT> filter(CLOUDELEMENT[] cloudElements) throws DeltaCloudException;
public IFieldMatcher getNameRule();
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IFieldMatcher.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IFieldMatcher.java 2011-02-03 13:06:43 UTC (rev 28969)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IFieldMatcher.java 2011-02-03 13:06:52 UTC (rev 28970)
@@ -16,5 +16,5 @@
public interface IFieldMatcher {
public boolean matches(String input);
-
+ public boolean isMatchesAll();
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java 2011-02-03 13:06:43 UTC (rev 28969)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java 2011-02-03 13:06:52 UTC (rev 28970)
@@ -22,4 +22,5 @@
public IFieldMatcher getKeyNameRule();
public IFieldMatcher getRealmRule();
public IFieldMatcher getProfileRule();
+ public boolean isFiltering();
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java 2011-02-03 13:06:43 UTC (rev 28969)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java 2011-02-03 13:06:52 UTC (rev 28970)
@@ -77,4 +77,10 @@
public IFieldMatcher getDescRule() {
return descRule;
}
+
+ public boolean isFiltering() {
+ return super.isFiltering()
+ && archRule.isMatchesAll()
+ && descRule.isMatchesAll();
+ }
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java 2011-02-03 13:06:43 UTC (rev 28969)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java 2011-02-03 13:06:52 UTC (rev 28970)
@@ -127,4 +127,14 @@
public IFieldMatcher getRealmRule() {
return realmRule;
}
+
+ public boolean isFiltering() {
+ return super.isFiltering()
+ && aliasRule.isMatchesAll()
+ && imageIdRule.isMatchesAll()
+ && keyNameRule.isMatchesAll()
+ && ownerIdRule.isMatchesAll()
+ && profileRule.isMatchesAll()
+ && realmRule.isMatchesAll();
+ }
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/StringMatcher.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/StringMatcher.java 2011-02-03 13:06:43 UTC (rev 28969)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/StringMatcher.java 2011-02-03 13:06:52 UTC (rev 28970)
@@ -59,4 +59,7 @@
return rule;
}
+ public boolean isMatchesAll() {
+ return false;
+ }
}
13 years, 11 months
JBoss Tools SVN: r28969 - trunk/hibernatetools/docs/reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2011-02-03 08:06:43 -0500 (Thu, 03 Feb 2011)
New Revision: 28969
Modified:
trunk/hibernatetools/docs/reference/en-US/plugins.xml
Log:
[hibernatedoc] HB conf file updated, removed confusing part
[hibernatedoc] Code Generation Wizard renamed to Code Generation Launcher
Modified: trunk/hibernatetools/docs/reference/en-US/plugins.xml
===================================================================
--- trunk/hibernatetools/docs/reference/en-US/plugins.xml 2011-02-03 13:02:34 UTC (rev 28968)
+++ trunk/hibernatetools/docs/reference/en-US/plugins.xml 2011-02-03 13:06:43 UTC (rev 28969)
@@ -77,7 +77,7 @@
<para>
To be able to perform reverse engineering, prototype queries, and of course to simply use <property>Hibernate Core</property> a <filename>hibernate.properties</filename> or <filename>hibernate.cfg.xml</filename> file is needed. <property>Hibernate Tools</property> provides a wizard for generating the <filename>hibernate.cfg.xml</filename> file if you do not already have one.
</para>
- <para>Start the wizard by clicking <menuchoice><guimenuitem>New</guimenuitem>
+ <para>Start the wizard by clicking <menuchoice><guimenuitem>File</guimenuitem><guimenuitem>New</guimenuitem>
<guimenuitem>Other</guimenuitem>
</menuchoice> (<keycombo><keycap>Ctrl</keycap>
<keycap>N</keycap>
@@ -85,10 +85,7 @@
<menuchoice><guimenuitem>Hibernate</guimenuitem>
<guimenuitem>Hibernate Configuration File (cfg.xml)</guimenuitem>
- </menuchoice> and click the <guibutton>Next</guibutton> button. For a web Seam project select, in the <property>Web Projects</property> right click on the <filename>WebContent</filename> folder and select <menuchoice><guimenuitem>New</guimenuitem>
- <guimenuitem>File</guimenuitem>
- <guimenuitem>Hibernate Configuration 3.0</guimenuitem>
- </menuchoice>. After selecting the desired location for the <filename>hibernate.cfg.xml</filename> file, you will see the following screen:</para>
+ </menuchoice> and click the <guibutton>Next</guibutton> button.</para>
<figure>
<title>Hibernate Configuration File Wizard</title>
<mediaobject>
@@ -540,7 +537,7 @@
<para>Additional mapping files </para>
</entry>
<entry>
- <para>List of additional mapping files that should be loaded. </para>
+ <para>Count of additional mapping files that should be loaded. </para>
</entry>
<entry>
<para>False</para>
@@ -656,7 +653,7 @@
When you click on the <guimenuitem>Open Hibernate Code Generation Dialog...</guimenuitem> option the standard Eclipse launcher dialog will appear. In this dialog you can create, edit and delete named Hibernate code generation "launchers".
</para>
<figure id="hib_code_gen">
- <title>Getting Hibernate Code Generation Wizard</title>
+ <title>Getting Hibernate Code Generation Launcher</title>
<mediaobject>
<imageobject role="fo">
<imagedata fileref="images/plugins/plugins_6.png" format="PNG"/>
@@ -668,7 +665,7 @@
</figure>
<para/>
<figure>
- <title>Hibernate Code Generation Wizard</title>
+ <title>Hibernate Code Generation Launcher</title>
<mediaobject>
<imageobject role="fo">
<imagedata align="center" scale="80" fileref="images/plugins/plugins_7.png" format="PNG" />
13 years, 11 months
JBoss Tools SVN: r28968 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-02-03 08:02:34 -0500 (Thu, 03 Feb 2011)
New Revision: 28968
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java
Log:
fixed runtime exception (Display#syncExec: no active display found)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java 2011-02-03 12:50:13 UTC (rev 28967)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java 2011-02-03 13:02:34 UTC (rev 28968)
@@ -295,7 +295,7 @@
}
IInstanceFilter filter = currentCloud.getInstanceFilter();
- filterLabel.setVisible(!filter.toString().equals(IInstanceFilter.ALL_STRING));
+ filterLabel.setVisible(!filter.isFiltering());
}
private DeltaCloud getCloud(int cloudIndex, DeltaCloud[] clouds) {
@@ -375,7 +375,7 @@
}
public void cloudsChanged(final int type, final DeltaCloud cloud) {
- UIUtils.getActiveShell().getDisplay().syncExec(new Runnable() {
+ viewer.getControl().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
13 years, 11 months
JBoss Tools SVN: r28967 - in trunk/vpe/plugins: org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2011-02-03 07:50:13 -0500 (Thu, 03 Feb 2011)
New Revision: 28967
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/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/XulRunnerEditor2.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/XulRunnerPreview.java
Log:
https://issues.jboss.org/browse/JBIDE-8115 : Support for multiple selection in visual part
- minor code beautifying
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2011-02-03 12:33:08 UTC (rev 28966)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2011-02-03 12:50:13 UTC (rev 28967)
@@ -1004,10 +1004,10 @@
*/
public void onReloadWindow() {
detachMozillaEventAdapter();
- xulRunnerEditor.removeResizerListener();
+ xulRunnerEditor.removeResizeListener();
contentArea = findContentArea();
attachMozillaEventAdapter();
- xulRunnerEditor.addResizerListener();
+ xulRunnerEditor.addResizeListener();
controller.reinit();
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/XulRunnerEditor2.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/XulRunnerEditor2.java 2011-02-03 12:33:08 UTC (rev 28966)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/XulRunnerEditor2.java 2011-02-03 12:50:13 UTC (rev 28967)
@@ -24,6 +24,7 @@
this.mozillaEditor = mozillaEditor;
}
+ @Override
public void onLoadWindow() {
if (mozillaEditor == null) {
return;
@@ -40,21 +41,25 @@
}
}
+ @Override
public void onElementResize(nsIDOMElement element, int constrains, int top, int left, int width, int height) {
if (mozillaEditor != null && mozillaEditor.getResizeListener() != null) {
mozillaEditor.getResizeListener().elementResized(element, constrains, top, left, width, height);
}
}
+ @Override
public void onShowTooltip(int x, int y, String text) {
if (mozillaEditor != null && mozillaEditor.getTooltipListener() != null) {
mozillaEditor.getTooltipListener().onShowTooltip(x, y, text);
}
}
+ @Override
public void onHideTooltip() {
if (mozillaEditor != null && mozillaEditor.getTooltipListener() != null) {
mozillaEditor.getTooltipListener().onHideTooltip();
}
}
+ @Override
public void onDispose() {
if (mozillaEditor != null) {
mozillaEditor.tearDownEditor();
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/XulRunnerPreview.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/XulRunnerPreview.java 2011-02-03 12:33:08 UTC (rev 28966)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/XulRunnerPreview.java 2011-02-03 12:50:13 UTC (rev 28967)
@@ -23,22 +23,26 @@
this.mozillaPreview = mozillaPreview;
}
+ @Override
public void onLoadWindow() {
super.onLoadWindow();
mozillaPreview.onLoadWindow();
}
+ @Override
public void onShowTooltip(int x, int y, String text) {
if (mozillaPreview != null && mozillaPreview.getTooltipListener() != null) {
mozillaPreview.getTooltipListener().onShowTooltip(x, y, text);
}
}
+ @Override
public void onHideTooltip() {
if (mozillaPreview != null && mozillaPreview.getTooltipListener() != null) {
mozillaPreview.getTooltipListener().onHideTooltip();
}
}
+ @Override
public void onDispose() {
if (mozillaPreview != null) {
mozillaPreview.detachMozillaEventAdapter();
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 2011-02-03 12:33:08 UTC (rev 28966)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2011-02-03 12:50:13 UTC (rev 28967)
@@ -144,9 +144,9 @@
nsITooltipListener.NS_ITOOLTIPLISTENER_IID);
removeProgressListener(XulRunnerEditor.this);
- if (resizeListener != null)
- getIXulRunnerVpeResizer().removeResizeListener(
- resizeListener);
+ if (resizeListener != null) {
+ getIXulRunnerVpeResizer().removeResizeListener(resizeListener);
+ }
xulRunnerVpeResizer.dispose();
xulRunnerVpeResizer = null;
resizeListener = null;
@@ -206,17 +206,17 @@
}
/**
- * Removes resizer listener
+ * Removes resize listener
*/
- public void removeResizerListener() {
+ public void removeResizeListener() {
if (resizeListener != null)
getIXulRunnerVpeResizer().removeResizeListener(resizeListener);
}
/**
- * Add Resizer Listener
+ * Add Resize Listener
*/
- public void addResizerListener() {
+ public void addResizeListener() {
if (getIXulRunnerVpeResizer() != null) {
getIXulRunnerVpeResizer().init(getDOMDocument());
getIXulRunnerVpeResizer().addResizeListener(resizeListener);
@@ -238,7 +238,7 @@
}
public void onLoadWindow() {
- addResizerListener();
+ addResizeListener();
}
public nsIDOMDocument getDOMDocument() {
@@ -252,8 +252,7 @@
* @return
*/
public nsIDOMElement getLastSelectedElement() {
-
- return getElement(lastSelectedNode);
+ return getSelectedElementForNode(lastSelectedNode);
}
public nsIDOMNode getLastSelectedNode() {
@@ -282,72 +281,13 @@
public void setSelectionRectangle(nsIDOMNode node, int resizerConstrains,
boolean scroll) {
if (getFlasher() == null) {
-
return;
}
- nsIDOMElement element = getElement(node);
+ nsIDOMElement element = getSelectedElementForNode(node);
- // See https://jira.jboss.org/jira/browse/JBIDE-5117. We make
- // unnecessary redrawing of previously selected component in VE
- // which happens in drawElementOutline(nsIDOMElement domElement)
- // method and call IFlasher.drawElementOutline(nsIDOMElement domElement)
- // twice for different elements without browser repainting. So, for some
- // conflicts in Mozilla browser border above TR element wasn't
- // repainted.
-
- // if (getLastSelectedElement() != null) {
- //
- // scrollRegtangleFlag = scroll && node != null;
- //
- // try {
- // ((nsIBaseWindow) getWebBrowser().queryInterface(
- // nsIBaseWindow.NS_IBASEWINDOW_IID)).repaint(true);
- // } catch (XPCOMException ex) {
- // // just ignore its
- // BrowserPlugin.getDefault().logInfo("repaint failed", ex); //$NON-NLS-1$
- // }
- // if(checkVisability(getLastSelectedElement())){
- //
- // if((getLastSelectedElement().getAttribute(VPEFLASHERCOLORATTRIBUTE)==null)||
- // (!getLastSelectedElement().getAttribute(VPEFLASHERCOLORATTRIBUTE).equals(flasherHiddentElementColor)))
- // {
- //
- // getIFlasher().setColor(flasherVisialElementColor);
- // } else{
- // getIFlasher().setColor(flasherHiddentElementColor);
- // }
- //
- // drawElementOutline(getLastSelectedElement());
- //
- // }else {
- //
- // getIFlasher().setColor(flasherHiddentElementColor);
- // nsIDOMElement domElement =
- // findVisbleParentElement(getLastSelectedElement());
- //
- // if(domElement!=null) {
- //
- // drawElementOutline(domElement);
- // }
- //
- // }
- // try {
- // ((nsIBaseWindow) getWebBrowser().queryInterface(
- // nsIBaseWindow.NS_IBASEWINDOW_IID)).repaint(true);
- // } catch (XPCOMException ex) {
- // // just ignore its
- // BrowserPlugin.getDefault().logInfo("repaint failed", ex); //$NON-NLS-1$
- // }
-
- // } else
if (element != null) {
- try {
- XPCOM.queryInterface(getWebBrowser(), nsIBaseWindow.class).repaint(true);
- } catch (XPCOMException ex) {
- // just ignore its
- BrowserPlugin.getDefault().logInfo("repaint failed", ex); //$NON-NLS-1$
- }
+ repaint();
if (scroll) {
scrollToElement(element);
@@ -391,6 +331,20 @@
}
/**
+ * Forcible repaints current XULRunner window.
+ *
+ * If an exception occurs during repaint, it will be logged.
+ */
+ private void repaint() {
+ try {
+ XPCOM.queryInterface(getWebBrowser(), nsIBaseWindow.class).repaint(true);
+ } catch (XPCOMException ex) {
+ // just ignore it
+ BrowserPlugin.getDefault().logInfo("repaint failed", ex); //$NON-NLS-1$
+ }
+ }
+
+ /**
* @return the iFlasher
*/
private Flasher getFlasher() {
@@ -510,7 +464,7 @@
scrollToElement(getLastSelectedElement());
}
- // checks visability of element
+ // checks visibility of element
if (checkVisibility(getLastSelectedElement())) {
if ((getLastSelectedElement().getAttribute(
@@ -562,27 +516,19 @@
}
/**
- * get nsIDomElement from nsIDomNode
+ * Returns the element to be selected for the given {@code node}.
*
- * if node is nsIDomElement - return it
- *
- * if node is text node - return it's
- *
- * parent else return null
- *
- * @param node
- * @return
+ * If node is an element, then returns it as is.
+ * If node is a text node, then returns its parent
+ * Else returns null;
*/
- private nsIDOMElement getElement(nsIDOMNode node) {
-
+ private nsIDOMElement getSelectedElementForNode(nsIDOMNode node) {
if (node != null) {
-
if (node.getNodeType() == nsIDOMNode.ELEMENT_NODE) {
return XPCOM.queryInterface(node, nsIDOMElement.class);
} else if (node.getNodeType() == nsIDOMNode.TEXT_NODE) {
return XPCOM.queryInterface(node.getParentNode(), nsIDOMElement.class);
}
-
}
return null;
13 years, 11 months