JBoss Tools SVN: r41629 - in workspace/fred/repositories/snapshot/org/jboss/aerogear/archetypes/jboss-html5-mobile-archetype: 1.0.0.M4-JBT and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-06-01 09:58:37 -0400 (Fri, 01 Jun 2012)
New Revision: 41629
Added:
workspace/fred/repositories/snapshot/org/jboss/aerogear/archetypes/jboss-html5-mobile-archetype/1.0.0.M4-JBT/
workspace/fred/repositories/snapshot/org/jboss/aerogear/archetypes/jboss-html5-mobile-archetype/1.0.0.M4-JBT/_maven.repositories
workspace/fred/repositories/snapshot/org/jboss/aerogear/archetypes/jboss-html5-mobile-archetype/1.0.0.M4-JBT/jboss-html5-mobile-archetype-1.0.0.M4-JBT-sources.jar
workspace/fred/repositories/snapshot/org/jboss/aerogear/archetypes/jboss-html5-mobile-archetype/1.0.0.M4-JBT/jboss-html5-mobile-archetype-1.0.0.M4-JBT.jar
workspace/fred/repositories/snapshot/org/jboss/aerogear/archetypes/jboss-html5-mobile-archetype/1.0.0.M4-JBT/jboss-html5-mobile-archetype-1.0.0.M4-JBT.pom
Log:
Fix aerogear archetype for EAP CR1
Added: workspace/fred/repositories/snapshot/org/jboss/aerogear/archetypes/jboss-html5-mobile-archetype/1.0.0.M4-JBT/_maven.repositories
===================================================================
--- workspace/fred/repositories/snapshot/org/jboss/aerogear/archetypes/jboss-html5-mobile-archetype/1.0.0.M4-JBT/_maven.repositories (rev 0)
+++ workspace/fred/repositories/snapshot/org/jboss/aerogear/archetypes/jboss-html5-mobile-archetype/1.0.0.M4-JBT/_maven.repositories 2012-06-01 13:58:37 UTC (rev 41629)
@@ -0,0 +1,5 @@
+#NOTE: This is an internal implementation file, its format can be changed without prior notice.
+#Fri Jun 01 15:54:16 CEST 2012
+jboss-html5-mobile-archetype-1.0.0.M4-JBT.jar>=
+jboss-html5-mobile-archetype-1.0.0.M4-JBT-sources.jar>=
+jboss-html5-mobile-archetype-1.0.0.M4-JBT.pom>=
Added: workspace/fred/repositories/snapshot/org/jboss/aerogear/archetypes/jboss-html5-mobile-archetype/1.0.0.M4-JBT/jboss-html5-mobile-archetype-1.0.0.M4-JBT-sources.jar
===================================================================
(Binary files differ)
Property changes on: workspace/fred/repositories/snapshot/org/jboss/aerogear/archetypes/jboss-html5-mobile-archetype/1.0.0.M4-JBT/jboss-html5-mobile-archetype-1.0.0.M4-JBT-sources.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/fred/repositories/snapshot/org/jboss/aerogear/archetypes/jboss-html5-mobile-archetype/1.0.0.M4-JBT/jboss-html5-mobile-archetype-1.0.0.M4-JBT.jar
===================================================================
(Binary files differ)
Property changes on: workspace/fred/repositories/snapshot/org/jboss/aerogear/archetypes/jboss-html5-mobile-archetype/1.0.0.M4-JBT/jboss-html5-mobile-archetype-1.0.0.M4-JBT.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/fred/repositories/snapshot/org/jboss/aerogear/archetypes/jboss-html5-mobile-archetype/1.0.0.M4-JBT/jboss-html5-mobile-archetype-1.0.0.M4-JBT.pom
===================================================================
--- workspace/fred/repositories/snapshot/org/jboss/aerogear/archetypes/jboss-html5-mobile-archetype/1.0.0.M4-JBT/jboss-html5-mobile-archetype-1.0.0.M4-JBT.pom (rev 0)
+++ workspace/fred/repositories/snapshot/org/jboss/aerogear/archetypes/jboss-html5-mobile-archetype/1.0.0.M4-JBT/jboss-html5-mobile-archetype-1.0.0.M4-JBT.pom 2012-06-01 13:58:37 UTC (rev 41629)
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-parent</artifactId>
+ <version>6-beta-2</version>
+ </parent>
+
+ <groupId>org.jboss.aerogear.archetypes</groupId>
+ <artifactId>jboss-html5-mobile-archetype</artifactId>
+ <version>1.0.0.M4-JBT</version>
+ <packaging>maven-archetype</packaging>
+
+ <name>Java EE 6 HTML5 Mobile Web Application</name>
+
+ <description>An archetype that generates a Java EE 6 application using HTML5, and JAX-RS to support both desktop and mobile web browsers</description>
+
+ <url>http://jboss.org/jbossas</url>
+
+ <developers>
+ <developer>
+ <name>Steven Boscarine</name>
+ <email>stevenboscarine(a)gmail.com</email>
+ </developer>
+ <developer>
+ <id>fbricon</id>
+ <name>Fred Bricon</name>
+ <email>fbricon(a)gmail.com</email>
+ <organization>Red Hat, Inc.</organization>
+ <organizationUrl>http://redhat.com/jboss</organizationUrl>
+ <url>http://community.jboss.org/people/fbricon</url>
+ <timezone>+1</timezone>
+ </developer>
+ <developer>
+ <name>Dan Allen</name>
+ <email>dan.j.allen(a)gmail.com</email>
+ <organization>JBoss, by Red Hat</organization>
+ <organizationUrl>http://redhat.com/jboss</organizationUrl>
+ <url>http://community.jboss.org/people/dan.j.allen</url>
+ </developer>
+ <developer>
+ <name>Pete Muir</name>
+ <email>pete.muir(a)jboss.org</email>
+ <organization>Red Hat, Inc.</organization>
+ <organizationUrl>http://redhat.com/jboss</organizationUrl>
+ <url>http://in.relation.to/Bloggers/Pete</url>
+ </developer>
+ <developer>
+ <name>Jay Balunas</name>
+ <email>jbalunas(a)jboss.org</email>
+ <organization>Red Hat, Inc.</organization>
+ <organizationUrl>http://redhat.com/jboss</organizationUrl>
+ <url>http://in.relation.to/Bloggers/Jay</url>
+ </developer>
+ </developers>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.1</version>
+ </extension>
+ </extensions>
+
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.1</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+</project>
12 years, 7 months
JBoss Tools SVN: r41628 - 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: dmaliarevich
Date: 2012-06-01 09:49:15 -0400 (Fri, 01 Jun 2012)
New Revision: 41628
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/TextUtil.java
Log:
https://issues.jboss.org/browse/JBIDE-12052 - logic was updated to avoid negative values.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java 2012-06-01 13:28:20 UTC (rev 41627)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java 2012-06-01 13:49:15 UTC (rev 41628)
@@ -18,6 +18,7 @@
import org.eclipse.swt.graphics.Point;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.eclipse.wst.xml.core.internal.document.AttrImpl;
import org.eclipse.wst.xml.core.internal.document.NodeImpl;
import org.eclipse.wst.xml.core.internal.document.TextImpl;
import org.jboss.tools.jst.jsp.selection.SelectionHelper;
@@ -239,16 +240,16 @@
if (nodeMapping instanceof VpeElementMapping) {
VpeElementMapping elementMapping = (VpeElementMapping) nodeMapping;
- nsIDOMNode targetVisualNode = elementMapping.getTemplate()
- .getVisualNodeBySourcePosition(
- elementMapping, range, getDomMapping());
- NodeData nodeData = elementMapping.getTemplate().getNodeData(targetVisualNode,
+ VpeTemplate template = elementMapping.getTemplate();
+ nsIDOMNode targetVisualNode = template.getVisualNodeBySourcePosition(
+ elementMapping, range, getDomMapping());
+ NodeData nodeData = template.getNodeData(targetVisualNode,
elementMapping.getElementData(), getDomMapping());
// we can restore cursor position only if we have nodeData and
// range.y==0
if (nodeData != null) {
// restore cursor position in source document
- restoreVisualCursorPosition(elementMapping.getTemplate(), nodeData, range);
+ restoreVisualCursorPosition(template, nodeData, range);
}
}
}
@@ -256,134 +257,166 @@
/**
* Restores visual cursor position in visual part of editor
*
- * @param template
- * - current template in scope of which we are editing data
- * !IMPORTANT for current implementation in should be a text node
- * @param nodeData
- * -contains mapping before sourceNode(it's can be an attribute)
- * and visual node, attribute
+ * @param template - current template in scope of which we are editing data
+ * !IMPORTANT for current implementation in should be a text node
+ * @param nodeData - contains mapping before sourceNode(it's can be an attribute)
+ * and visual node, attribute
+ * @param selectionRange - a <code>Point</code> with x as the offset
+ * and y as the length of the current selection or <code>null</code>
*/
private void restoreVisualCursorPosition(VpeTemplate template,
NodeData nodeData, Point selectionRange) {
- nsIDOMNode visualNode = nodeData.getVisualNode();
- if ((visualNode != null) && (nodeData.getSourceNode() != null)
- && (visualNode.getNodeType() == nsIDOMNode.TEXT_NODE)) {
-
- Node targetSourceNode = nodeData.getSourceNode();
- int focusOffcetReferenceToSourceNode = selectionRange.x
- - NodesManagingUtil.getStartOffsetNode(targetSourceNode);
- int anchorOffcetReferenceToSourceNode = selectionRange.x + selectionRange.y
- - NodesManagingUtil.getStartOffsetNode(targetSourceNode);
- NodeImpl sourceTextImpl = (NodeImpl) targetSourceNode;
- int visualNodeFocusOffcet = TextUtil.visualPosition(
- sourceTextImpl.getValueSource(),
- focusOffcetReferenceToSourceNode);
- int visualNodeAnchorOffcet = TextUtil.visualPosition(
- sourceTextImpl.getValueSource(),
- anchorOffcetReferenceToSourceNode);
- int length = visualNode.getNodeValue().length();
+ if (nodeData != null) {
+ nsIDOMNode visualNode = nodeData.getVisualNode();
+ Node sourceNode = nodeData.getSourceNode();
- if (visualNodeFocusOffcet > length || visualNodeAnchorOffcet > length) {
- return;
- }
- nsISelection selection = selectionController.getSelection(
- nsISelectionController.SELECTION_NORMAL);
- if ((visualNodeFocusOffcet == visualNodeAnchorOffcet)) {
- /*
- * Nothing is selected.
- */
- selection.collapse(visualNode, visualNodeFocusOffcet);
- } else {
- /*
- * https://issues.jboss.org/browse/JBIDE-11137
- * Detect selection direction
- */
- int selectionStartOffset;
- int selectionEndOffset;
- if (visualNodeFocusOffcet <= visualNodeAnchorOffcet) {
- selectionStartOffset = visualNodeFocusOffcet;
- selectionEndOffset = visualNodeAnchorOffcet;
- } else {
- selectionStartOffset = visualNodeAnchorOffcet;
- selectionEndOffset = visualNodeFocusOffcet;
+ if ((selectionRange != null) && (sourceNode != null) && (visualNode != null)
+ && (visualNode.getNodeType() == nsIDOMNode.TEXT_NODE)) {
+
+ int focusOffcetReferenceToSourceNode = selectionRange.x
+ - NodesManagingUtil.getStartOffsetNode(sourceNode);
+ int anchorOffcetReferenceToSourceNode = selectionRange.x + selectionRange.y
+ - NodesManagingUtil.getStartOffsetNode(sourceNode);
+ NodeImpl sourceTextImpl = (NodeImpl) sourceNode;
+ int visualNodeFocusOffcet = TextUtil.visualPosition(
+ sourceTextImpl.getValueSource(),
+ focusOffcetReferenceToSourceNode);
+ int visualNodeAnchorOffcet = TextUtil.visualPosition(
+ sourceTextImpl.getValueSource(),
+ anchorOffcetReferenceToSourceNode);
+ int length = visualNode.getNodeValue().length();
+
+ if (visualNodeFocusOffcet > length || visualNodeAnchorOffcet > length) {
+ return;
}
- int sourceStartSel = selectionRange.x;
- int sourceSelLength = selectionRange.y;
- int caretOffset = SelectionHelper.getCaretOffset(sourceEditor);
- TextImpl txt = null;
- String wholeText = null;
- int txtStartOffset= -1;
- int txtEndOffset = -1;
- int wsStartLength = 0;
- int wsEndLength = 0;
- int goodX = 0;
- int goodY = 0;
- if (targetSourceNode instanceof TextImpl) {
- txt = (TextImpl) targetSourceNode;
- wholeText = txt.getSource();//WholeText();
- txtStartOffset = txt.getStartOffset();
- txtEndOffset = txt.getEndOffset();
- Matcher matcher = START_WHITESPACE.matcher(wholeText);
- if (matcher.find()) {
- wsStartLength = matcher.group(1).length();
- }
- matcher = END_WHITESPACE.matcher(wholeText);
- if (matcher.find()) {
- wsEndLength = matcher.group(1).length();
- }
- goodX = txtStartOffset + wsStartLength;
- goodY = txtEndOffset - wsEndLength;
- }
- boolean skip = false;
- int allowedLength = 0;
- if ((caretOffset >= txtStartOffset) && (caretOffset <= (txtStartOffset + wsStartLength))) {
- allowedLength = wsStartLength - (caretOffset - txtStartOffset);
- if (sourceSelLength <= allowedLength) {
- skip = true;
- }
- } else if ((caretOffset <= txtEndOffset) && (caretOffset >= (txtEndOffset - wsEndLength))
- && (sourceSelLength <= wsEndLength)) {
- allowedLength = wsStartLength - (txtEndOffset - caretOffset);
- if (sourceSelLength <= allowedLength) {
- skip = true;
- }
- }
- if (skip) {
+
+ nsISelection selection = selectionController.getSelection(
+ nsISelectionController.SELECTION_NORMAL);
+ if ((visualNodeFocusOffcet == visualNodeAnchorOffcet)) {
/*
* Nothing is selected.
*/
- selection.collapse(visualNode, selectionStartOffset);
+ selection.collapse(visualNode, visualNodeFocusOffcet);
} else {
- int newX = selectionRange.x;
- int newY = selectionRange.y;
- if (newX < goodX) {
- newY = newY - (goodX - newX);
- newX = goodX;
+ /*
+ * https://issues.jboss.org/browse/JBIDE-11137
+ * Detect selection direction
+ */
+ int selectionStartOffset;
+ int selectionEndOffset;
+ if (visualNodeFocusOffcet <= visualNodeAnchorOffcet) {
+ selectionStartOffset = visualNodeFocusOffcet;
+ selectionEndOffset = visualNodeAnchorOffcet;
+ } else {
+ selectionStartOffset = visualNodeAnchorOffcet;
+ selectionEndOffset = visualNodeFocusOffcet;
}
- if ((newX + newY) > goodY){
- newY = goodY - newX;
+ int sourceStartSel = selectionRange.x;
+ int sourceSelLength = selectionRange.y;
+ int caretOffset = SelectionHelper.getCaretOffset(sourceEditor);
+ TextImpl txt = null;
+ AttrImpl attr = null;
+ String wholeText = null;
+ boolean sourceIsCorrect = false;
+ int txtStartOffset= -1;
+ int txtEndOffset = -1;
+ int wsStartLength = 0;
+ int wsEndLength = 0;
+ int goodX = 0;
+ int goodY = 0;
+ if (sourceNode instanceof TextImpl) {
+ txt = (TextImpl) sourceNode;
+ wholeText = txt.getSource();
+ txtStartOffset = txt.getStartOffset();
+ txtEndOffset = txt.getEndOffset();
+ sourceIsCorrect = true;
+ } else if (sourceNode instanceof AttrImpl) {
+ attr = (AttrImpl) sourceNode;
+ wholeText = attr.getValueSource();
+ txtStartOffset = attr.getValueRegionStartOffset();
+ txtEndOffset = txtStartOffset + attr.getValueRegionText().length();
+ sourceIsCorrect = true;
}
- Point newSrcRange = new Point(newX, newY);
- int srcStartOffset = newSrcRange.x - NodesManagingUtil.getStartOffsetNode(targetSourceNode);
- int srcEndOffset = newSrcRange.x + newSrcRange.y - NodesManagingUtil.getStartOffsetNode(targetSourceNode);
- int visualStartOffset = TextUtil.visualPosition(sourceTextImpl.getValueSource(), srcStartOffset);
- int visualEndOffset = TextUtil.visualPosition(sourceTextImpl.getValueSource(), srcEndOffset);
- if (visualStartOffset > length || visualEndOffset > length) {
- return;
- }
/*
- * Detect selection direction
+ * Currently only text and attribute nodes are supported.
*/
- boolean toLeft = caretOffset <= newSrcRange.x;
- boolean toRight = caretOffset >= newSrcRange.x + newSrcRange.y;
- int min = Math.min(visualStartOffset, visualEndOffset);
- int max = Math.max(visualStartOffset, visualEndOffset);
- if (toRight) {
- selection.collapse(visualNode, min);
- selection.extend(visualNode, max);
- } else if (toLeft) {
- selection.collapse(visualNode, max);
- selection.extend(visualNode, min);
+ if (sourceIsCorrect) {
+ Matcher matcher = START_WHITESPACE.matcher(wholeText);
+ if (matcher.find()) {
+ wsStartLength = matcher.group(1).length();
+ }
+ matcher = END_WHITESPACE.matcher(wholeText);
+ if (matcher.find()) {
+ wsEndLength = matcher.group(1).length();
+ }
+ /*
+ * Good coordinates -- is coordinates of the text itself
+ * WITHOUT whitespace characters at the beginning
+ * and at the end.
+ */
+ goodX = txtStartOffset + wsStartLength;
+ goodY = txtEndOffset - wsEndLength;
+ boolean skip = false;
+ int allowedLength = 0;
+ if ((caretOffset >= txtStartOffset) && (caretOffset <= (txtStartOffset + wsStartLength))) {
+ allowedLength = wsStartLength - (caretOffset - txtStartOffset);
+ if (sourceSelLength <= allowedLength) {
+ skip = true;
+ }
+ } else if ((caretOffset <= txtEndOffset) && (caretOffset >= (txtEndOffset - wsEndLength))
+ && (sourceSelLength <= wsEndLength)) {
+ allowedLength = wsStartLength - (txtEndOffset - caretOffset);
+ if (sourceSelLength <= allowedLength) {
+ skip = true;
+ }
+ }
+ if (skip) {
+ /*
+ * Nothing is selected.
+ */
+ selection.collapse(visualNode, selectionStartOffset);
+ } else {
+ // Source text selection start offset
+ int newX = selectionRange.x;
+ // Source text selection length
+ int newY = selectionRange.y;
+ if (newX < goodX) {
+ newY = newY - (goodX - newX);
+ if (newY < 0) {
+ newY = 0;
+ }
+ newX = goodX;
+ }
+ // if new (selection offset+selection length) > than
+ // allowed text end coordinate.
+ if ((newX + newY) > goodY) {
+ // correct the new selection length:
+ // no more that allowed text end coordinate.
+ newY = goodY - newX;
+ }
+ Point newSrcRange = new Point(newX, newY);
+ int srcStartOffset = newSrcRange.x - NodesManagingUtil.getStartOffsetNode(sourceNode);
+ int srcEndOffset = srcStartOffset + newSrcRange.y;
+ int visualStartOffset = TextUtil.visualPosition(sourceTextImpl.getValueSource(), srcStartOffset);
+ int visualEndOffset = TextUtil.visualPosition(sourceTextImpl.getValueSource(), srcEndOffset);
+ if (visualStartOffset > length || visualEndOffset > length) {
+ return;
+ }
+ /*
+ * Detect selection direction
+ */
+ boolean toLeft = caretOffset <= newSrcRange.x;
+ boolean toRight = caretOffset >= newSrcRange.x + newSrcRange.y;
+ int min = Math.min(visualStartOffset, visualEndOffset);
+ int max = Math.max(visualStartOffset, visualEndOffset);
+ if (toRight) {
+ selection.collapse(visualNode, min);
+ selection.extend(visualNode, max);
+ } else if (toLeft) {
+ selection.collapse(visualNode, max);
+ selection.extend(visualNode, min);
+ }
+ }
}
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java 2012-06-01 13:28:20 UTC (rev 41627)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java 2012-06-01 13:49:15 UTC (rev 41628)
@@ -359,7 +359,8 @@
*
* @param sourceEditor
* StructuredTextEditor object
- * @return sourceSelectionRange
+ * @return a <code>Point</code> with x as the offset
+ * and y as the length of the current selection or <code>null</code>
*/
public static Point getSourceSelectionRange(StructuredTextEditor sourceEditor) {
ITextViewer textViewer = sourceEditor.getTextViewer();
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 2012-06-01 13:28:20 UTC (rev 41627)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/TextUtil.java 2012-06-01 13:49:15 UTC (rev 41628)
@@ -319,7 +319,11 @@
public static int visualPosition(String sourceText, int sourcePosition) {
int calcPosition = sourcePosition;
- if (sourceText == null) {
+ /*
+ * https://issues.jboss.org/browse/JBIDE-12052
+ * Fix StringIndexOutOfBoundsException
+ */
+ if ((sourceText == null) || (sourcePosition < 0)){
return 0;
}
int start = sourceText.indexOf(CHR_ESC_START);
12 years, 7 months
JBoss Tools SVN: r41627 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2012-06-01 09:28:20 -0400 (Fri, 01 Jun 2012)
New Revision: 41627
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ShowInWelcomePageActionProvider.java
Log:
JBIDE-12077 ui freeze removed for server adapter menu
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ShowInWelcomePageActionProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ShowInWelcomePageActionProvider.java 2012-06-01 13:23:38 UTC (rev 41626)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ShowInWelcomePageActionProvider.java 2012-06-01 13:28:20 UTC (rev 41627)
@@ -12,7 +12,11 @@
import java.net.URL;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IMenuManager;
@@ -20,6 +24,7 @@
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.internal.browser.ImageResource;
import org.eclipse.ui.navigator.CommonActionProvider;
import org.eclipse.ui.navigator.CommonViewer;
@@ -63,10 +68,20 @@
action = new Action() {
@Override
public void run() {
- String url = getUrl();
- if(url!=null) {
- JBTWebLaunchableClient.checkedCreateInternalBrowser(url, getServer().getName(), JBossServerUIPlugin.PLUGIN_ID, JBossServerUIPlugin.getDefault().getLog());
- }
+ new Job("Fetching Welcome Page URL") {
+ public IStatus run(IProgressMonitor monitor) {
+ // Get the url in a background thread to not freeze the UI
+ final String url = getUrl();
+ if(url!=null) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ JBTWebLaunchableClient.checkedCreateInternalBrowser(url, getServer().getName(), JBossServerUIPlugin.PLUGIN_ID, JBossServerUIPlugin.getDefault().getLog());
+ }
+ });
+ }
+ return Status.OK_STATUS;
+ }
+ }.schedule();
}
};
action.setText(ServerActionMessages.OpenWithBrowser);
@@ -74,6 +89,14 @@
action.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_INTERNAL_BROWSER));
}
+ private boolean hasURL() {
+ IServer server = getServer();
+ ServerExtendedProperties props = (ServerExtendedProperties)server.loadAdapter(ServerExtendedProperties.class, new NullProgressMonitor());
+ if( props != null )
+ return props.hasWelcomePage();
+ return false;
+ }
+
private String getUrl() {
String urlString = null;
IServer server = getServer();
@@ -134,7 +157,7 @@
IContributionItem menuItem = CommonActionProviderUtils.getShowInQuickMenu(menu, true);
if (menuItem instanceof MenuManager) {
((MenuManager) menuItem).add(action);
- action.setEnabled(getUrl()!=null);
+ action.setEnabled(hasURL());
}
}
}
12 years, 7 months
JBoss Tools SVN: r41626 - branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2012-06-01 09:23:38 -0400 (Fri, 01 Jun 2012)
New Revision: 41626
Modified:
branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ShowInWelcomePageActionProvider.java
Log:
JBIDE-12077 UI Freeze removed
Modified: branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ShowInWelcomePageActionProvider.java
===================================================================
--- branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ShowInWelcomePageActionProvider.java 2012-06-01 13:14:28 UTC (rev 41625)
+++ branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ShowInWelcomePageActionProvider.java 2012-06-01 13:23:38 UTC (rev 41626)
@@ -12,7 +12,11 @@
import java.net.URL;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IMenuManager;
@@ -20,6 +24,7 @@
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.internal.browser.ImageResource;
import org.eclipse.ui.navigator.CommonActionProvider;
import org.eclipse.ui.navigator.CommonViewer;
@@ -63,10 +68,20 @@
action = new Action() {
@Override
public void run() {
- String url = getUrl();
- if(url!=null) {
- JBTWebLaunchableClient.checkedCreateInternalBrowser(url, getServer().getName(), JBossServerUIPlugin.PLUGIN_ID, JBossServerUIPlugin.getDefault().getLog());
- }
+ new Job("Fetching Welcome Page URL") {
+ public IStatus run(IProgressMonitor monitor) {
+ // Get the url in a background thread to not freeze the UI
+ final String url = getUrl();
+ if(url!=null) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ JBTWebLaunchableClient.checkedCreateInternalBrowser(url, getServer().getName(), JBossServerUIPlugin.PLUGIN_ID, JBossServerUIPlugin.getDefault().getLog());
+ }
+ });
+ }
+ return Status.OK_STATUS;
+ }
+ }.schedule();
}
};
action.setText(ServerActionMessages.OpenWithBrowser);
@@ -74,6 +89,14 @@
action.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_INTERNAL_BROWSER));
}
+ private boolean hasURL() {
+ IServer server = getServer();
+ ServerExtendedProperties props = (ServerExtendedProperties)server.loadAdapter(ServerExtendedProperties.class, new NullProgressMonitor());
+ if( props != null )
+ return props.hasWelcomePage();
+ return false;
+ }
+
private String getUrl() {
String urlString = null;
IServer server = getServer();
@@ -134,7 +157,7 @@
IContributionItem menuItem = CommonActionProviderUtils.getShowInQuickMenu(menu, true);
if (menuItem instanceof MenuManager) {
((MenuManager) menuItem).add(action);
- action.setEnabled(getUrl()!=null);
+ action.setEnabled(hasURL());
}
}
}
12 years, 7 months
JBoss Tools SVN: r41625 - branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-06-01 09:14:28 -0400 (Fri, 01 Jun 2012)
New Revision: 41625
Modified:
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
Log:
[JBIDE-11954] forced ListUpdateStrategy to use old non-moving strategy (old strategy does: add & remove, new strategy does: move instead)
Modified: branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-06-01 13:12:09 UTC (rev 41624)
+++ branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-06-01 13:14:28 UTC (rev 41625)
@@ -302,8 +302,24 @@
dbc.bindList(WidgetProperties.items().observe(gearProfilesCombo),
BeanProperties.list(ApplicationConfigurationWizardPageModel.PROPERTY_GEAR_PROFILES).observe(pageModel),
new UpdateListStrategy(UpdateListStrategy.POLICY_NEVER),
- new UpdateListStrategy().setConverter(new GearProfileToStringConverter()));
+ new UpdateListStrategy() {
+ /**
+ * Needed to avoid buggy list update strategy in
+ * ListBinding. The bug appears if the model list changes
+ * its ordering and the strategy then tries to apply the
+ * move in the target (widget). It does not apply the
+ * conversion and ends up in a class cast exception when
+ * updating the target (widget) items list.
+ *
+ * @see https://issues.jboss.org/browse/JBIDE-11954
+ */
+ protected boolean useMoveAndReplace() {
+ return false;
+ }
+
+ }.setConverter(new GearProfileToStringConverter()));
+
final ISWTObservableValue selectedGearProfileComboObservable =
WidgetProperties.selection().observe(gearProfilesCombo);
final IObservableValue selectedGearProfileModelObservable = BeanProperties.value(
@@ -695,12 +711,11 @@
/**
*
- * @return
- private boolean ensureHasSshKey() {
-
- }
+ * @return private boolean ensureHasSshKey() {
+ *
+ * }
*/
-
+
protected void loadOpenshiftResources(final DataBindingContext dbc) {
try {
WizardUtils.runInWizard(new Job("Loading existing applications...") {
12 years, 7 months
JBoss Tools SVN: r41624 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-06-01 09:12:09 -0400 (Fri, 01 Jun 2012)
New Revision: 41624
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
Log:
[JBIDE-11954] forced ListUpdateStrategy to use old non-moving strategy (old strategy does: add & remove, new strategy does: move instead)
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-06-01 13:04:06 UTC (rev 41623)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-06-01 13:12:09 UTC (rev 41624)
@@ -302,8 +302,24 @@
dbc.bindList(WidgetProperties.items().observe(gearProfilesCombo),
BeanProperties.list(ApplicationConfigurationWizardPageModel.PROPERTY_GEAR_PROFILES).observe(pageModel),
new UpdateListStrategy(UpdateListStrategy.POLICY_NEVER),
- new UpdateListStrategy().setConverter(new GearProfileToStringConverter()));
+ new UpdateListStrategy() {
+ /**
+ * Needed to avoid buggy list update strategy in
+ * ListBinding. The bug appears if the model list changes
+ * its ordering and the strategy then tries to apply the
+ * move in the target (widget). It does not apply the
+ * conversion and ends up in a class cast exception when
+ * updating the target (widget) items list.
+ *
+ * @see https://issues.jboss.org/browse/JBIDE-11954
+ */
+ protected boolean useMoveAndReplace() {
+ return false;
+ }
+
+ }.setConverter(new GearProfileToStringConverter()));
+
final ISWTObservableValue selectedGearProfileComboObservable =
WidgetProperties.selection().observe(gearProfilesCombo);
final IObservableValue selectedGearProfileModelObservable = BeanProperties.value(
@@ -695,12 +711,11 @@
/**
*
- * @return
- private boolean ensureHasSshKey() {
-
- }
+ * @return private boolean ensureHasSshKey() {
+ *
+ * }
*/
-
+
protected void loadOpenshiftResources(final DataBindingContext dbc) {
try {
WizardUtils.runInWizard(new Job("Loading existing applications...") {
12 years, 7 months
JBoss Tools SVN: r41623 - branches/jbosstools-3.3.x/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/editor/action.
by jbosstools-commits@lists.jboss.org
Author: ldimaggio
Date: 2012-06-01 09:04:06 -0400 (Fri, 01 Jun 2012)
New Revision: 41623
Modified:
branches/jbosstools-3.3.x/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/editor/action/Notifier.java
Log:
Trying again - adding back the test blocked by https://issues.jboss.org/browse/JBDS-2167
Modified: branches/jbosstools-3.3.x/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/editor/action/Notifier.java
===================================================================
--- branches/jbosstools-3.3.x/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/editor/action/Notifier.java 2012-06-01 11:53:26 UTC (rev 41622)
+++ branches/jbosstools-3.3.x/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/editor/action/Notifier.java 2012-06-01 13:04:06 UTC (rev 41623)
@@ -103,14 +103,14 @@
/* Comment out due to - https://issues.jboss.org/browse/JBDS-2167 */
-// bot.button("&Add...").click();
-// SWTBotTreeItem [] theItems = bot.tree().getAllItems();
-//
-// theItems[0].getNode("resources.jar").expand();
-// theItems[0].getNode("resources.jar").getNode("META-INF").expand();
-// theItems[0].getNode("resources.jar").getNode("META-INF").getNode("MANIFEST.MF").select();
-// bot.button("&Finish").click();
+ bot.button("&Add...").click();
+ SWTBotTreeItem [] theItems = bot.tree().getAllItems();
+ theItems[0].getNode("resources.jar").expand();
+ theItems[0].getNode("resources.jar").getNode("META-INF").expand();
+ theItems[0].getNode("resources.jar").getNode("META-INF").getNode("MANIFEST.MF").select();
+ bot.button("&Finish").click();
+
editor.save();
}
12 years, 7 months
JBoss Tools SVN: r41622 - trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2012-06-01 07:53:26 -0400 (Fri, 01 Jun 2012)
New Revision: 41622
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java
Log:
JBDS-2183 EAP6 installed with JBDS should have name "jboss-eap-6" in Servers view instead of "jboss-as"
fixed
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java 2012-06-01 11:45:32 UTC (rev 41621)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java 2012-06-01 11:53:26 UTC (rev 41622)
@@ -39,7 +39,7 @@
public class JBossRuntimeStartup {
- private static final String JBOSS_EAP_HOME = "../../jboss-eap"; // JBoss EAP home directory (relative to plugin)- <RHDS_HOME>/jbossas. //$NON-NLS-1$
+ private static final String JBOSS_EAP_HOME = "../../runtimes/jboss-eap"; // JBoss EAP home directory (relative to plugin)- <RHDS_HOME>/jbossas. //$NON-NLS-1$
private static final String LOCATIONS_FILE_NAME = "runtime_locations.properties"; //$NON-NLS-1$
private static final String LOCATIONS_FILE = "../../../../studio/" + LOCATIONS_FILE_NAME; //$NON-NLS-1$
private static final String LOCATIONS_FILE_CONFIGURATION = "../../studio/" + LOCATIONS_FILE_NAME; //$NON-NLS-1$
12 years, 7 months
JBoss Tools SVN: r41620 - branches/jbosstools-3.3.x/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2012-06-01 07:45:08 -0400 (Fri, 01 Jun 2012)
New Revision: 41620
Modified:
branches/jbosstools-3.3.x/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java
Log:
JBDS-2183 EAP6 installed with JBDS should have name "jboss-eap-6" in Servers view instead of "jboss-as"
fixed
Modified: branches/jbosstools-3.3.x/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java
===================================================================
--- branches/jbosstools-3.3.x/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java 2012-06-01 09:54:44 UTC (rev 41619)
+++ branches/jbosstools-3.3.x/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java 2012-06-01 11:45:08 UTC (rev 41620)
@@ -39,7 +39,7 @@
public class JBossRuntimeStartup {
- private static final String JBOSS_EAP_HOME = "../../jboss-eap"; // JBoss EAP home directory (relative to plugin)- <RHDS_HOME>/jbossas. //$NON-NLS-1$
+ private static final String JBOSS_EAP_HOME = "../../runtimes/jboss-eap"; // JBoss EAP home directory (relative to plugin)- <RHDS_HOME>/jbossas. //$NON-NLS-1$
private static final String LOCATIONS_FILE_NAME = "runtime_locations.properties"; //$NON-NLS-1$
private static final String LOCATIONS_FILE = "../../../../studio/" + LOCATIONS_FILE_NAME; //$NON-NLS-1$
12 years, 7 months