JBoss Tools SVN: r29169 - trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-02-16 05:14:08 -0500 (Wed, 16 Feb 2011)
New Revision: 29169
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java
Log:
JBIDE-8424
https://issues.jboss.org/browse/JBIDE-8424
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java 2011-02-16 09:25:03 UTC (rev 29168)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java 2011-02-16 10:14:08 UTC (rev 29169)
@@ -455,6 +455,10 @@
if(configJavaDM != null && sv != null && sv.indexOf("3.0") >= 0) { //$NON-NLS-1$
configJavaDM.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, "1.6"); //$NON-NLS-1$
}
+ String contextRoot = getProperty("WebNatureOperation.CONTEXT_ROOT");
+ if(contextRoot != null && contextRoot.length() > 0 && !contextRoot.equals(getProject().getName())) {
+ configDM.setProperty(IWebFacetInstallDataModelProperties.CONTEXT_ROOT, contextRoot);
+ }
if(webroot != null) {
int i = webroot.lastIndexOf("/"); //$NON-NLS-1$
13 years, 10 months
JBoss Tools SVN: r29168 - in trunk: jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2011-02-16 04:25:03 -0500 (Wed, 16 Feb 2011)
New Revision: 29168
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/editor/IVisualEditorFactory.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPartFactory.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/ISelectionManager.java
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
Log:
https://issues.jboss.org/browse/JBIDE-8115 : Support for multiple selection in visual part
- methods of SelectionManager
setSelection(nsISelection selection) and
setSelection(nsIDOMNode visualNode, int rangeOffset)
are merged into
setSelection(nsIDOMNode visualNode, int focusOffset, int anchorOffset)
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/editor/IVisualEditorFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/editor/IVisualEditorFactory.java 2011-02-16 09:13:42 UTC (rev 29167)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/editor/IVisualEditorFactory.java 2011-02-16 09:25:03 UTC (rev 29168)
@@ -17,7 +17,7 @@
public interface IVisualEditorFactory {
public IVisualEditor createVisualEditor(EditorPart multiPageEditor,
- StructuredTextEditor textEditor, boolean visualMode,
+ StructuredTextEditor textEditor, int visualMode,
BundleMap bundleMap);
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2011-02-16 09:13:42 UTC (rev 29167)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2011-02-16 09:25:03 UTC (rev 29168)
@@ -482,7 +482,7 @@
if (visualEditorFactory != null) {
visualEditor = visualEditorFactory.createVisualEditor(this,
- sourceEditor, false, bundleMap);
+ sourceEditor, IVisualEditor.VISUALSOURCE_MODE, bundleMap);
}
try {
if (visualEditor != null) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2011-02-16 09:13:42 UTC (rev 29167)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2011-02-16 09:25:03 UTC (rev 29168)
@@ -1150,7 +1150,8 @@
* <select> node to be selected on the first click.
*/
if (node != null) {
- selectionManager.setSelection(selection);
+ selectionManager.setSelection(SelectionUtil.getSelectedNode(selection),
+ selection.getFocusOffset(), selection.getAnchorOffset());
}
}
// enables cursor on selection event
@@ -1219,9 +1220,12 @@
if (vpeDnD.isDragIconClicked(mouseEvent)) {
vpeDnD.dragStart(mouseEvent);
} else {
+ int rangeOffset = queryInterface(mouseEvent, nsIDOMNSUIEvent.class).getRangeOffset();
+
+ // set source selection at the point where mouse is clicked
selectionManager.setSelection(
- VisualDomUtil.getTargetNode(mouseEvent),
- queryInterface(mouseEvent, nsIDOMNSUIEvent.class).getRangeOffset());
+ VisualDomUtil.getTargetNode(mouseEvent),
+ rangeOffset, rangeOffset);
}
}
} finally {
@@ -1270,7 +1274,7 @@
VpeNodeMapping toggledMapping
= getDomMapping().getNearNodeMapping(toggledElement);
if (toggledMapping != null && toggledMapping.getVisualNode() != null) {
- selectionManager.setSelection(toggledMapping.getVisualNode(), 0);
+ selectionManager.setSelection(toggledMapping.getVisualNode(), 0, 0);
}
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2011-02-16 09:13:42 UTC (rev 29167)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2011-02-16 09:25:03 UTC (rev 29168)
@@ -20,7 +20,10 @@
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.ControlEvent;
@@ -44,6 +47,7 @@
import org.eclipse.ui.IPartListener;
import org.eclipse.ui.IPropertyListener;
import org.eclipse.ui.IReusableEditor;
+import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPart;
@@ -94,7 +98,7 @@
private Composite cmpEdTl;
private CustomSashForm container;
protected EditorSettings editorSettings;
- private StructuredTextEditor sourceEditor = null;
+ private StructuredTextEditor sourceEditor;
private MozillaEditor visualEditor;
private BundleMap bundleMap;
private IEditorPart activeEditor;
@@ -103,7 +107,7 @@
private XModelObject optionsObject;
// private SelectionBar selectionBar = new SelectionBar();
private ActivationListener activationListener = new ActivationListener();
- private int visualMode = 0;
+ private int visualMode;
private EditorPart multiPageEditor;
private int controlCount = 0;
@@ -247,20 +251,21 @@
}
public VpeEditorPart(EditorPart multiPageEditor,
- StructuredTextEditor textEditor, boolean visualMode, BundleMap bundleMap) {
- sourceEditor = textEditor;
- // this.visualMode = visualMode;
+ StructuredTextEditor textEditor, int visualMode, BundleMap bundleMap) {
+ this.sourceEditor = textEditor;
+ this.visualMode = visualMode;
this.bundleMap = bundleMap;
this.multiPageEditor = multiPageEditor;
}
+
+ public VpeEditorPart() {
+ this(null, null, VISUALSOURCE_MODE, null);
+ }
public IAction getAction(String actionID) {
return sourceEditor.getAction(actionID);
}
- public VpeEditorPart() {
- }
-
public void doSave(IProgressMonitor monitor) {
if (sourceEditor != null) {
sourceEditor.doSave(monitor);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPartFactory.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPartFactory.java 2011-02-16 09:13:42 UTC (rev 29167)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPartFactory.java 2011-02-16 09:25:03 UTC (rev 29168)
@@ -19,7 +19,7 @@
public class VpeEditorPartFactory implements IVisualEditorFactory {
- public IVisualEditor createVisualEditor(final EditorPart multiPageEditor, StructuredTextEditor textEditor, boolean visualMode, BundleMap bundleMap) {
+ public IVisualEditor createVisualEditor(final EditorPart multiPageEditor, StructuredTextEditor textEditor, int visualMode, BundleMap bundleMap) {
return new VpeEditorPart(multiPageEditor, textEditor, visualMode, bundleMap) {
public void doSave(IProgressMonitor monitor){
multiPageEditor.doSave(monitor);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/ISelectionManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/ISelectionManager.java 2011-02-16 09:13:42 UTC (rev 29167)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/ISelectionManager.java 2011-02-16 09:25:03 UTC (rev 29168)
@@ -26,16 +26,9 @@
*
* @param selection
*/
- public void setSelection(nsISelection selection);
+ public void setSelection(nsIDOMNode visualNode, int focusOffset, int anchorOffset);
/**
- * set selection by mouse
- *
- * @param mouseEvent
- */
- public void setSelection(nsIDOMNode visualNode, int rangeOffset);
-
- /**
* to bring in correspondence visual selection and source selection
*/
public void refreshVisualSelection();
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 2011-02-16 09:13:42 UTC (rev 29167)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java 2011-02-16 09:25:03 UTC (rev 29168)
@@ -59,9 +59,7 @@
this.selectionController = selectionController;
}
- /* TODO: merge this method with setSelection(nsIDOMNode visualNode, int rangeOffset) */
- public final void setSelection(nsISelection selection) {
- nsIDOMNode visualNode = SelectionUtil.getSelectedNode(selection);
+ public final void setSelection(nsIDOMNode visualNode, int focusOffset, int anchorOffset) {
if (visualNode == null) {
return;
}
@@ -81,7 +79,7 @@
int selectionLength;
if (selectionData.isNodeEditable()) {
Point sourceSelectionRange = SelectionUtil.getSourceSelectionRange(
- selection, selectionData.getSourceNode());
+ visualNode, focusOffset, anchorOffset, selectionData.getSourceNode());
selectionOffset = sourceSelectionRange.x;
selectionLength = sourceSelectionRange.y;
} else {
@@ -89,28 +87,6 @@
selectionLength = NodesManagingUtil.getNodeLength(selectionData.getSourceNode());
}
/*************** Apply selection to views *****************************/
- SelectionUtil.setSourceSelection(getPageContext(), selectionData.getSourceNode(),
- selectionOffset, selectionLength);
- getPageContext().getVisualBuilder().setSelectionRectangle(
- selectionData.getVisualNode());
- }
-
- final public void setSelection(nsIDOMNode visualNode, int rangeOffset) {
- SelectionData selectionData = getSelectionData(visualNode);
- if (selectionData == null) {
- return;
- }
- /*************** Calculate selection range ****************************/
- int selectionOffset;
- int selectionLength;
- if (selectionData.isNodeEditable()) {
- selectionOffset = rangeOffset;
- selectionLength = 0;
- } else {
- selectionOffset = 0;
- selectionLength = NodesManagingUtil.getNodeLength(selectionData.getSourceNode());
- }
- /*************** Apply selection to views *****************************/
SelectionUtil.setSourceSelection(getPageContext(),
selectionData.getSourceNode(),
selectionOffset, selectionLength);
@@ -164,7 +140,6 @@
* source selection to visual selection
*/
final public void refreshVisualSelection() {
-
// checks for null, for case when we close editor and background
// update job is running
if (getSourceEditor().getTextViewer() == null) {
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 2011-02-16 09:13:42 UTC (rev 29167)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java 2011-02-16 09:25:03 UTC (rev 29168)
@@ -208,9 +208,8 @@
* the selection in visual part of editor
* @return source editor selection range
*/
- public static Point getSourceSelectionRange(nsISelection selection,
- Node sourceNode) {
- nsIDOMNode focusedNode = getSelectedNode(selection);
+ public static Point getSourceSelectionRange(nsIDOMNode focusedNode,
+ int focusOffset, int anchorOffset, Node sourceNode) {
// gets visual selection range
Point sourceRange = new Point(0, 0);
// converts to source selection
@@ -218,9 +217,9 @@
//fix for JBIDE-3650
NodeImpl nodeImpl = (NodeImpl) sourceNode;
sourceRange.x = TextUtil.sourcePosition(nodeImpl.getValueSource(),
- focusedNode.getNodeValue(), selection.getFocusOffset());
+ focusedNode.getNodeValue(), focusOffset);
sourceRange.y = TextUtil.sourcePosition(nodeImpl.getValueSource(),
- focusedNode.getNodeValue(), selection.getAnchorOffset())
+ focusedNode.getNodeValue(), anchorOffset)
- sourceRange.x;
}
return sourceRange;
13 years, 10 months
JBoss Tools SVN: r29167 - trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2011-02-16 04:13:42 -0500 (Wed, 16 Feb 2011)
New Revision: 29167
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/JavaGraphBuilder.java
Log:
JBIDE-7509
Miss this class
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/JavaGraphBuilder.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/JavaGraphBuilder.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/JavaGraphBuilder.java 2011-02-16 09:13:42 UTC (rev 29167)
@@ -0,0 +1,131 @@
+package org.jboss.tools.smooks.launch;
+
+import java.lang.reflect.Array;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.milyn.Smooks;
+import org.milyn.payload.JavaSource;
+import org.w3c.dom.Document;
+
+public class JavaGraphBuilder {
+
+ public <T> T buildGraph(Class<T> messageType) {
+ try {
+ return buildObject(messageType);
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new IllegalArgumentException("Unable to construct an instance of '" + messageType.getName() + "'", e);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private <T> T buildObject(Class<T> objectType) throws IllegalAccessException, InstantiationException, InvocationTargetException, NoSuchMethodException {
+
+ if(String.class.isAssignableFrom(objectType)) {
+ return objectType.cast("x");
+ } else if(Number.class.isAssignableFrom(objectType)) {
+ return objectType.getConstructor(String.class).newInstance("1");
+ } else if(objectType.isPrimitive()) {
+ return (T) primitiveToObjectMap.get(objectType);
+ } else if(objectType == Object.class) {
+ // don't construct raw Object types... leave them and just return null...
+ return null;
+ } else if(objectType.isEnum()) {
+ return (T) EnumSet.allOf((Class<Enum>)objectType).iterator().next();
+ }
+
+ T messageInstance = objectType.newInstance();
+
+ // populate all the fields...
+ Method[] methods = objectType.getMethods();
+ for(Method method : methods) {
+ if(method.getName().startsWith("set") && method.getParameterTypes().length == 1) {
+ Class<?> propertyType = method.getParameterTypes()[0];
+ Object propertyInstance = null;
+
+ if(Collection.class.isAssignableFrom(propertyType)) {
+ propertyInstance = buildCollection(method, propertyType);
+ } else if(propertyType.isArray()) {
+ propertyInstance = buildArray(method, propertyType);
+ } else {
+ propertyInstance = buildObject(propertyType);
+ }
+
+ if(propertyInstance != null) {
+ method.invoke(messageInstance, propertyInstance);
+ }
+ }
+ }
+
+ return messageInstance;
+ }
+
+ private Object buildArray(Method method, Class<?> propertyType) throws ArrayIndexOutOfBoundsException, IllegalArgumentException, IllegalAccessException, InstantiationException, InvocationTargetException, NoSuchMethodException {
+ Class<?> arrayType = propertyType.getComponentType();
+ Object[] arrayObj = (Object[]) Array.newInstance(arrayType, 1);
+
+ Array.set(arrayObj, 0, buildObject(arrayType));
+
+ return arrayObj;
+ }
+
+ private Object buildCollection(Method method, Class<?> propertyType) throws IllegalAccessException, InstantiationException, InvocationTargetException, NoSuchMethodException {
+ Type genericType = method.getGenericParameterTypes()[0];
+
+ if(genericType instanceof ParameterizedType) {
+ ParameterizedType genericTypeClass = (ParameterizedType) genericType;
+ Collection collection = null;
+
+ if(!propertyType.isInterface()) {
+ // It's a concrete Collection type... just create an instance...
+ collection = (Collection) propertyType.newInstance();
+ }else if(List.class.isAssignableFrom(propertyType)) {
+ collection = new ArrayList();
+ } else if(Set.class.isAssignableFrom(propertyType)) {
+ collection = new LinkedHashSet();
+ }
+
+ if(collection != null) {
+ collection.add(buildObject((Class<Object>) genericTypeClass.getActualTypeArguments()[0]));
+ return collection;
+ }
+ }
+
+ return null;
+ }
+
+ private static final Map<Class, Object> primitiveToObjectMap;
+
+ static {
+ primitiveToObjectMap = new HashMap<Class, Object>();
+ primitiveToObjectMap.put(int.class, 1);
+ primitiveToObjectMap.put(long.class, 1L);
+ primitiveToObjectMap.put(boolean.class, true);
+ primitiveToObjectMap.put(float.class, 1f);
+ primitiveToObjectMap.put(double.class, 1d);
+ primitiveToObjectMap.put(char.class, '1');
+ primitiveToObjectMap.put(byte.class, Byte.parseByte("1"));
+ primitiveToObjectMap.put(short.class, 1);
+ }
+
+}
+
13 years, 10 months
JBoss Tools SVN: r29166 - in trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge: console and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-02-16 04:11:33 -0500 (Wed, 16 Feb 2011)
New Revision: 29166
Added:
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/old/
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/old/ConsolePartition.java
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/old/ConsolePartitioner.java
Removed:
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/ConsolePartition.java
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/MyPartitioner.java
Modified:
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/Console.java
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/ConsolePartitioner.java
Log:
moved ConsolePartitioner and ConsolePartition classes to 'old' package
Modified: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/Console.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/Console.java 2011-02-16 03:04:40 UTC (rev 29165)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/Console.java 2011-02-16 09:11:33 UTC (rev 29166)
@@ -17,7 +17,7 @@
public class Console extends TextConsole implements IDebugEventSetListener {
- private MyPartitioner partitioner;
+ private ConsolePartitioner partitioner;
private ConsoleInputStream inputStream;
private ConsoleOutputStream outputStream;
private IProcess process = null;
@@ -64,7 +64,7 @@
}
private void initPartitioner() {
- partitioner = new MyPartitioner();
+ partitioner = new ConsolePartitioner();
partitioner.connect(getDocument());
}
Deleted: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/ConsolePartition.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/ConsolePartition.java 2011-02-16 03:04:40 UTC (rev 29165)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/ConsolePartition.java 2011-02-16 09:11:33 UTC (rev 29166)
@@ -1,164 +0,0 @@
-package org.jboss.tools.seam.forge.console;
-
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.ui.console.ConsolePlugin;
-
-public class ConsolePartition implements ITypedRegion {
- public static final String OUTPUT_PARTITION_TYPE = ConsolePlugin.getUniqueIdentifier() + ".io_console_output_partition_type"; //$NON-NLS-1$
- public static final String INPUT_PARTITION_TYPE = ConsolePlugin.getUniqueIdentifier() + ".io_console_input_partition_type"; //$NON-NLS-1$
-
- /**
- * The data contained by this partition.
- */
- private StringBuffer buffer;
- private String type;
- private int offset;
- /**
- * Output partitions are all read only.
- * Input partitions are read only once they have been appended to the console's input stream.
- */
- private boolean readOnly;
-
- /**
- * Only one of inputStream or outputStream will be null depending on the partitions type.
- */
- private ConsoleOutputStream outputStream;
- private ConsoleInputStream inputStream;
- private int length;
-
- /**
- * Creates a new partition to contain output to console.
- */
- public ConsolePartition(ConsoleOutputStream outputStream, int length) {
- this.outputStream = outputStream;
- this.length = length;
- this.type = OUTPUT_PARTITION_TYPE;
- this.readOnly = true;
- }
-
- /**
- * Creates a new partition to contain input from a console
- */
- public ConsolePartition(ConsoleInputStream inputStream, String text) {
- this.inputStream = inputStream;
- buffer = new StringBuffer(text);
- length = text.length();
- this.type = INPUT_PARTITION_TYPE;
- this.readOnly = false;
- }
-
- /**
- * Inserts a string into this partition.
- * @param s The string to insert
- * @param offset the offset in the partition
- */
- public void insert(String s, int insertOffset) {
- buffer.insert(insertOffset, s);
- length += s.length();
- }
-
- /**
- * Deletes data from this partition.
- * @param delOffset
- * @param delLength
- */
- public void delete(int delOffset, int delLength) {
- buffer.delete(delOffset, delOffset+delLength);
- length -= delLength;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.text.ITypedRegion#getType()
- */
- public String getType() {
- return type;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.text.IRegion#getLength()
- */
- public int getLength() {
- return length;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.text.IRegion#getOffset()
- */
- public int getOffset() {
- return offset;
- }
-
- /**
- * Sets this partitions offset in the document.
- *
- * @param offset This partitions offset in the document.
- */
- public void setOffset(int offset) {
- this.offset = offset;
- }
-
- /**
- * Sets this partition's length.
- *
- * @param length
- */
- public void setLength(int length) {
- this.length = length;
- }
-
- /**
- * Returns the data contained in this partition.
- * @return The data contained in this partition.
- */
- public String getString() {
- return buffer.toString();
- }
-
- /**
- * Returns a StyleRange object which may be used for setting the style
- * of this partition in a viewer.
- */
- public StyleRange getStyleRange(int rangeOffset, int rangeLength) {
- return new StyleRange(rangeOffset, rangeLength, null, null);
- }
-
- /**
- * Returns if this partition is read-only.
- *
- * @see org.eclipse.ui.console.IConsoleDocumentPartitioner#isReadOnly(int)
- * @return if this partition is read-only
- */
- public boolean isReadOnly() {
- return readOnly;
- }
-
- /**
- * Sets the read-only state of this partition to <code>true</code>.
- *
- * @see org.eclipse.ui.console.IConsoleDocumentPartitioner#isReadOnly(int)
- */
- public void setReadOnly() {
- readOnly = true;
- }
-
- /**
- * Clears the contents of the buffer
- */
- public void clearBuffer() {
- buffer.setLength(0);
- }
-
- /**
- * Returns the underlying output stream
- *
- * @return the underlying output stream
- */
- ConsoleOutputStream getStream() {
- return outputStream;
- }
-}
Modified: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/ConsolePartitioner.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/ConsolePartitioner.java 2011-02-16 03:04:40 UTC (rev 29165)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/ConsolePartitioner.java 2011-02-16 09:11:33 UTC (rev 29166)
@@ -1,692 +1,70 @@
package org.jboss.tools.seam.forge.console;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.IJobManager;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.DocumentEvent;
import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentPartitionerExtension;
-import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Region;
import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsoleDocumentPartitioner;
-import org.eclipse.ui.progress.UIJob;
-import org.eclipse.ui.progress.WorkbenchJob;
-/**
- * Partitions an IOConsole's document
- * @since 3.1
- *
- */
-public class ConsolePartitioner implements IConsoleDocumentPartitioner, IDocumentPartitionerExtension {
-
- private PendingPartition consoleClosedPartition;
- private IDocument document;
- private ArrayList partitions;
- /**
- * Blocks of data that have not yet been appended to the document.
- */
- private ArrayList pendingPartitions;
- /**
- * A list of PendingPartitions to be appended by the updateJob
- */
- private ArrayList updatePartitions;
- /**
- * The last partition appended to the document
- */
- private ConsolePartition lastPartition;
- /**
- * Job that appends pending partitions to the document.
- */
- private QueueProcessingJob queueJob;
- /**
- * The input stream attached to this document.
- */
- private ConsoleInputStream inputStream;
- /**
- * Flag to indicate that the updateJob is updating the document.
- */
- private boolean updateInProgress;
- /**
- * A list of partitions containing input from the console, that have
- * not been appended to the input stream yet.
- */
- private ArrayList inputPartitions;
- /**
- * offset used by updateJob
- */
- private int firstOffset;
- /**
- * An array of legal line delimiters
- */
- private String[] lld;
- private int highWaterMark = -1;
- private int lowWaterMark = -1;
- private boolean connected = false;
+public class ConsolePartitioner implements IConsoleDocumentPartitioner {
- private Console console;
-
- private TrimJob trimJob = new TrimJob();
- /**
- * Lock for appending to and removing from the document - used
- * to synchronize addition of new text/partitions in the update
- * job and handling buffer overflow/clearing of the console.
- */
- private Object overflowLock = new Object();
-
-
- private int fBuffer;
-
- private ConsolePartitioner(ConsoleInputStream inputStream, Console console) {
- this.inputStream = inputStream;
- this.console = console;
- trimJob.setRule(console.getSchedulingRule());
- }
-
- public IDocument getDocument() {
- return document;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.text.IDocumentPartitioner#connect(org.eclipse.jface.text.IDocument)
- */
- public void connect(IDocument doc) {
- document = doc;
+ @Override
+ public void connect(IDocument document) {
document.setDocumentPartitioner(this);
- lld = document.getLegalLineDelimiters();
- partitions = new ArrayList();
- pendingPartitions = new ArrayList();
- inputPartitions = new ArrayList();
- queueJob = new QueueProcessingJob();
- queueJob.setSystem(true);
- queueJob.setPriority(Job.INTERACTIVE);
- queueJob.setRule(console.getSchedulingRule());
- connected = true;
}
-
- public int getHighWaterMark() {
- return highWaterMark;
- }
-
- public int getLowWaterMark() {
- return lowWaterMark;
- }
-
- public void setWaterMarks(int low, int high) {
- lowWaterMark = low;
- highWaterMark = high;
- ConsolePlugin.getStandardDisplay().asyncExec(new Runnable() {
- public void run() {
- checkBufferSize();
- }
- });
- }
-
- /**
- * Notification from the console that all of its streams have been closed.
- */
- public void streamsClosed() {
- consoleClosedPartition = new PendingPartition(null, null);
- synchronized (pendingPartitions) {
- pendingPartitions.add(consoleClosedPartition);
- }
- queueJob.schedule(); //ensure that all pending partitions are processed.
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.text.IDocumentPartitioner#disconnect()
- */
+
+ @Override
public void disconnect() {
- synchronized (overflowLock) {
- document = null;
- partitions.clear();
- connected = false;
- try {
- inputStream.close();
- } catch (IOException e) {
- }
- }
+ // TODO Auto-generated method stub
+
}
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.text.IDocumentPartitioner#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
- */
+
+ @Override
public void documentAboutToBeChanged(DocumentEvent event) {
+ // TODO Auto-generated method stub
+
}
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.text.IDocumentPartitioner#documentChanged(org.eclipse.jface.text.DocumentEvent)
- */
+
+ @Override
public boolean documentChanged(DocumentEvent event) {
- return documentChanged2(event) != null;
+ // TODO Auto-generated method stub
+ return false;
}
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.text.IDocumentPartitioner#getLegalContentTypes()
- */
+
+ @Override
public String[] getLegalContentTypes() {
- return new String[] { ConsolePartition.OUTPUT_PARTITION_TYPE, ConsolePartition.INPUT_PARTITION_TYPE };
+ // TODO Auto-generated method stub
+ return null;
}
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.text.IDocumentPartitioner#getContentType(int)
- */
+
+ @Override
public String getContentType(int offset) {
- return getPartition(offset).getType();
+ // TODO Auto-generated method stub
+ return null;
}
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.text.IDocumentPartitioner#computePartitioning(int, int)
- */
- public ITypedRegion[] computePartitioning(int offset, int length) {
- int rangeEnd = offset + length;
- int left= 0;
- int right= partitions.size() - 1;
- int mid= 0;
- ConsolePartition position= null;
-
- if (left == right) {
- return new ConsolePartition[]{(ConsolePartition) partitions.get(0)};
- }
- while (left < right) {
-
- mid= (left + right) / 2;
-
- position= (ConsolePartition) partitions.get(mid);
- if (rangeEnd < position.getOffset()) {
- if (left == mid)
- right= left;
- else
- right= mid -1;
- } else if (offset > (position.getOffset() + position.getLength() - 1)) {
- if (right == mid)
- left= right;
- else
- left= mid +1;
- } else {
- left= right= mid;
- }
- }
-
-
- List list = new ArrayList();
- int index = left - 1;
- if (index >= 0) {
- position= (ConsolePartition) partitions.get(index);
- while (index >= 0 && (position.getOffset() + position.getLength()) > offset) {
- index--;
- if (index >= 0) {
- position= (ConsolePartition) partitions.get(index);
- }
- }
- }
- index++;
- position= (ConsolePartition) partitions.get(index);
- while (index < partitions.size() && (position.getOffset() < rangeEnd)) {
- list.add(position);
- index++;
- if (index < partitions.size()) {
- position= (ConsolePartition) partitions.get(index);
- }
- }
-
- return (ITypedRegion[]) list.toArray(new ConsolePartition[list.size()]);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.text.IDocumentPartitioner#getPartition(int)
- */
- public ITypedRegion getPartition(int offset) {
- for (int i = 0; i < partitions.size(); i++) {
- ITypedRegion partition = (ITypedRegion) partitions.get(i);
- int start = partition.getOffset();
- int end = start + partition.getLength();
- if (offset >= start && offset < end) {
- return partition;
- }
- }
-
- if (lastPartition == null) {
- synchronized(partitions) {
- lastPartition = new ConsolePartition(inputStream, ""); //$NON-NLS-1$
- lastPartition.setOffset(offset);
- partitions.add(lastPartition);
- inputPartitions.add(lastPartition);
- }
- }
- return lastPartition;
+ @Override
+ public ITypedRegion[] computePartitioning(int offset, int length) {
+ // TODO Auto-generated method stub
+ return null;
}
-
- /**
- * Enforces the buffer size.
- * When the number of lines in the document exceeds the high water mark, the
- * beginning of the document is trimmed until the number of lines equals the
- * low water mark.
- */
- private void checkBufferSize() {
- if (document != null && highWaterMark > 0) {
- int length = document.getLength();
- if (length > highWaterMark) {
- if (trimJob.getState() == Job.NONE) { //if the job isn't already running
- trimJob.setOffset(length - lowWaterMark);
- trimJob.schedule();
- }
- }
- }
- }
-
- /**
- * Clears the console
- */
- public void clearBuffer() {
- synchronized (overflowLock) {
- trimJob.setOffset(-1);
- trimJob.schedule();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.IDocumentPartitionerExtension#documentChanged2(org.eclipse.jface.text.DocumentEvent)
- */
- public IRegion documentChanged2(DocumentEvent event) {
- System.out.println("documentChanged2 : " + event.fText);
- if (document == null) {
- return null; //another thread disconnected the partitioner
- }
- if (document.getLength() == 0) { //document cleared
- if (lastPartition != null && lastPartition.getType().equals(ConsolePartition.INPUT_PARTITION_TYPE)) {
- synchronized (partitions) {
- partitions.remove(lastPartition);
- inputPartitions.remove(lastPartition);
- }
- }
- lastPartition = null;
- return new Region(0, 0);
- }
-
-
- if (updateInProgress) {
- synchronized(partitions) {
- if (updatePartitions != null) {
- for (Iterator i = updatePartitions.iterator(); i.hasNext(); ) {
- PendingPartition pp = (PendingPartition) i.next();
- if (pp == consoleClosedPartition) {
- continue;
- }
-
- int ppLen = pp.text.length();
- if (lastPartition != null && lastPartition.getStream() == pp.stream) {
- int len = lastPartition.getLength();
- lastPartition.setLength(len + ppLen);
- } else {
- ConsolePartition partition = new ConsolePartition(pp.stream, ppLen);
- partition.setOffset(firstOffset);
- lastPartition = partition;
- partitions.add(partition);
- }
- firstOffset += ppLen;
- }
- }
- }
- } else {// user input.
- int amountDeleted = event.getLength() ;
-
- if (amountDeleted > 0) {
- int offset = event.fOffset;
- ConsolePartition partition = (ConsolePartition) getPartition(offset);
- if(partition == lastPartition) {
- partition.delete(event.fOffset-partition.getOffset(), amountDeleted);
- }
- }
-
- synchronized(partitions) {
- if (lastPartition == null || lastPartition.isReadOnly()) {
- lastPartition = new ConsolePartition(inputStream, event.fText);
- lastPartition.setOffset(event.fOffset);
- partitions.add(lastPartition);
- inputPartitions.add(lastPartition);
- } else {
- lastPartition.insert(event.fText, (event.fOffset-lastPartition.getOffset()));
- }
-
- int lastLineDelimiter = -1;
- String partitionText = lastPartition.getString();
- lastLineDelimiter = partitionText.length();
-// for (int i = 0; i < lld.length; i++) {
-// String ld = lld[i];
-// int index = partitionText.lastIndexOf(ld);
-// if (index != -1) {
-// index += ld.length();
-// }
-// if (index > lastLineDelimiter) {
-// lastLineDelimiter = index;
-// }
-// }
- if (lastLineDelimiter != -1) {
- StringBuffer input = new StringBuffer();
- Iterator it = inputPartitions.iterator();
- while (it.hasNext()) {
- ConsolePartition partition = (ConsolePartition) it.next();
- if (partition.getOffset() + partition.getLength() <= event.fOffset + lastLineDelimiter) {
- if (partition == lastPartition) {
- lastPartition = null;
- }
- input.append(partition.getString());
- partition.clearBuffer();
- partition.setReadOnly();
- it.remove();
- } else {
- //create a new partition containing everything up to the line delimiter
- //and append that to the string buffer.
- String contentBefore = partitionText.substring(0, lastLineDelimiter);
- ConsolePartition newPartition = new ConsolePartition(inputStream, contentBefore);
- newPartition.setOffset(partition.getOffset());
- newPartition.setReadOnly();
- newPartition.clearBuffer();
- int index = partitions.indexOf(partition);
- partitions.add(index, newPartition);
- input.append(contentBefore);
- //delete everything that has been appended to the buffer.
- partition.delete(0, lastLineDelimiter);
- partition.setOffset(lastLineDelimiter + partition.getOffset());
- lastLineDelimiter = 0;
- }
- }
- if (input.length() > 0) {
- System.out.println("append text not!");
- //inputStream.appendData(input.toString());
- }
- }
- }
- }
-
- return new Region(event.fOffset, event.fText.length());
+ @Override
+ public ITypedRegion getPartition(int offset) {
+ // TODO Auto-generated method stub
+ return null;
}
-
- private void setUpdateInProgress(boolean b) {
- updateInProgress = b;
- }
-
- /**
- * A stream has been appended, add to pendingPartions list and schedule updateJob.
- * updateJob is scheduled with a slight delay, this allows the console to run the job
- * less frequently and update the document with a greater amount of data each time
- * the job is run
- * @param stream The stream that was written to.
- * @param s The string that should be appended to the document.
- */
- public void streamAppended(ConsoleOutputStream stream, String s) throws IOException {
- System.out.println("streamAppended : " + s);
- if (s.indexOf('\t') != -1) System.out.println("Got a tab!");
- if (document == null) {
- throw new IOException("Document is closed"); //$NON-NLS-1$
- }
- synchronized(pendingPartitions) {
- PendingPartition last = (PendingPartition) (pendingPartitions.size() > 0 ? pendingPartitions.get(pendingPartitions.size()-1) : null);
- if (last != null && last.stream == stream) {
- last.append(s);
- } else {
- pendingPartitions.add(new PendingPartition(stream, s));
- if (fBuffer > 1000) {
- queueJob.schedule();
- } else {
- queueJob.schedule(50);
- }
- }
-
- if (fBuffer > 160000) {
- if(Display.getCurrent() == null){
- try {
- pendingPartitions.wait();
- } catch (InterruptedException e) {
- }
- } else {
- /*
- * if we are in UI thread we cannot lock it, so process
- * queued output.
- */
- processQueue();
- }
- }
- }
- }
-
- /**
- * Holds data until updateJob can be run and the document can be updated.
- */
- private class PendingPartition {
- StringBuffer text = new StringBuffer(8192);
- ConsoleOutputStream stream;
-
- PendingPartition(ConsoleOutputStream stream, String text) {
- this.stream = stream;
- if (text != null) {
- append(text);
- }
- }
-
- void append(String moreText) {
- text.append(moreText);
- fBuffer += moreText.length();
- }
- }
-
- /**
- * Updates the document. Will append everything that is available before
- * finishing.
- */
- private class QueueProcessingJob extends UIJob {
- QueueProcessingJob() {
- super("IOConsole Updater"); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.internal.jobs.InternalJob#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- public IStatus runInUIThread(IProgressMonitor monitor) {
- processQueue();
- return Status.OK_STATUS;
- }
-
- /*
- * Job will process as much as it can each time it's run, but it gets
- * scheduled everytime a PendingPartition is added to the list, meaning
- * that this job could get scheduled unnecessarily in cases of heavy output.
- * Note however, that schedule() will only reschedule a running/scheduled Job
- * once even if it's called many times.
- */
- public boolean shouldRun() {
- boolean shouldRun = connected && pendingPartitions != null && pendingPartitions.size() > 0;
- return shouldRun;
- }
+ @Override
+ public boolean isReadOnly(int offset) {
+ // TODO Auto-generated method stub
+ return false;
}
-
- void processQueue() {
- synchronized (overflowLock) {
- ArrayList pendingCopy = new ArrayList();
- StringBuffer buffer = null;
- boolean consoleClosed = false;
- synchronized(pendingPartitions) {
- pendingCopy.addAll(pendingPartitions);
- pendingPartitions.clear();
- fBuffer = 0;
- pendingPartitions.notifyAll();
- }
- // determine buffer size
- int size = 0;
- for (Iterator i = pendingCopy.iterator(); i.hasNext(); ) {
- PendingPartition pp = (PendingPartition) i.next();
- if (pp != consoleClosedPartition) {
- size+= pp.text.length();
- }
- }
- buffer = new StringBuffer(size);
- for (Iterator i = pendingCopy.iterator(); i.hasNext(); ) {
- PendingPartition pp = (PendingPartition) i.next();
- if (pp != consoleClosedPartition) {
- buffer.append(pp.text);
- } else {
- consoleClosed = true;
- }
- }
- if (connected) {
- setUpdateInProgress(true);
- updatePartitions = pendingCopy;
- firstOffset = document.getLength();
- try {
- if (buffer != null) {
- document.replace(firstOffset, 0, buffer.toString());
- }
- } catch (BadLocationException e) {
- }
- updatePartitions = null;
- setUpdateInProgress(false);
- }
- if (consoleClosed) {
- console.partitionerFinished();
- }
- checkBufferSize();
- }
-
+ @Override
+ public StyleRange[] getStyleRanges(int offset, int length) {
+ // TODO Auto-generated method stub
+ return null;
}
-
- /**
- * Job to trim the console document, runs in the UI thread.
- */
- private class TrimJob extends WorkbenchJob {
-
- /**
- * trims output up to the line containing the given offset,
- * or all output if -1.
- */
- private int truncateOffset;
-
- /**
- * Creates a new job to trim the buffer.
- */
- TrimJob() {
- super("Trim Job"); //$NON-NLS-1$
- setSystem(true);
- }
-
- /**
- * Sets the trim offset.
- *
- * @param offset trims output up to the line containing the given offset
- */
- public void setOffset(int offset) {
- truncateOffset = offset;
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.progress.UIJob#runInUIThread(org.eclipse.core.runtime.IProgressMonitor)
- */
- public IStatus runInUIThread(IProgressMonitor monitor) {
- IJobManager jobManager = Job.getJobManager();
- try {
- jobManager.join(console, monitor);
- } catch (OperationCanceledException e1) {
- return Status.CANCEL_STATUS;
- } catch (InterruptedException e1) {
- return Status.CANCEL_STATUS;
- }
- if (document == null) {
- return Status.OK_STATUS;
- }
-
- int length = document.getLength();
- if (truncateOffset < length) {
- synchronized (overflowLock) {
- try {
- if (truncateOffset < 0) {
- // clear
- setUpdateInProgress(true);
- document.set(""); //$NON-NLS-1$
- setUpdateInProgress(false);
- partitions.clear();
- } else {
- // overflow
- int cutoffLine = document.getLineOfOffset(truncateOffset);
- int cutOffset = document.getLineOffset(cutoffLine);
-
-
- // set the new length of the first partition
- ConsolePartition partition = (ConsolePartition) getPartition(cutOffset);
- partition.setLength(partition.getOffset() + partition.getLength() - cutOffset);
-
- setUpdateInProgress(true);
- document.replace(0, cutOffset, ""); //$NON-NLS-1$
- setUpdateInProgress(false);
-
- //remove partitions and reset Partition offsets
- int index = partitions.indexOf(partition);
- for (int i = 0; i < index; i++) {
- partitions.remove(0);
- }
-
- int offset = 0;
- for (Iterator i = partitions.iterator(); i.hasNext(); ) {
- ConsolePartition p = (ConsolePartition) i.next();
- p.setOffset(offset);
- offset += p.getLength();
- }
- }
- } catch (BadLocationException e) {
- }
- }
- }
- return Status.OK_STATUS;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsoleDocumentPartitioner#isReadOnly(int)
- */
- public boolean isReadOnly(int offset) {
- return ((ConsolePartition)getPartition(offset)).isReadOnly();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsoleDocumentPartitioner#computeStyleRange(int, int)
- */
- public StyleRange[] getStyleRanges(int offset, int length) {
- if (!connected) {
- return new StyleRange[0];
- }
- ConsolePartition[] computedPartitions = (ConsolePartition[])computePartitioning(offset, length);
- StyleRange[] styles = new StyleRange[computedPartitions.length];
- for (int i = 0; i < computedPartitions.length; i++) {
- int rangeStart = Math.max(computedPartitions[i].getOffset(), offset);
- int rangeLength = computedPartitions[i].getLength();
- styles[i] = computedPartitions[i].getStyleRange(rangeStart, rangeLength);
- }
- return styles;
- }
}
Deleted: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/MyPartitioner.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/MyPartitioner.java 2011-02-16 03:04:40 UTC (rev 29165)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/MyPartitioner.java 2011-02-16 09:11:33 UTC (rev 29166)
@@ -1,70 +0,0 @@
-package org.jboss.tools.seam.forge.console;
-
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.ui.console.IConsoleDocumentPartitioner;
-
-public class MyPartitioner implements IConsoleDocumentPartitioner {
-
- @Override
- public void connect(IDocument document) {
- document.setDocumentPartitioner(this);
- }
-
- @Override
- public void disconnect() {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void documentAboutToBeChanged(DocumentEvent event) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public boolean documentChanged(DocumentEvent event) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public String[] getLegalContentTypes() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public String getContentType(int offset) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public ITypedRegion[] computePartitioning(int offset, int length) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public ITypedRegion getPartition(int offset) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public boolean isReadOnly(int offset) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public StyleRange[] getStyleRanges(int offset, int length) {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
Added: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/old/ConsolePartition.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/old/ConsolePartition.java (rev 0)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/old/ConsolePartition.java 2011-02-16 09:11:33 UTC (rev 29166)
@@ -0,0 +1,165 @@
+package org.jboss.tools.seam.forge.old;
+
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.ui.console.ConsolePlugin;
+import org.jboss.tools.seam.forge.console.ConsoleInputStream;
+import org.jboss.tools.seam.forge.console.ConsoleOutputStream;
+
+public class ConsolePartition implements ITypedRegion {
+ public static final String OUTPUT_PARTITION_TYPE = ConsolePlugin.getUniqueIdentifier() + ".io_console_output_partition_type"; //$NON-NLS-1$
+ public static final String INPUT_PARTITION_TYPE = ConsolePlugin.getUniqueIdentifier() + ".io_console_input_partition_type"; //$NON-NLS-1$
+
+ /**
+ * The data contained by this partition.
+ */
+ private StringBuffer buffer;
+ private String type;
+ private int offset;
+ /**
+ * Output partitions are all read only.
+ * Input partitions are read only once they have been appended to the console's input stream.
+ */
+ private boolean readOnly;
+
+ /**
+ * Only one of inputStream or outputStream will be null depending on the partitions type.
+ */
+ private ConsoleOutputStream outputStream;
+ private ConsoleInputStream inputStream;
+ private int length;
+
+ /**
+ * Creates a new partition to contain output to console.
+ */
+ public ConsolePartition(ConsoleOutputStream outputStream, int length) {
+ this.outputStream = outputStream;
+ this.length = length;
+ this.type = OUTPUT_PARTITION_TYPE;
+ this.readOnly = true;
+ }
+
+ /**
+ * Creates a new partition to contain input from a console
+ */
+ public ConsolePartition(ConsoleInputStream inputStream, String text) {
+ this.inputStream = inputStream;
+ buffer = new StringBuffer(text);
+ length = text.length();
+ this.type = INPUT_PARTITION_TYPE;
+ this.readOnly = false;
+ }
+
+ /**
+ * Inserts a string into this partition.
+ * @param s The string to insert
+ * @param offset the offset in the partition
+ */
+ public void insert(String s, int insertOffset) {
+ buffer.insert(insertOffset, s);
+ length += s.length();
+ }
+
+ /**
+ * Deletes data from this partition.
+ * @param delOffset
+ * @param delLength
+ */
+ public void delete(int delOffset, int delLength) {
+ buffer.delete(delOffset, delOffset+delLength);
+ length -= delLength;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.text.ITypedRegion#getType()
+ */
+ public String getType() {
+ return type;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.text.IRegion#getLength()
+ */
+ public int getLength() {
+ return length;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.text.IRegion#getOffset()
+ */
+ public int getOffset() {
+ return offset;
+ }
+
+ /**
+ * Sets this partitions offset in the document.
+ *
+ * @param offset This partitions offset in the document.
+ */
+ public void setOffset(int offset) {
+ this.offset = offset;
+ }
+
+ /**
+ * Sets this partition's length.
+ *
+ * @param length
+ */
+ public void setLength(int length) {
+ this.length = length;
+ }
+
+ /**
+ * Returns the data contained in this partition.
+ * @return The data contained in this partition.
+ */
+ public String getString() {
+ return buffer.toString();
+ }
+
+ /**
+ * Returns a StyleRange object which may be used for setting the style
+ * of this partition in a viewer.
+ */
+ public StyleRange getStyleRange(int rangeOffset, int rangeLength) {
+ return new StyleRange(rangeOffset, rangeLength, null, null);
+ }
+
+ /**
+ * Returns if this partition is read-only.
+ *
+ * @see org.eclipse.ui.console.IConsoleDocumentPartitioner#isReadOnly(int)
+ * @return if this partition is read-only
+ */
+ public boolean isReadOnly() {
+ return readOnly;
+ }
+
+ /**
+ * Sets the read-only state of this partition to <code>true</code>.
+ *
+ * @see org.eclipse.ui.console.IConsoleDocumentPartitioner#isReadOnly(int)
+ */
+ public void setReadOnly() {
+ readOnly = true;
+ }
+
+ /**
+ * Clears the contents of the buffer
+ */
+ public void clearBuffer() {
+ buffer.setLength(0);
+ }
+
+ /**
+ * Returns the underlying output stream
+ *
+ * @return the underlying output stream
+ */
+ ConsoleOutputStream getStream() {
+ return outputStream;
+ }
+}
Property changes on: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/old/ConsolePartition.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/old/ConsolePartitioner.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/old/ConsolePartitioner.java (rev 0)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/old/ConsolePartitioner.java 2011-02-16 09:11:33 UTC (rev 29166)
@@ -0,0 +1,695 @@
+package org.jboss.tools.seam.forge.old;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.IJobManager;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.DocumentEvent;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentPartitionerExtension;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.Region;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.console.ConsolePlugin;
+import org.eclipse.ui.console.IConsoleDocumentPartitioner;
+import org.eclipse.ui.progress.UIJob;
+import org.eclipse.ui.progress.WorkbenchJob;
+import org.jboss.tools.seam.forge.console.Console;
+import org.jboss.tools.seam.forge.console.ConsoleInputStream;
+import org.jboss.tools.seam.forge.console.ConsoleOutputStream;
+
+/**
+ * Partitions an IOConsole's document
+ * @since 3.1
+ *
+ */
+public class ConsolePartitioner implements IConsoleDocumentPartitioner, IDocumentPartitionerExtension {
+
+ private PendingPartition consoleClosedPartition;
+ private IDocument document;
+ private ArrayList partitions;
+ /**
+ * Blocks of data that have not yet been appended to the document.
+ */
+ private ArrayList pendingPartitions;
+ /**
+ * A list of PendingPartitions to be appended by the updateJob
+ */
+ private ArrayList updatePartitions;
+ /**
+ * The last partition appended to the document
+ */
+ private ConsolePartition lastPartition;
+ /**
+ * Job that appends pending partitions to the document.
+ */
+ private QueueProcessingJob queueJob;
+ /**
+ * The input stream attached to this document.
+ */
+ private ConsoleInputStream inputStream;
+ /**
+ * Flag to indicate that the updateJob is updating the document.
+ */
+ private boolean updateInProgress;
+ /**
+ * A list of partitions containing input from the console, that have
+ * not been appended to the input stream yet.
+ */
+ private ArrayList inputPartitions;
+ /**
+ * offset used by updateJob
+ */
+ private int firstOffset;
+ /**
+ * An array of legal line delimiters
+ */
+ private String[] lld;
+ private int highWaterMark = -1;
+ private int lowWaterMark = -1;
+ private boolean connected = false;
+
+ private Console console;
+
+ private TrimJob trimJob = new TrimJob();
+ /**
+ * Lock for appending to and removing from the document - used
+ * to synchronize addition of new text/partitions in the update
+ * job and handling buffer overflow/clearing of the console.
+ */
+ private Object overflowLock = new Object();
+
+
+ private int fBuffer;
+
+ private ConsolePartitioner(ConsoleInputStream inputStream, Console console) {
+ this.inputStream = inputStream;
+ this.console = console;
+ trimJob.setRule(console.getSchedulingRule());
+ }
+
+ public IDocument getDocument() {
+ return document;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocumentPartitioner#connect(org.eclipse.jface.text.IDocument)
+ */
+ public void connect(IDocument doc) {
+ document = doc;
+ document.setDocumentPartitioner(this);
+ lld = document.getLegalLineDelimiters();
+ partitions = new ArrayList();
+ pendingPartitions = new ArrayList();
+ inputPartitions = new ArrayList();
+ queueJob = new QueueProcessingJob();
+ queueJob.setSystem(true);
+ queueJob.setPriority(Job.INTERACTIVE);
+ queueJob.setRule(console.getSchedulingRule());
+ connected = true;
+ }
+
+ public int getHighWaterMark() {
+ return highWaterMark;
+ }
+
+ public int getLowWaterMark() {
+ return lowWaterMark;
+ }
+
+ public void setWaterMarks(int low, int high) {
+ lowWaterMark = low;
+ highWaterMark = high;
+ ConsolePlugin.getStandardDisplay().asyncExec(new Runnable() {
+ public void run() {
+ checkBufferSize();
+ }
+ });
+ }
+
+ /**
+ * Notification from the console that all of its streams have been closed.
+ */
+ public void streamsClosed() {
+ consoleClosedPartition = new PendingPartition(null, null);
+ synchronized (pendingPartitions) {
+ pendingPartitions.add(consoleClosedPartition);
+ }
+ queueJob.schedule(); //ensure that all pending partitions are processed.
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocumentPartitioner#disconnect()
+ */
+ public void disconnect() {
+ synchronized (overflowLock) {
+ document = null;
+ partitions.clear();
+ connected = false;
+ try {
+ inputStream.close();
+ } catch (IOException e) {
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocumentPartitioner#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
+ */
+ public void documentAboutToBeChanged(DocumentEvent event) {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocumentPartitioner#documentChanged(org.eclipse.jface.text.DocumentEvent)
+ */
+ public boolean documentChanged(DocumentEvent event) {
+ return documentChanged2(event) != null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocumentPartitioner#getLegalContentTypes()
+ */
+ public String[] getLegalContentTypes() {
+ return new String[] { ConsolePartition.OUTPUT_PARTITION_TYPE, ConsolePartition.INPUT_PARTITION_TYPE };
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocumentPartitioner#getContentType(int)
+ */
+ public String getContentType(int offset) {
+ return getPartition(offset).getType();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocumentPartitioner#computePartitioning(int, int)
+ */
+ public ITypedRegion[] computePartitioning(int offset, int length) {
+ int rangeEnd = offset + length;
+ int left= 0;
+ int right= partitions.size() - 1;
+ int mid= 0;
+ ConsolePartition position= null;
+
+ if (left == right) {
+ return new ConsolePartition[]{(ConsolePartition) partitions.get(0)};
+ }
+ while (left < right) {
+
+ mid= (left + right) / 2;
+
+ position= (ConsolePartition) partitions.get(mid);
+ if (rangeEnd < position.getOffset()) {
+ if (left == mid)
+ right= left;
+ else
+ right= mid -1;
+ } else if (offset > (position.getOffset() + position.getLength() - 1)) {
+ if (right == mid)
+ left= right;
+ else
+ left= mid +1;
+ } else {
+ left= right= mid;
+ }
+ }
+
+
+ List list = new ArrayList();
+ int index = left - 1;
+ if (index >= 0) {
+ position= (ConsolePartition) partitions.get(index);
+ while (index >= 0 && (position.getOffset() + position.getLength()) > offset) {
+ index--;
+ if (index >= 0) {
+ position= (ConsolePartition) partitions.get(index);
+ }
+ }
+ }
+ index++;
+ position= (ConsolePartition) partitions.get(index);
+ while (index < partitions.size() && (position.getOffset() < rangeEnd)) {
+ list.add(position);
+ index++;
+ if (index < partitions.size()) {
+ position= (ConsolePartition) partitions.get(index);
+ }
+ }
+
+ return (ITypedRegion[]) list.toArray(new ConsolePartition[list.size()]);
+ }
+
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocumentPartitioner#getPartition(int)
+ */
+ public ITypedRegion getPartition(int offset) {
+ for (int i = 0; i < partitions.size(); i++) {
+ ITypedRegion partition = (ITypedRegion) partitions.get(i);
+ int start = partition.getOffset();
+ int end = start + partition.getLength();
+ if (offset >= start && offset < end) {
+ return partition;
+ }
+ }
+
+ if (lastPartition == null) {
+ synchronized(partitions) {
+ lastPartition = new ConsolePartition(inputStream, ""); //$NON-NLS-1$
+ lastPartition.setOffset(offset);
+ partitions.add(lastPartition);
+ inputPartitions.add(lastPartition);
+ }
+ }
+ return lastPartition;
+ }
+
+ /**
+ * Enforces the buffer size.
+ * When the number of lines in the document exceeds the high water mark, the
+ * beginning of the document is trimmed until the number of lines equals the
+ * low water mark.
+ */
+ private void checkBufferSize() {
+ if (document != null && highWaterMark > 0) {
+ int length = document.getLength();
+ if (length > highWaterMark) {
+ if (trimJob.getState() == Job.NONE) { //if the job isn't already running
+ trimJob.setOffset(length - lowWaterMark);
+ trimJob.schedule();
+ }
+ }
+ }
+ }
+
+ /**
+ * Clears the console
+ */
+ public void clearBuffer() {
+ synchronized (overflowLock) {
+ trimJob.setOffset(-1);
+ trimJob.schedule();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.text.IDocumentPartitionerExtension#documentChanged2(org.eclipse.jface.text.DocumentEvent)
+ */
+ public IRegion documentChanged2(DocumentEvent event) {
+ System.out.println("documentChanged2 : " + event.fText);
+ if (document == null) {
+ return null; //another thread disconnected the partitioner
+ }
+ if (document.getLength() == 0) { //document cleared
+ if (lastPartition != null && lastPartition.getType().equals(ConsolePartition.INPUT_PARTITION_TYPE)) {
+ synchronized (partitions) {
+ partitions.remove(lastPartition);
+ inputPartitions.remove(lastPartition);
+ }
+ }
+ lastPartition = null;
+ return new Region(0, 0);
+ }
+
+
+ if (updateInProgress) {
+ synchronized(partitions) {
+ if (updatePartitions != null) {
+ for (Iterator i = updatePartitions.iterator(); i.hasNext(); ) {
+ PendingPartition pp = (PendingPartition) i.next();
+ if (pp == consoleClosedPartition) {
+ continue;
+ }
+
+ int ppLen = pp.text.length();
+ if (lastPartition != null && lastPartition.getStream() == pp.stream) {
+ int len = lastPartition.getLength();
+ lastPartition.setLength(len + ppLen);
+ } else {
+ ConsolePartition partition = new ConsolePartition(pp.stream, ppLen);
+ partition.setOffset(firstOffset);
+ lastPartition = partition;
+ partitions.add(partition);
+ }
+ firstOffset += ppLen;
+ }
+ }
+ }
+ } else {// user input.
+ int amountDeleted = event.getLength() ;
+
+ if (amountDeleted > 0) {
+ int offset = event.fOffset;
+ ConsolePartition partition = (ConsolePartition) getPartition(offset);
+ if(partition == lastPartition) {
+ partition.delete(event.fOffset-partition.getOffset(), amountDeleted);
+ }
+ }
+
+ synchronized(partitions) {
+ if (lastPartition == null || lastPartition.isReadOnly()) {
+ lastPartition = new ConsolePartition(inputStream, event.fText);
+ lastPartition.setOffset(event.fOffset);
+ partitions.add(lastPartition);
+ inputPartitions.add(lastPartition);
+ } else {
+ lastPartition.insert(event.fText, (event.fOffset-lastPartition.getOffset()));
+ }
+
+ int lastLineDelimiter = -1;
+ String partitionText = lastPartition.getString();
+ lastLineDelimiter = partitionText.length();
+// for (int i = 0; i < lld.length; i++) {
+// String ld = lld[i];
+// int index = partitionText.lastIndexOf(ld);
+// if (index != -1) {
+// index += ld.length();
+// }
+// if (index > lastLineDelimiter) {
+// lastLineDelimiter = index;
+// }
+// }
+ if (lastLineDelimiter != -1) {
+ StringBuffer input = new StringBuffer();
+ Iterator it = inputPartitions.iterator();
+ while (it.hasNext()) {
+ ConsolePartition partition = (ConsolePartition) it.next();
+ if (partition.getOffset() + partition.getLength() <= event.fOffset + lastLineDelimiter) {
+ if (partition == lastPartition) {
+ lastPartition = null;
+ }
+ input.append(partition.getString());
+ partition.clearBuffer();
+ partition.setReadOnly();
+ it.remove();
+ } else {
+ //create a new partition containing everything up to the line delimiter
+ //and append that to the string buffer.
+ String contentBefore = partitionText.substring(0, lastLineDelimiter);
+ ConsolePartition newPartition = new ConsolePartition(inputStream, contentBefore);
+ newPartition.setOffset(partition.getOffset());
+ newPartition.setReadOnly();
+ newPartition.clearBuffer();
+ int index = partitions.indexOf(partition);
+ partitions.add(index, newPartition);
+ input.append(contentBefore);
+ //delete everything that has been appended to the buffer.
+ partition.delete(0, lastLineDelimiter);
+ partition.setOffset(lastLineDelimiter + partition.getOffset());
+ lastLineDelimiter = 0;
+ }
+ }
+ if (input.length() > 0) {
+ System.out.println("append text not!");
+ //inputStream.appendData(input.toString());
+ }
+
+ }
+ }
+ }
+
+ return new Region(event.fOffset, event.fText.length());
+ }
+
+ private void setUpdateInProgress(boolean b) {
+ updateInProgress = b;
+ }
+
+ /**
+ * A stream has been appended, add to pendingPartions list and schedule updateJob.
+ * updateJob is scheduled with a slight delay, this allows the console to run the job
+ * less frequently and update the document with a greater amount of data each time
+ * the job is run
+ * @param stream The stream that was written to.
+ * @param s The string that should be appended to the document.
+ */
+ public void streamAppended(ConsoleOutputStream stream, String s) throws IOException {
+ System.out.println("streamAppended : " + s);
+ if (s.indexOf('\t') != -1) System.out.println("Got a tab!");
+ if (document == null) {
+ throw new IOException("Document is closed"); //$NON-NLS-1$
+ }
+ synchronized(pendingPartitions) {
+ PendingPartition last = (PendingPartition) (pendingPartitions.size() > 0 ? pendingPartitions.get(pendingPartitions.size()-1) : null);
+ if (last != null && last.stream == stream) {
+ last.append(s);
+ } else {
+ pendingPartitions.add(new PendingPartition(stream, s));
+ if (fBuffer > 1000) {
+ queueJob.schedule();
+ } else {
+ queueJob.schedule(50);
+ }
+ }
+
+ if (fBuffer > 160000) {
+ if(Display.getCurrent() == null){
+ try {
+ pendingPartitions.wait();
+ } catch (InterruptedException e) {
+ }
+ } else {
+ /*
+ * if we are in UI thread we cannot lock it, so process
+ * queued output.
+ */
+ processQueue();
+ }
+ }
+ }
+ }
+
+ /**
+ * Holds data until updateJob can be run and the document can be updated.
+ */
+ private class PendingPartition {
+ StringBuffer text = new StringBuffer(8192);
+ ConsoleOutputStream stream;
+
+ PendingPartition(ConsoleOutputStream stream, String text) {
+ this.stream = stream;
+ if (text != null) {
+ append(text);
+ }
+ }
+
+ void append(String moreText) {
+ text.append(moreText);
+ fBuffer += moreText.length();
+ }
+ }
+
+ /**
+ * Updates the document. Will append everything that is available before
+ * finishing.
+ */
+ private class QueueProcessingJob extends UIJob {
+
+ QueueProcessingJob() {
+ super("IOConsole Updater"); //$NON-NLS-1$
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.internal.jobs.InternalJob#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ processQueue();
+ return Status.OK_STATUS;
+ }
+
+ /*
+ * Job will process as much as it can each time it's run, but it gets
+ * scheduled everytime a PendingPartition is added to the list, meaning
+ * that this job could get scheduled unnecessarily in cases of heavy output.
+ * Note however, that schedule() will only reschedule a running/scheduled Job
+ * once even if it's called many times.
+ */
+ public boolean shouldRun() {
+ boolean shouldRun = connected && pendingPartitions != null && pendingPartitions.size() > 0;
+ return shouldRun;
+ }
+ }
+
+ void processQueue() {
+ synchronized (overflowLock) {
+ ArrayList pendingCopy = new ArrayList();
+ StringBuffer buffer = null;
+ boolean consoleClosed = false;
+ synchronized(pendingPartitions) {
+ pendingCopy.addAll(pendingPartitions);
+ pendingPartitions.clear();
+ fBuffer = 0;
+ pendingPartitions.notifyAll();
+ }
+ // determine buffer size
+ int size = 0;
+ for (Iterator i = pendingCopy.iterator(); i.hasNext(); ) {
+ PendingPartition pp = (PendingPartition) i.next();
+ if (pp != consoleClosedPartition) {
+ size+= pp.text.length();
+ }
+ }
+ buffer = new StringBuffer(size);
+ for (Iterator i = pendingCopy.iterator(); i.hasNext(); ) {
+ PendingPartition pp = (PendingPartition) i.next();
+ if (pp != consoleClosedPartition) {
+ buffer.append(pp.text);
+ } else {
+ consoleClosed = true;
+ }
+ }
+
+ if (connected) {
+ setUpdateInProgress(true);
+ updatePartitions = pendingCopy;
+ firstOffset = document.getLength();
+ try {
+ if (buffer != null) {
+ document.replace(firstOffset, 0, buffer.toString());
+ }
+ } catch (BadLocationException e) {
+ }
+ updatePartitions = null;
+ setUpdateInProgress(false);
+ }
+ if (consoleClosed) {
+ console.partitionerFinished();
+ }
+ checkBufferSize();
+ }
+
+ }
+
+ /**
+ * Job to trim the console document, runs in the UI thread.
+ */
+ private class TrimJob extends WorkbenchJob {
+
+ /**
+ * trims output up to the line containing the given offset,
+ * or all output if -1.
+ */
+ private int truncateOffset;
+
+ /**
+ * Creates a new job to trim the buffer.
+ */
+ TrimJob() {
+ super("Trim Job"); //$NON-NLS-1$
+ setSystem(true);
+ }
+
+ /**
+ * Sets the trim offset.
+ *
+ * @param offset trims output up to the line containing the given offset
+ */
+ public void setOffset(int offset) {
+ truncateOffset = offset;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.progress.UIJob#runInUIThread(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ IJobManager jobManager = Job.getJobManager();
+ try {
+ jobManager.join(console, monitor);
+ } catch (OperationCanceledException e1) {
+ return Status.CANCEL_STATUS;
+ } catch (InterruptedException e1) {
+ return Status.CANCEL_STATUS;
+ }
+ if (document == null) {
+ return Status.OK_STATUS;
+ }
+
+ int length = document.getLength();
+ if (truncateOffset < length) {
+ synchronized (overflowLock) {
+ try {
+ if (truncateOffset < 0) {
+ // clear
+ setUpdateInProgress(true);
+ document.set(""); //$NON-NLS-1$
+ setUpdateInProgress(false);
+ partitions.clear();
+ } else {
+ // overflow
+ int cutoffLine = document.getLineOfOffset(truncateOffset);
+ int cutOffset = document.getLineOffset(cutoffLine);
+
+
+ // set the new length of the first partition
+ ConsolePartition partition = (ConsolePartition) getPartition(cutOffset);
+ partition.setLength(partition.getOffset() + partition.getLength() - cutOffset);
+
+ setUpdateInProgress(true);
+ document.replace(0, cutOffset, ""); //$NON-NLS-1$
+ setUpdateInProgress(false);
+
+ //remove partitions and reset Partition offsets
+ int index = partitions.indexOf(partition);
+ for (int i = 0; i < index; i++) {
+ partitions.remove(0);
+ }
+
+ int offset = 0;
+ for (Iterator i = partitions.iterator(); i.hasNext(); ) {
+ ConsolePartition p = (ConsolePartition) i.next();
+ p.setOffset(offset);
+ offset += p.getLength();
+ }
+ }
+ } catch (BadLocationException e) {
+ }
+ }
+ }
+ return Status.OK_STATUS;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.console.IConsoleDocumentPartitioner#isReadOnly(int)
+ */
+ public boolean isReadOnly(int offset) {
+ return ((ConsolePartition)getPartition(offset)).isReadOnly();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.console.IConsoleDocumentPartitioner#computeStyleRange(int, int)
+ */
+ public StyleRange[] getStyleRanges(int offset, int length) {
+ if (!connected) {
+ return new StyleRange[0];
+ }
+ ConsolePartition[] computedPartitions = (ConsolePartition[])computePartitioning(offset, length);
+ StyleRange[] styles = new StyleRange[computedPartitions.length];
+ for (int i = 0; i < computedPartitions.length; i++) {
+ int rangeStart = Math.max(computedPartitions[i].getOffset(), offset);
+ int rangeLength = computedPartitions[i].getLength();
+ styles[i] = computedPartitions[i].getStyleRange(rangeStart, rangeLength);
+ }
+ return styles;
+ }
+}
Property changes on: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/old/ConsolePartitioner.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 10 months
JBoss Tools SVN: r29165 - in trunk/documentation/guides/GettingStartedGuide/en-US: images/getting_started and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mcaspers
Date: 2011-02-15 22:04:40 -0500 (Tue, 15 Feb 2011)
New Revision: 29165
Modified:
trunk/documentation/guides/GettingStartedGuide/en-US/Book_Info.xml
trunk/documentation/guides/GettingStartedGuide/en-US/images/getting_started/getting_started_1.png
trunk/documentation/guides/GettingStartedGuide/en-US/images/getting_started/getting_started_2.png
trunk/documentation/guides/GettingStartedGuide/en-US/images/getting_started/getting_started_3.png
trunk/documentation/guides/GettingStartedGuide/en-US/images/getting_started/getting_started_4.png
Log:
updated images in installation procedure
Modified: trunk/documentation/guides/GettingStartedGuide/en-US/Book_Info.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en-US/Book_Info.xml 2011-02-15 22:00:59 UTC (rev 29164)
+++ trunk/documentation/guides/GettingStartedGuide/en-US/Book_Info.xml 2011-02-16 03:04:40 UTC (rev 29165)
@@ -1,6 +1,7 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE Book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
+
<bookinfo>
<title>Getting Started Guide</title>
<subtitle>Provides information on how the JBoss Developer Studio functions.</subtitle>
Modified: trunk/documentation/guides/GettingStartedGuide/en-US/images/getting_started/getting_started_1.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/guides/GettingStartedGuide/en-US/images/getting_started/getting_started_2.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/guides/GettingStartedGuide/en-US/images/getting_started/getting_started_3.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/guides/GettingStartedGuide/en-US/images/getting_started/getting_started_4.png
===================================================================
(Binary files differ)
13 years, 10 months
JBoss Tools SVN: r29164 - trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-02-15 17:00:59 -0500 (Tue, 15 Feb 2011)
New Revision: 29164
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeUIActivator.java
Log:
JBIDE-8419 Runtimes aren't visible immediately after adding via JBT Runtime Detection
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeUIActivator.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeUIActivator.java 2011-02-15 21:46:09 UTC (rev 29163)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/RuntimeUIActivator.java 2011-02-15 22:00:59 UTC (rev 29164)
@@ -37,6 +37,7 @@
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
@@ -250,10 +251,16 @@
}
public static void refreshPreferencePage(Shell shell) {
+ Shell mainShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
if (shell != null && !shell.isDisposed()) {
shell.close();
+ } else {
+ shell = Display.getCurrent().getActiveShell();
+ if (shell != mainShell) {
+ shell.close();
+ }
}
- shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ shell = mainShell;
PreferenceDialog preferenceDialog = PreferencesUtil.createPreferenceDialogOn(shell, RuntimePreferencePage.ID, null, null);
preferenceDialog.open();
}
13 years, 10 months
JBoss Tools SVN: r29163 - in trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge: view and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-02-15 16:46:09 -0500 (Tue, 15 Feb 2011)
New Revision: 29163
Added:
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/MyPartitioner.java
Modified:
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/Console.java
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/ConsoleOutputStream.java
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/ConsolePartitioner.java
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/view/ConsoleText.java
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/view/ConsoleViewer.java
Log:
tab completion and backspace are working
Modified: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/Console.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/Console.java 2011-02-15 21:09:03 UTC (rev 29162)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/Console.java 2011-02-15 21:46:09 UTC (rev 29163)
@@ -8,6 +8,8 @@
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.core.model.IStreamMonitor;
import org.eclipse.debug.core.model.IStreamsProxy;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.console.IConsoleDocumentPartitioner;
import org.eclipse.ui.console.IConsoleView;
import org.eclipse.ui.console.TextConsole;
@@ -15,7 +17,7 @@
public class Console extends TextConsole implements IDebugEventSetListener {
- private ConsolePartitioner partitioner;
+ private MyPartitioner partitioner;
private ConsoleInputStream inputStream;
private ConsoleOutputStream outputStream;
private IProcess process = null;
@@ -36,7 +38,7 @@
}
private void initOutputStream() {
- outputStream = new ConsoleOutputStream(partitioner);
+ outputStream = new ConsoleOutputStream(this);
IStreamMonitor streamMonitor = getOutputStreamMonitor();
if (streamMonitor != null) {
synchronized(streamMonitor) {
@@ -62,7 +64,7 @@
}
private void initPartitioner() {
- partitioner = new ConsolePartitioner(inputStream, this);
+ partitioner = new MyPartitioner();
partitioner.connect(getDocument());
}
@@ -90,7 +92,7 @@
try {
inputStream.close();
outputStream.close();
- partitioner.streamsClosed();
+// partitioner.streamsClosed();
} catch (IOException e) {}
}
@@ -128,5 +130,22 @@
DebugPlugin.getDefault().addDebugEventListener(this);
}
}
+
+ public void appendString(final String str) {
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ for (int i = 0; i < str.length(); i++) {
+ if (str.charAt(i) == '\b') {
+ getDocument().replace(getDocument().getLength() - 1, 1, "");
+ } else {
+ getDocument().replace(getDocument().getLength(), 0, str.substring(i, i + 1));
+ }
+ }
+ } catch (BadLocationException e) {}
+ }
+ });
+ }
}
Modified: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/ConsoleOutputStream.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/ConsoleOutputStream.java 2011-02-15 21:09:03 UTC (rev 29162)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/ConsoleOutputStream.java 2011-02-15 21:46:09 UTC (rev 29163)
@@ -6,10 +6,10 @@
public class ConsoleOutputStream extends OutputStream {
private boolean closed = false;
- private ConsolePartitioner partitioner;
+ private Console console;
- ConsoleOutputStream(ConsolePartitioner partitioner) {
- this.partitioner = partitioner;
+ ConsoleOutputStream(Console console) {
+ this.console = console;
}
public synchronized boolean isClosed() {
@@ -21,7 +21,7 @@
throw new IOException("Output Stream is closed");
}
closed = true;
- partitioner = null;
+ console = null;
}
public void flush() throws IOException {
@@ -34,7 +34,7 @@
if(closed) {
throw new IOException("Output Stream is closed");
}
- notifyParitioner(new String(b, off, len));
+ notifyPartitioner(new String(b, off, len));
}
public void write(byte[] b) throws IOException {
@@ -49,18 +49,11 @@
if(closed) {
throw new IOException("Output Stream is closed");
}
- notifyParitioner(str);
+ notifyPartitioner(str);
}
- private void notifyParitioner(String str) throws IOException {
- try {
- partitioner.streamAppended(this, str);
- } catch (IOException e) {
- if (!closed) {
- close();
- }
- throw e;
- }
+ private void notifyPartitioner(String str) throws IOException {
+ console.appendString(str);
}
}
Modified: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/ConsolePartitioner.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/ConsolePartitioner.java 2011-02-15 21:09:03 UTC (rev 29162)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/ConsolePartitioner.java 2011-02-15 21:46:09 UTC (rev 29163)
@@ -89,7 +89,7 @@
private int fBuffer;
- public ConsolePartitioner(ConsoleInputStream inputStream, Console console) {
+ private ConsolePartitioner(ConsoleInputStream inputStream, Console console) {
this.inputStream = inputStream;
this.console = console;
trimJob.setRule(console.getSchedulingRule());
Added: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/MyPartitioner.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/MyPartitioner.java (rev 0)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/MyPartitioner.java 2011-02-15 21:46:09 UTC (rev 29163)
@@ -0,0 +1,70 @@
+package org.jboss.tools.seam.forge.console;
+
+import org.eclipse.jface.text.DocumentEvent;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.ui.console.IConsoleDocumentPartitioner;
+
+public class MyPartitioner implements IConsoleDocumentPartitioner {
+
+ @Override
+ public void connect(IDocument document) {
+ document.setDocumentPartitioner(this);
+ }
+
+ @Override
+ public void disconnect() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void documentAboutToBeChanged(DocumentEvent event) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public boolean documentChanged(DocumentEvent event) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public String[] getLegalContentTypes() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getContentType(int offset) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ITypedRegion[] computePartitioning(int offset, int length) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ITypedRegion getPartition(int offset) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean isReadOnly(int offset) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public StyleRange[] getStyleRanges(int offset, int length) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Property changes on: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/MyPartitioner.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/view/ConsoleText.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/view/ConsoleText.java 2011-02-15 21:09:03 UTC (rev 29162)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/view/ConsoleText.java 2011-02-15 21:46:09 UTC (rev 29163)
@@ -13,29 +13,28 @@
public void invokeAction(int action) {
checkWidget();
switch (action) {
- // Navigation
case ST.LINE_UP:
doLineUp();
break;
case ST.LINE_DOWN:
doLineDown();
break;
- case ST.DELETE_PREVIOUS:
- doDeletePrevious();
- break;
+// case ST.DELETE_PREVIOUS:
+// doDeletePrevious();
+// break;
default:
super.invokeAction(action);
}
}
private void doLineUp() {
- System.out.println("Line up");
+// System.out.println("Line up");
}
private void doLineDown() {
- System.out.println("Line down");
+// System.out.println("Line down");
}
- private void doDeletePrevious() {
- System.out.println("Backspace");
- }
+// private void doDeletePrevious() {
+// System.out.println("Backspace");
+// }
}
Modified: trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/view/ConsoleViewer.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/view/ConsoleViewer.java 2011-02-15 21:09:03 UTC (rev 29162)
+++ trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/view/ConsoleViewer.java 2011-02-15 21:46:09 UTC (rev 29163)
@@ -15,8 +15,8 @@
public class ConsoleViewer extends TextConsoleViewer {
private static String BACKSPACE = new String(new byte[] {'\b'});
- private static String UP_ARROW = new String(new byte[] { 0x1b, 0x5b, 0x41 });
- private static String DOWN_ARROW = new String(new byte[] { 0x1b, 0x5b, 0x42 });
+// private static String UP_ARROW = new String(new byte[] { 0x1b, 0x5b, 0x41 });
+// private static String DOWN_ARROW = new String(new byte[] { 0x1b, 0x5b, 0x42 });
private Console console = null;
@@ -32,17 +32,16 @@
}
private void handleBackspace() {
- System.out.println("handle backspace");
-// console.getInputStream().appendData(BACKSPACE);
+ console.getInputStream().appendData(BACKSPACE);
}
private void handleArrowUp() {
- System.out.println("handle arrow up");
+// System.out.println("handle arrow up");
// console.getInputStream().appendData(UP_ARROW);
}
private void handleArrowDown() {
- System.out.println("handle arrow down");
+// System.out.println("handle arrow down");
// console.getInputStream().appendData(DOWN_ARROW);
}
13 years, 10 months
JBoss Tools SVN: r29162 - trunk/documentation/guides/JBDS_Release_Notes/en-US.
by jbosstools-commits@lists.jboss.org
Author: mcaspers
Date: 2011-02-15 16:09:03 -0500 (Tue, 15 Feb 2011)
New Revision: 29162
Modified:
trunk/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml
trunk/documentation/guides/JBDS_Release_Notes/en-US/Known_Issues_4_0_0.xml
trunk/documentation/guides/JBDS_Release_Notes/en-US/Revision_History.xml
Log:
General Documentation Updates
Modified: trunk/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml
===================================================================
--- trunk/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml 2011-02-15 18:24:49 UTC (rev 29161)
+++ trunk/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml 2011-02-15 21:09:03 UTC (rev 29162)
@@ -9,7 +9,7 @@
<productname>JBoss Developer Studio</productname>
<productnumber>4.0</productnumber>
<edition>0</edition>
- <pubsnumber>17</pubsnumber>
+ <pubsnumber>18</pubsnumber>
<abstract>
<para>
These release notes contain important information related to the JBoss Developer Studio. New features,<!-- known problems,--> resources, and other current issues are addressed here.
Modified: trunk/documentation/guides/JBDS_Release_Notes/en-US/Known_Issues_4_0_0.xml
===================================================================
--- trunk/documentation/guides/JBDS_Release_Notes/en-US/Known_Issues_4_0_0.xml 2011-02-15 18:24:49 UTC (rev 29161)
+++ trunk/documentation/guides/JBDS_Release_Notes/en-US/Known_Issues_4_0_0.xml 2011-02-15 21:09:03 UTC (rev 29162)
@@ -22,7 +22,7 @@
</listitem>
<listitem>
<para>
- <ulink url="https://issues.jboss.org/browse/JBDS-1554">JBDS-1554</ulink>: The new project wizards do not display their associated Eclipse perspective.
+ <ulink url="https://issues.jboss.org/browse/JBDS-1554">JBDS-1554</ulink>: The new project wizards do not display their associated Eclipse perspective. The workaround is to manually display the appropiate perspective by selecting <menuchoice><guimenuitem>Window</guimenuitem><guimenuitem>Open Perspective</guimenuitem></menuchoice>.
</para>
</listitem>
<listitem>
Modified: trunk/documentation/guides/JBDS_Release_Notes/en-US/Revision_History.xml
===================================================================
--- trunk/documentation/guides/JBDS_Release_Notes/en-US/Revision_History.xml 2011-02-15 18:24:49 UTC (rev 29161)
+++ trunk/documentation/guides/JBDS_Release_Notes/en-US/Revision_History.xml 2011-02-15 21:09:03 UTC (rev 29162)
@@ -4,6 +4,20 @@
<title>Revision History</title>
<simpara>
<revhistory>
+ <revision>
+ <revnumber>0-1</revnumber>
+ <date>Wed Feb 16 2011</date>
+ <author>
+ <firstname>Matthew</firstname>
+ <surname>Casperson</surname>
+ <email>mcaspers(a)redhat.com</email>
+ </author>
+ <revdescription>
+ <simplelist>
+ <member>Updated for JBDS 4.0 release</member>
+ </simplelist>
+ </revdescription>
+ </revision>
<revision>
<revnumber>0-0</revnumber>
<date>Tue Nov 09 2010</date>
13 years, 10 months
JBoss Tools SVN: r29161 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-02-15 13:24:49 -0500 (Tue, 15 Feb 2011)
New Revision: 29161
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java
Log:
JBIDE-8329 - UI class bug causing attribute to turn to null
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java 2011-02-15 16:59:11 UTC (rev 29160)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java 2011-02-15 18:24:49 UTC (rev 29161)
@@ -202,6 +202,7 @@
this.rootDir = original.getBaseDir();
this.category = original.getCategory();
this.xpath = original.getXpathPattern();
+ this.attribute = original.getAttribute();
}
if( this.xpath == null ) this.xpath = "//server/mbean"; //$NON-NLS-1$
if( this.filePattern == null ) this.filePattern = "**/*.xml"; //$NON-NLS-1$
13 years, 10 months
JBoss Tools SVN: r29160 - branches/jbosstools-3.2.x/build/parent.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-02-15 11:59:11 -0500 (Tue, 15 Feb 2011)
New Revision: 29160
Modified:
branches/jbosstools-3.2.x/build/parent/pom.xml
Log:
bump from CR4 to GA suffix in JBT component stack
Modified: branches/jbosstools-3.2.x/build/parent/pom.xml
===================================================================
--- branches/jbosstools-3.2.x/build/parent/pom.xml 2011-02-15 16:41:16 UTC (rev 29159)
+++ branches/jbosstools-3.2.x/build/parent/pom.xml 2011-02-15 16:59:11 UTC (rev 29160)
@@ -15,7 +15,7 @@
<!--tychoVersion>0.10.0-SNAPSHOT</tychoVersion -->
<tychoVersion>0.10.0</tychoVersion>
<scmBranch>branches/jbosstools-3.2.x</scmBranch>
- <BUILD_ALIAS>CR4</BUILD_ALIAS>
+ <BUILD_ALIAS>GA</BUILD_ALIAS>
<memoryOptions1>-Xms512m -Xmx1024m -XX:PermSize=256m</memoryOptions1>
<memoryOptions2>-XX:MaxPermSize=256m</memoryOptions2>
<systemProperties></systemProperties>
13 years, 10 months