JBoss Tools SVN: r12043 - in trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common: properties and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-11-25 14:14:04 -0500 (Tue, 25 Nov 2008)
New Revision: 12043
Added:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultContainerPropertySource.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultNodePropertySource.java
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultFlowPropertySource.java
Log:
package rename to org.jboss.tools.flow.common.properties
Copied: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties (from rev 10887, trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties)
Property changes on: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultContainerPropertySource.java (from rev 10900, trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultContainerPropertySource.java)
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultContainerPropertySource.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultContainerPropertySource.java 2008-11-25 19:14:04 UTC (rev 12043)
@@ -0,0 +1,50 @@
+package org.jboss.tools.flow.common.properties;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.jboss.tools.flow.common.wrapper.DefaultContainerWrapper;
+
+public class DefaultContainerPropertySource implements IPropertySource {
+
+ private static final String NAME = "org.jboss.tools.flow.common.model.DefaultContainer.name";
+
+ private DefaultContainerWrapper wrapper = null;
+ private IPropertyDescriptor[] propertyDescriptors;
+
+ public DefaultContainerPropertySource(DefaultContainerWrapper wrapper) {
+ this.wrapper = wrapper;
+ }
+ public Object getEditableValue() {
+ return null;
+ }
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (propertyDescriptors == null) {
+ propertyDescriptors = new IPropertyDescriptor[] {
+ new TextPropertyDescriptor(NAME, "Name") {}
+ };
+ }
+ return propertyDescriptors;
+ }
+ public Object getPropertyValue(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName();
+ }
+ return null;
+ }
+ public boolean isPropertySet(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName() != null;
+ }
+ return false;
+ }
+ public void resetPropertyValue(Object id) {
+ }
+ public void setPropertyValue(Object id, Object value) {
+ if (NAME.equals(id)) {
+ if (value instanceof String) {
+ wrapper.setName((String)value);
+ }
+ }
+ }
+}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultFlowPropertySource.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultFlowPropertySource.java 2008-10-16 14:14:51 UTC (rev 10887)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultFlowPropertySource.java 2008-11-25 19:14:04 UTC (rev 12043)
@@ -1,4 +1,4 @@
-package org.jboss.tools.common.properties;
+package org.jboss.tools.flow.common.properties;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertySource;
Copied: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultNodePropertySource.java (from rev 11819, trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultNodePropertySource.java)
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultNodePropertySource.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultNodePropertySource.java 2008-11-25 19:14:04 UTC (rev 12043)
@@ -0,0 +1,50 @@
+package org.jboss.tools.flow.common.properties;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.jboss.tools.flow.common.wrapper.DefaultNodeWrapper;
+
+public class DefaultNodePropertySource implements IPropertySource {
+
+ private static final String NAME = "org.jboss.tools.flow.common.model.DefaultNode.name";
+
+ private DefaultNodeWrapper wrapper = null;
+ private IPropertyDescriptor[] propertyDescriptors;
+
+ public DefaultNodePropertySource(DefaultNodeWrapper wrapper) {
+ this.wrapper = wrapper;
+ }
+ public Object getEditableValue() {
+ return null;
+ }
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (propertyDescriptors == null) {
+ propertyDescriptors = new IPropertyDescriptor[] {
+ new TextPropertyDescriptor(NAME, "Name") {}
+ };
+ }
+ return propertyDescriptors;
+ }
+ public Object getPropertyValue(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName() != null ? wrapper.getName() : "";
+ }
+ return null;
+ }
+ public boolean isPropertySet(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName() != null;
+ }
+ return false;
+ }
+ public void resetPropertyValue(Object id) {
+ }
+ public void setPropertyValue(Object id, Object value) {
+ if (NAME.equals(id)) {
+ if (value instanceof String) {
+ wrapper.setName((String)value);
+ }
+ }
+ }
+}
15 years, 6 months
JBoss Tools SVN: r12041 - trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-11-25 13:30:28 -0500 (Tue, 25 Nov 2008)
New Revision: 12041
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/ExclusiveGateway.java
Log:
add ExclusiveGateway model object
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/ExclusiveGateway.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/ExclusiveGateway.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/ExclusiveGateway.java 2008-11-25 18:30:28 UTC (rev 12041)
@@ -0,0 +1,7 @@
+package org.jboss.tools.flow.jpdl4.model;
+
+import org.jboss.tools.flow.common.model.DefaultNode;
+
+public class ExclusiveGateway extends DefaultNode {
+
+}
15 years, 6 months
JBoss Tools SVN: r12040 - trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-11-25 13:29:48 -0500 (Tue, 25 Nov 2008)
New Revision: 12040
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/EllipseElementFigure.java
Log:
make ellipse instance variable protected
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/EllipseElementFigure.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/EllipseElementFigure.java 2008-11-25 18:27:14 UTC (rev 12039)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/EllipseElementFigure.java 2008-11-25 18:29:48 UTC (rev 12040)
@@ -8,7 +8,7 @@
public class EllipseElementFigure extends AbstractElementFigure {
- private Ellipse ellipse;
+ protected Ellipse ellipse;
protected void customizeFigure() {
ellipse = new Ellipse();
15 years, 6 months
JBoss Tools SVN: r12039 - trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-11-25 13:27:14 -0500 (Tue, 25 Nov 2008)
New Revision: 12039
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java
Log:
deserialization of bendpoints
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java 2008-11-25 18:26:52 UTC (rev 12038)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java 2008-11-25 18:27:14 UTC (rev 12039)
@@ -6,6 +6,7 @@
import javax.xml.parsers.DocumentBuilderFactory;
+import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
import org.jboss.tools.flow.common.model.Flow;
import org.jboss.tools.flow.common.registry.ElementRegistry;
@@ -141,7 +142,6 @@
ArrayList<ConnectionWrapper> flows =
(ArrayList<ConnectionWrapper>)flowWrapper.getElement().getMetaData("flows");
flows.add(result);
- addName(result, (Element)child);
}
}
}
@@ -151,7 +151,6 @@
ConnectionWrapper result = (ConnectionWrapper)ElementRegistry.createWrapper(elementType);
if (result != null) {
addName(result, element);
- addTo(result, element);
addGraphics(result, element);
}
return result;
@@ -165,6 +164,23 @@
}
private static void addGraphics(ConnectionWrapper wrapper, Element element) {
+ String graphics = element.getAttribute("g");
+ if (graphics != null) {
+ StringTokenizer bendpoints = new StringTokenizer(graphics, ";");
+ int index = 0;
+ while (bendpoints.hasMoreTokens()) {
+ StringTokenizer bendpoint = new StringTokenizer(bendpoints.nextToken(), ",");
+ if (bendpoint.countTokens() != 2) {
+ Logger.logInfo(
+ "Wrong info in attribute 'g' while determining bendpoints.");
+ } else {
+ int x = convertStringToInt(bendpoint.nextToken());
+ int y = convertStringToInt(bendpoint.nextToken());
+ wrapper.addBendpoint(index++, new Point(x, y));
+ }
+
+ }
+ }
}
15 years, 6 months
JBoss Tools SVN: r12038 - trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-11-25 13:26:52 -0500 (Tue, 25 Nov 2008)
New Revision: 12038
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
Log:
serialization of bendpoints
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2008-11-25 18:00:37 UTC (rev 12037)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2008-11-25 18:26:52 UTC (rev 12038)
@@ -6,6 +6,7 @@
import java.io.Writer;
import java.util.List;
+import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
import org.jboss.tools.flow.common.model.Element;
import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
@@ -51,6 +52,7 @@
value = value == null ? "" : value;
buffer.append("to=\"" + value + "\"");
}
+ appendConnectionGraphics(buffer, (ConnectionWrapper)wrapper);
buffer.append(">");
} else if (element instanceof EndEvent) {
EndEvent endState = (EndEvent)element;
@@ -183,4 +185,17 @@
buffer.append("\"");
}
+ private static void appendConnectionGraphics(StringBuffer buffer, ConnectionWrapper wrapper) {
+ List<Point> bendPoints = wrapper.getBendpoints();
+ if (bendPoints.size() == 0) return;
+ buffer.append(" g=\"");
+ for (int i = 0; i < bendPoints.size(); i++) {
+ buffer.append(bendPoints.get(i).x);
+ buffer.append(",");
+ buffer.append(bendPoints.get(i).y);
+ if (i < bendPoints.size() - 1) buffer.append(";");
+ }
+ buffer.append("\"");
+ }
+
}
15 years, 6 months
JBoss Tools SVN: r12037 - in trunk/jst/plugins: org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: izhukov
Date: 2008-11-25 13:00:37 -0500 (Tue, 25 Nov 2008)
New Revision: 12037
Added:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/OpenCSSDialogActionDelegate.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/JstUIMessages.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSStyleDialog.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/StyleComposite.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Util.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/StyleAttributes.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPreviewControl.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabQuickEditControl.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/css/NewCSSClassWizard.java
Log:
update CSS Dialog with new features
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2008-11-25 17:54:11 UTC (rev 12036)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2008-11-25 18:00:37 UTC (rev 12037)
@@ -305,6 +305,34 @@
label="Restore Last Selection">
</action>
</editorContribution>
+ <editorContribution
+ id="org.jboss.tools.jst.jsp.cssClassDialogEditorContribution"
+ targetID="org.eclipse.wst.css.core.csssource.source">
+ <menu
+ id="org.jboss.tools.jst.jsp.cssClassDialogSubMenu"
+ label="CSS"
+ path="additions">
+ <groupMarker
+ name="content">
+ </groupMarker>
+ <separator
+ name="additions">
+ </separator>
+ </menu>
+ <action
+ class="org.jboss.tools.jst.jsp.outline.cssdialog.OpenCSSDialogActionDelegate"
+ definitionId="org.jboss.tools.jst.jsp.commands.openCSSDialog"
+ enablesFor="+"
+ hoverIcon="images/cssdialog/color_large.gif"
+ icon="images/cssdialog/color_large.gif"
+ id="org.jboss.tools.jst.jsp.openCSSDialogEditor"
+ label="Open edit dialog"
+ menubarPath="org.jboss.tools.jst.jsp.cssClassDialogSubMenu/content"
+ style="push"
+ toolbarPath="Normal/additions"
+ tooltip="Open CSS Dialog based on the active CSS file">
+ </action>
+ </editorContribution>
</extension>
<!--extension point="org.jboss.tools.common.verification.rules">
@@ -392,5 +420,52 @@
</contentAssistProcessor>
</extension>
-
+ <extension
+ point="org.eclipse.ui.popupMenus">
+ <objectContribution
+ adaptable="true"
+ id="org.jboss.tools.jst.jsp.cssDialogPopupMenu"
+ nameFilter="*.css"
+ objectClass="org.eclipse.core.resources.IResource">
+ <action
+ class="org.jboss.tools.jst.jsp.outline.cssdialog.OpenCSSDialogActionDelegate"
+ definitionId="org.jboss.tools.jst.jsp.commands.openCSSDialog"
+ icon="images/cssdialog/color_large.gif"
+ id="org.jboss.tools.jst.jsp.openCSSDialogPopupMenu"
+ label="Open CSS Dialog"
+ menubarPath="additions"
+ tooltip="Open CSS Dialog based on the active CSS file">
+ </action>
+ <menu
+ id="org.jboss.tools.jst.jsp.popupSubMenu"
+ label="Open CSS Dialog"
+ path="additions">
+ <groupMarker name="content"/>
+ <separator name="additions"/>
+ </menu>
+ </objectContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <category
+ description="CSSDialog"
+ id="org.jboss.tools.jst.jsp.commands"
+ name="CSS Dialog">
+ </category>
+ <command
+ categoryId="org.jboss.tools.jst.jsp.commands"
+ description="Open active or selected CSS Dialog"
+ id="org.jboss.tools.jst.jsp.commands.openCSSDialog"
+ name="Open CSS Dialog">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.bindings">
+ <key
+ commandId="org.jboss.tools.jst.jsp.commands.openCSSDialog"
+ contextId="org.eclipse.wst.css.core.csssource"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="Ctrl+Shift+C">
+ </key>
+ </extension>
</plugin>
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/JstUIMessages.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/JstUIMessages.java 2008-11-25 17:54:11 UTC (rev 12036)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/JstUIMessages.java 2008-11-25 18:00:37 UTC (rev 12037)
@@ -42,7 +42,13 @@
public static String CSS_FILE_SELECT_DIALOG_TITLE;
public static String CSS_FILE_SELECT_DIALOG_LABEL;
public static String CSS_FILE_SELECT_DIALOG_EMPTY_MESSAGE;
- public static String CSS_STYLE_CLASS_DIALOG_TITLE;
+ public static String CSS_STYLE_CLASS_EDITOR_HEADER_TITLE;
+ public static String CSS_STYLE_CLASS_EDITOR_DESCRIPTION;
+ public static String CSS_STYLE_CLASS_EDITOR_TITLE;
+ public static String CSS_EMPTY_FILE_PATH_MESSAGE;
+ public static String CSS_EMPTY_STYLE_CLASS_MESSAGE;
+ public static String CSS_SAVE_DIALOG_TITLE;
+ public static String CSS_SAVE_DIALOG_MESSAGE;
public static String CSS_CLASS_DIALOG_FILE_LABEL;
public static String CSS_BROWSE_BUTTON_TOOLTIP;
public static String CSS_CLASS_DIALOG_STYLE_CLASS_LABEL;
@@ -89,4 +95,5 @@
public static String TEXT_ALIGN;
public static String BUTTON_CLEAR;
public static String PREVIEW_SHEET_TAB_NAME;
+ public static String DEFAULT_PREVIEW_TEXT;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties 2008-11-25 17:54:11 UTC (rev 12036)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties 2008-11-25 18:00:37 UTC (rev 12037)
@@ -2,7 +2,13 @@
CSS_FILE_SELECT_DIALOG_LABEL=Select CSS file from the tree:
CSS_FILE_SELECT_DIALOG_EMPTY_MESSAGE=No CSS file in the current project
-CSS_STYLE_CLASS_DIALOG_TITLE=CSS Style Class Dialog
+CSS_STYLE_CLASS_EDITOR_HEADER_TITLE=CSS Style Class Editor
+CSS_STYLE_CLASS_EDITOR_DESCRIPTION=Create New CSS Class
+CSS_STYLE_CLASS_EDITOR_TITLE=CSS Class
+CSS_EMPTY_FILE_PATH_MESSAGE=Choose any CSS file
+CSS_EMPTY_STYLE_CLASS_MESSAGE=Style class is empty
+CSS_SAVE_DIALOG_TITLE=Save CSS file
+CSS_SAVE_DIALOG_MESSAGE=CSS file has been changed.\nWould you like to save changes?
CSS_CLASS_DIALOG_FILE_LABEL=CSS file:
CSS_CLASS_DIALOG_STYLE_CLASS_LABEL=Style class:
@@ -63,3 +69,5 @@
MARGIN_PADDING_TITLE=Margin/Padding
MARGIN=Margin:
PADDING=Padding:
+
+DEFAULT_PREVIEW_TEXT=CSS file to edit will be displayed here
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java 2008-11-25 17:54:11 UTC (rev 12036)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java 2008-11-25 18:00:37 UTC (rev 12037)
@@ -77,15 +77,10 @@
public static final String ID = "org.jboss.tools.jst.jsp.outline.cssdialog.CSSClassDialog"; //$NON-NLS-1$
- // TODO: take out to the property manager file
- public final static String WIZARD_TITLE = "CSS Class";
- public final static String WIZARD_DESCRIPTION = "Create New CSS Class.";
- public final static String EMPTY_CSS_FILE_PATH_MESSAGE = "Choose any CSS file";
- public final static String EMPTY_STYLE_CLASS_MESSAGE = "Style class is empty";
-
+ private static String notUsed = "not_used"; //$NON-NLS-1$
private static final String CSS_FILE_EXTENTION = "css"; //$NON-NLS-1$
- final static String[] fileExtensions = { CSS_FILE_EXTENTION };
- final static String SKIP_FIRST_CHAR = "."; //$NON-NLS-1$
+ private final static String[] fileExtensions = { CSS_FILE_EXTENTION };
+ private final static String SKIP_FIRST_CHAR = "."; //$NON-NLS-1$
private Composite browserContainer = null;
private Browser browser = null;
@@ -136,8 +131,8 @@
setShellStyle(getShellStyle() | SWT.RESIZE | SWT.MAX | SWT.APPLICATION_MODAL);
- filePathStatus = new Status(IStatus.ERROR, "not_used", 0, EMPTY_CSS_FILE_PATH_MESSAGE, null); //$NON-NLS-1$
- classNameStatus = new Status(IStatus.ERROR, "not_used", 0, EMPTY_STYLE_CLASS_MESSAGE, null); //$NON-NLS-1$
+ filePathStatus = new Status(IStatus.ERROR, notUsed, 0, JstUIMessages.CSS_EMPTY_FILE_PATH_MESSAGE, null);
+ classNameStatus = new Status(IStatus.ERROR, notUsed, 0, JstUIMessages.CSS_EMPTY_STYLE_CLASS_MESSAGE, null);
styleAttributes = new StyleAttributes();
this.callFromWizard = callFromWizard;
@@ -219,8 +214,8 @@
*/
public Control createDialogComposite(Composite composite) {
if (!this.callFromWizard) {
- setTitle(WIZARD_TITLE);
- setMessage(WIZARD_DESCRIPTION);
+ setTitle(JstUIMessages.CSS_STYLE_CLASS_EDITOR_TITLE);
+ setMessage(JstUIMessages.CSS_STYLE_CLASS_EDITOR_DESCRIPTION);
}
Split split = new Split(composite, SWT.VERTICAL);
@@ -258,9 +253,9 @@
public void modifyText(ModifyEvent e) {
String cssFile = text.getText().trim();
// Initialize a variable with the no error status
- filePathStatus = new Status(IStatus.ERROR, "not_used", 0, EMPTY_CSS_FILE_PATH_MESSAGE, null); //$NON-NLS-1$
+ filePathStatus = new Status(IStatus.ERROR, notUsed, 0, JstUIMessages.CSS_EMPTY_FILE_PATH_MESSAGE, null);
if (cssFile != null && !cssFile.equals(Constants.EMPTY)) {
- filePathStatus = new Status(IStatus.OK, "not_used", 0, WIZARD_DESCRIPTION, null); //$NON-NLS-1$
+ filePathStatus = new Status(IStatus.OK, notUsed, 0, JstUIMessages.CSS_STYLE_CLASS_EDITOR_DESCRIPTION, null);
}
// show corresponding message
IStatus status = findMostSevere();
@@ -300,36 +295,36 @@
dialog.setEmptyListMessage(JstUIMessages.CSS_FILE_SELECT_DIALOG_EMPTY_MESSAGE);
if (dialog.open() == Window.OK) {
- // make some important saving actions
- if (styleChanged && currentFile != null) {
- MessageBox messageBox = new MessageBox(getParentShell(), SWT.YES | SWT.NO | SWT.ICON_QUESTION);
- messageBox.setText("Save CSS file");
- messageBox.setMessage("'" + currentFile + "'" + //$NON-NLS-1$ //$NON-NLS-2$
- " CSS file has been changed.\nWould you like to save changes?");
- int result = messageBox.open();
- if (result == SWT.YES) {
- saveChanges();
- } else {
- styleComposite.closePreview(false);
- if (cssModel != null) {
- cssModel.releaseModel();
- }
- updateStyleComposite();
- styleComposite.updatePreviewCssFile(currentFile);
- }
- }
- // open new CSS file and initialize dialog
IResource res = (IResource) dialog.getFirstResult();
+ // make some important saving actions
if (res instanceof IFile) {
+ if (styleChanged && currentFile != null) {
+ MessageBox messageBox = new MessageBox(getParentShell(), SWT.YES | SWT.NO | SWT.ICON_QUESTION);
+ messageBox.setText(JstUIMessages.CSS_SAVE_DIALOG_TITLE);
+ messageBox.setMessage("'" + currentFile + "' " + JstUIMessages.CSS_SAVE_DIALOG_MESSAGE); //$NON-NLS-1$ //$NON-NLS-2$
+ int result = messageBox.open();
+ if (result == SWT.YES) {
+ saveChanges();
+ } else {
+ styleComposite.closePreview(false);
+ updateStyleComposite();
+ }
+ }
+ // open new CSS file and initialize dialog
boolean useRelativePath = true;
if (project instanceof IWorkspaceRoot) {
useRelativePath = false;
}
+ boolean updateCSSModel = false;
+ if (currentFile != null && !currentFile.equals(Constants.EMPTY)) {
+ currentClassStyle = null;
+ updateCSSModel = true;
+ }
currentFile = (IFile)res;
- initCSSModel(currentFile, useRelativePath);
+ initCSSModel(currentFile, useRelativePath, updateCSSModel);
updateOKButtonState();
+ styleChanged = false;
}
- styleChanged = false;
}
}
});
@@ -341,91 +336,30 @@
gridData = new GridData(GridData.FILL, GridData.CENTER, true, false);
gridData.horizontalSpan = 2;
-// classCombo = new ComboViewer(classComposite, SWT.BORDER);
classCombo = new Combo(classComposite, SWT.BORDER);
classCombo.setLayoutData(gridData);
classCombo.setEnabled(false);
-// classCombo.setLabelProvider(new LabelProvider() {
-// @Override
-// public String getText(Object element) {
-// return ((Selector)element).getValue();
-// }
-// });
-// classCombo.addSelectionChangedListener(new ISelectionChangedListener() {
-// public void widgetSelected(SelectionEvent e) {
-// if (currentFile != null && !currentFile.equals(Constants.EMPTY)) {
-// if (styleChanged) {
-// if (currentClassStyle != null && !currentClassStyle.equals(Constants.EMPTY)) {
-// String newStyle = styleComposite.updateStyle();
-// if (newStyle != null) {
-// cssModel.setCSS(currentClassStyle, newStyle);
-// // update ComboBox element list
-// int currentIndex = classCombo.indexOf(currentClassStyle);
-// if (currentIndex == -1) {
-// classCombo.add(currentClassStyle);
-// }
-// }
-// }
-// }
-// // update current class style value
-// currentClassStyle = classCombo.getText();
-// updateStyleComposite();
-// updateOKButtonState();
-// styleChanged = false;
-// } else {
-// currentClassStyle = classCombo.getText();
-// }
-// }
-// @Override
-// public void selectionChanged(SelectionChangedEvent event) {
-// if (currentFile != null && !currentFile.equals(Constants.EMPTY)) {
-// if (styleChanged) {
-// if (currentClassStyle != null && !currentClassStyle.equals(Constants.EMPTY)) {
-// String newStyle = styleComposite.updateStyle();
-// if (newStyle != null) {
-// cssModel.setCSS(currentClassStyle, newStyle);
-// // update ComboBox element list
-// int currentIndex = classCombo.getCombo().indexOf(currentClassStyle);
-// if (currentIndex == -1) {
-// classCombo.add(currentClassStyle);
-// }
-// }
-// }
-// }
-// // update current class style value
-// currentClassStyle = classCombo.getInput() != null ? classCombo.getInput().toString() : null;
-// updateStyleComposite();
-// updateOKButtonState();
-// styleChanged = false;
-// } else {
-// currentClassStyle = classCombo.getInput().toString();
-// }
-// }
-// });
-
classCombo.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if (currentFile != null && !currentFile.equals(Constants.EMPTY)) {
if (styleChanged) {
if (currentClassStyle != null && !currentClassStyle.equals(Constants.EMPTY)) {
- String newStyle = styleComposite.updateStyle();
- if (newStyle != null) {
- cssModel.setCSS(currentClassStyle, newStyle);
- // update ComboBox element list
- int currentIndex = classCombo.indexOf(currentClassStyle);
- if (currentIndex == -1) {
- classCombo.add(currentClassStyle);
- }
- }
+ styleComposite.updateStyle();
+ cssModel.setCSS(currentClassStyle, styleAttributes);
+ // update ComboBox element list
+ int currentIndex = classCombo.indexOf(currentClassStyle);
+ if (currentIndex == -1) {
+ classCombo.add(currentClassStyle);
+ }
}
}
// update current class style value
currentClassStyle = classCombo.getText();
updateStyleComposite();
updateOKButtonState();
- styleChanged = false;
} else {
currentClassStyle = classCombo.getText();
+ styleAttributes.setCssSelector(currentClassStyle);
}
}
});
@@ -434,6 +368,7 @@
public void keyReleased(KeyEvent e) {
// update current class style value
currentClassStyle = classCombo.getText().trim();
+ styleAttributes.setCssSelector(currentClassStyle);
updateOKButtonState();
}
});
@@ -441,9 +376,9 @@
public void modifyText(ModifyEvent e) {
String cssClass = classCombo.getText().trim();
// Initialize a variable with the no error status
- classNameStatus = new Status(IStatus.ERROR, "not_used", 0, EMPTY_STYLE_CLASS_MESSAGE, null); //$NON-NLS-1$
+ classNameStatus = new Status(IStatus.ERROR, notUsed, 0, JstUIMessages.CSS_EMPTY_STYLE_CLASS_MESSAGE, null);
if (cssClass != null && !cssClass.equals(Constants.EMPTY)) {
- classNameStatus = new Status(IStatus.OK, "not_used", 0, WIZARD_DESCRIPTION, null); //$NON-NLS-1$
+ classNameStatus = new Status(IStatus.OK, notUsed, 0, JstUIMessages.CSS_STYLE_CLASS_EDITOR_DESCRIPTION, null);
}
// show corresponding message
IStatus status = findMostSevere();
@@ -458,9 +393,9 @@
if (!browser.isDisposed()) {
browser.setText(getTextForBrowser());
}
- if (cssModel != null && currentClassStyle != null) {
- classCombo.setToolTipText(cssModel.getCSSText(currentClassStyle));
- }
+// if (cssModel != null && currentClassStyle != null) {
+// classCombo.setToolTipText(cssModel.getCSSText(currentClassStyle));
+// }
}
});
// create style composite component
@@ -470,10 +405,8 @@
styleChanged = true;
if (currentClassStyle != null && !currentClassStyle.equals(Constants.EMPTY)
&& currentFile != null && !currentFile.equals(Constants.EMPTY)) {
- String newStyle = styleComposite.updateStyle();
- if (newStyle != null) {
- cssModel.setCSS(currentClassStyle, newStyle);
- }
+ styleComposite.updateStyle();
+ cssModel.setCSS(currentClassStyle, styleAttributes);
}
}
});
@@ -485,15 +418,18 @@
clearButton.setToolTipText(JstUIMessages.CSS_CLEAR_STYLE_SHEET);
clearButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
- styleComposite.clearStyleComposite();
+ styleComposite.clearStyleComposite(currentClassStyle);
+ styleComposite.updateStyle();
+ cssModel.setCSS(currentClassStyle, styleAttributes);
styleChanged = true;
}
});
if (currentFile != null) {
- initCSSModel(currentFile, true);
+ initCSSModel(currentFile, true, true);
} else if (currentClassStyle != null) {
classCombo.setText(currentClassStyle);
+ styleAttributes.setCssSelector(currentClassStyle);
}
split.setWeights(new int[]{15, 85});
@@ -508,22 +444,19 @@
* @param file IFile object
* @param useRelativePathPath
*/
- private void initCSSModel(IFile file, boolean useRelativePathPath) {
+ private void initCSSModel(IFile file, boolean useRelativePathPath, boolean updateCSSModel) {
if (file != null) {
// create CSS Model
cssModel = new CSSModel(file);
classCombo.setEnabled(true);
classCombo.removeAll();
- boolean useCurrentStyleSettings = false;
- if (text.getText() == null || text.getText().equals(Constants.EMPTY)) {
- useCurrentStyleSettings = true;
- }
+ // set file path to corresponding text field
if (useRelativePathPath) {
text.setText(file.getProjectRelativePath().toOSString());
} else {
text.setText(file.getFullPath().toOSString());
}
-
+ // fill in ComboBox component with CSS model selectors
List<Selector> selectors = cssModel.getSelectors();
int selectedIndex = -1;
for (int i = 0; i < selectors.size(); i++) {
@@ -533,18 +466,18 @@
selectedIndex = i;
}
}
-// if (useCurrentStyleSettings && currentClassStyle != null && selectedIndex == -1) {
-// classCombo.setText(currentClassStyle);
-// } else {
-// classCombo.select(selectedIndex);
-// }
-// if (currentClassStyle != null) {
-// classCombo.setInput(currentClassStyle);
-// }
- classCombo.select(selectedIndex);
+ if (currentClassStyle != null && selectedIndex == -1) {
+ classCombo.setText(currentClassStyle);
+ } else {
+ classCombo.select(selectedIndex);
+ }
+ classCombo.setToolTipText(cssModel.getCSSText(currentClassStyle));
- updateStyleComposite();
- styleComposite.updatePreviewCssFile(currentFile);
+ // update style composite component with the values from new CSS file
+ if (updateCSSModel) {
+ updateStyleComposite();
+ }
+ styleComposite.updatePreview(cssModel);
}
}
@@ -598,7 +531,7 @@
private void updateStyleComposite() {
String style = cssModel.getStyle(currentClassStyle);
// classCombo.setToolTipText(cssModel.getCSSText(currentClassStyle));
- styleComposite.recreateStyleComposite(style);
+ styleComposite.recreateStyleComposite(style, currentClassStyle);
}
/**
@@ -636,8 +569,8 @@
* Method should be called in case of dialog closure operation.
*/
public void saveChanges() {
- String newStyle = styleComposite.updateStyle();
- cssModel.setCSS(currentClassStyle, newStyle);
+ styleComposite.updateStyle();
+ cssModel.setCSS(currentClassStyle, styleAttributes);
cssModel.saveModel();
styleComposite.closePreview(true);
}
@@ -660,7 +593,7 @@
@Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
- newShell.setText(JstUIMessages.CSS_STYLE_CLASS_DIALOG_TITLE);
+ newShell.setText(JstUIMessages.CSS_STYLE_CLASS_EDITOR_TITLE);
}
/**
@@ -681,15 +614,11 @@
switch (code) {
case OK:
saveChanges();
- super.okPressed();
break;
case CANCEL:
default:
// make some closure operation
styleComposite.closePreview(false);
- if (cssModel != null) {
- cssModel.releaseModel();
- }
}
return super.close();
}
@@ -731,21 +660,18 @@
* @see org.eclipse.swt.events.MouseListener#mouseDown(org.eclipse.swt.events.MouseEvent)
*/
public void mouseDown(MouseEvent e) {
- // TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.swt.events.MouseListener#mouseUp(org.eclipse.swt.events.MouseEvent)
*/
public void mouseUp(MouseEvent e) {
- // TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.swt.events.FocusListener#focusGained(org.eclipse.swt.events.FocusEvent)
*/
public void focusGained(FocusEvent e) {
- // TODO Auto-generated method stub
}
/**
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSStyleDialog.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSStyleDialog.java 2008-11-25 17:54:11 UTC (rev 12036)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSStyleDialog.java 2008-11-25 18:00:37 UTC (rev 12037)
@@ -99,7 +99,7 @@
for (String key : keySet) {
styleForSpan += (key + Constants.COLON + styleAttributes.getAttribute(key) + Constants.SEMICOLON);
}
- String html = Constants.OPEN_DIV_TAG + styleForSpan + "\">" + previewBrowserValue + Constants.CLOSE_DIV_TAG;
+ String html = Constants.OPEN_DIV_TAG + styleForSpan + "\">" + previewBrowserValue + Constants.CLOSE_DIV_TAG; //$NON-NLS-1$
return html;
}
@@ -113,7 +113,7 @@
@Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
- newShell.setText(JstUIMessages.CSS_STYLE_CLASS_DIALOG_TITLE);
+ newShell.setText(JstUIMessages.CSS_STYLE_CLASS_EDITOR_TITLE);
}
/**
Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/OpenCSSDialogActionDelegate.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/OpenCSSDialogActionDelegate.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/OpenCSSDialogActionDelegate.java 2008-11-25 18:00:37 UTC (rev 12037)
@@ -0,0 +1,111 @@
+package org.jboss.tools.jst.jsp.outline.cssdialog;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+
+/**
+ * This is CSS dialog action delegate class that process actions that is contributed in Eclipse
+ * regarding CSS Dialog.
+ *
+ * @author Igor Zhukov
+ */
+public class OpenCSSDialogActionDelegate implements IWorkbenchWindowActionDelegate, IObjectActionDelegate,
+ IEditorActionDelegate, IViewActionDelegate {
+
+ private Shell shell = null;
+ private IStructuredSelection selection = null;
+
+ /**
+ * Initializes this action delegate with the view it will work in.
+ *
+ * @param view the view that provides the context for this delegate
+ * @see IViewActionDelegate#init(IViewPart)
+ */
+ public void init(IViewPart view) {
+ if (view != null) {
+ if (view.getSite() != null) {
+ shell = view.getSite().getShell();
+ } else if (view.getViewSite() != null) {
+ shell = view.getViewSite().getShell();
+ }
+ }
+ }
+
+ /**
+ * Initializes this action delegate with the view it will work in.
+ *
+ * @param view the view that provides the context for this delegate
+ * @see IWorkbenchWindowActionDelegate#init(IWorkbenchWindow)
+ */
+ public void init(IWorkbenchWindow window) {
+ if (window != null) {
+ shell = window.getShell();
+ }
+ }
+
+ /**
+ * Called when the user has selected this action to be executed.
+ */
+ public void run(IAction action) {
+ if (shell != null) {
+ String styleClass = null;
+ CSSClassDialog dialog = new CSSClassDialog(shell, selection, false);
+ if (dialog.open() == Window.OK) {
+ styleClass = dialog.getSelectorName();
+ }
+ }
+ }
+
+ /**
+ * Notifies this action delegate that the selection in the workbench has changed.
+ *
+ * @param action the action proxy that handles presentation portion of the action
+ * @param selection the current selection, or <code>null</code> if there is no selection.
+ * @see IActionDelegate#selectionChanged(IAction, ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ if (selection instanceof IStructuredSelection) {
+ this.selection = (IStructuredSelection)selection;
+ }
+ }
+
+ /**
+ * Sets the active part for the delegate. This method will be called
+ * every time the action appears in a context menu. The targetPart
+ * may change with each invocation.
+ */
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ if (targetPart != null && targetPart.getSite() != null) {
+ shell = targetPart.getSite().getShell();
+ }
+ }
+
+ /**
+ * Sets the active editor for the delegate. Implementors should
+ * disconnect from the old editor, connect to the new editor, and
+ * update the action to reflect the new editor.
+ *
+ * @param action the action proxy that handles presentation portion of the action
+ * @param editor the new editor target
+ * @see IEditorActionDelegate #setActiveEditor(IAction, IEditorPart)
+ */
+ public void setActiveEditor(IAction action, IEditorPart targetEditor) {
+ if (targetEditor != null && targetEditor.getSite() != null) {
+ shell = targetEditor.getSite().getShell();
+ }
+ }
+
+ public void dispose() {
+ }
+}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/StyleComposite.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/StyleComposite.java 2008-11-25 17:54:11 UTC (rev 12036)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/StyleComposite.java 2008-11-25 18:00:37 UTC (rev 12037)
@@ -12,11 +12,7 @@
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.Map.Entry;
-import org.eclipse.core.resources.IFile;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.events.SelectionAdapter;
@@ -28,7 +24,7 @@
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.jboss.tools.jst.jsp.messages.JstUIMessages;
-import org.jboss.tools.jst.jsp.outline.cssdialog.common.Constants;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.CSSModel;
import org.jboss.tools.jst.jsp.outline.cssdialog.events.ManualChangeStyleListener;
import org.jboss.tools.jst.jsp.outline.cssdialog.events.StyleAttributes;
import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.BaseListener;
@@ -47,7 +43,7 @@
/**
* Class for creating style tabs
*
- * @author Dzmitry Sakovich (dsakovich(a)exadel.com)
+ * @author Igor Zhukov (izhukov(a)exadel.com)
*/
public class StyleComposite extends Composite {
@@ -99,8 +95,9 @@
}
/**
+ * Gets updated style.
*
- * @return
+ * @return new style value
*/
public String getNewStyle() {
return newStyle;
@@ -108,10 +105,8 @@
/**
* Update new style in accordance with the style attribute values.
- *
- * @return string representation of attribute of current CSS selector
*/
- public String updateStyle() {
+ public void updateStyle() {
if (lastSelectedTab == tabTextFont) {
tabTextControl.updateData(true);
} else if (lastSelectedTab == tabBackground) {
@@ -121,15 +116,8 @@
} else if (lastSelectedTab == tabPropertySheet) {
tabPropertySheetControl.updateData(true);
}
-
- StringBuffer buf = new StringBuffer();
- Set<Entry<String, String>> set = styleAttributes.entrySet();
- for (Map.Entry<String, String> me : set) {
- buf.append(me.getKey() + Constants.COLON + me.getValue() + Constants.SEMICOLON);
- }
-
- newStyle = buf.toString();
- return newStyle;
+ // update newStyle value
+ newStyle = styleAttributes.getStyle();
}
/**
@@ -244,9 +232,11 @@
tabBoxesControl.updateData(false);
lastSelectedTab = tabBoxes;
} else if (tabFolder.getSelection()[FIRST_SELECTION] == tabPreview) {
+ tabPreviewControl.selectEditorArea(styleAttributes.getCssSelector(), 0);
lastSelectedTab = tabPreview;
} else if (tabFolder.getSelection()[FIRST_SELECTION] == tabPropertySheet) {
-// tabPropertySheetControl.updateData(false);
+ // TODO: changes on property sheet tag should reflect changes to another tabs
+ tabPropertySheetControl.updateData(false);
lastSelectedTab = tabPropertySheet;
}
}
@@ -365,8 +355,9 @@
/**
* Clear whole style composite component.
*/
- public void clearStyleComposite() {
+ public void clearStyleComposite(String cssSelector) {
styleAttributes.clear();
+ styleAttributes.setCssSelector(cssSelector);
tabBackgroundControl.updateData(false);
tabBoxesControl.updateData(false);
@@ -379,21 +370,13 @@
}
/**
- * Update Preview tab with content from the passed CSS file.
- *
- * @param cssFile CSS file to be shown on Preview tab
- */
- public void updatePreviewCssFile(IFile cssFile) {
- tabPreviewControl.updateDataFile(cssFile);
- }
-
- /**
* Recreate style composite tab widgets.
*
* @param style CSS style
*/
- public void recreateStyleComposite(String style) {
+ public void recreateStyleComposite(String style, String cssSelector) {
styleAttributes.clear();
+ styleAttributes.setCssSelector(cssSelector);
parser.parse(style);
tabBackgroundControl.updateData(false);
@@ -427,6 +410,17 @@
}
/**
+ * Method is used to update preview tab with corresponding CSS file.
+ *
+ * @param cssModel model associated with the file that should be displayed in preview tab
+ */
+ public void updatePreview(CSSModel cssModel) {
+ if (tabPreviewControl != null) {
+ tabPreviewControl.updatePreview(cssModel);
+ }
+ }
+
+ /**
* Method is used to close preview tab correctly.
*
* @param save close editor with saving or not
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java 2008-11-25 17:54:11 UTC (rev 12036)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java 2008-11-25 18:00:37 UTC (rev 12037)
@@ -13,16 +13,23 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.wst.css.core.internal.format.FormatProcessorCSS;
import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
+import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
+import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.outline.cssdialog.events.StyleAttributes;
import org.w3c.dom.css.CSSRuleList;
import org.w3c.dom.css.CSSStyleDeclaration;
import org.w3c.dom.css.CSSStyleRule;
@@ -35,12 +42,15 @@
private static String startBraces = "{"; //$NON-NLS-1$
private static String endBraces = "}"; //$NON-NLS-1$
+
private FormatProcessorCSS formatProcessorCSS = null;
- private CSSStyleSheet styleSheet = null;
private IStructuredModel model = null;
private IFile styleFile = null;
- /**
+ private CSSStyleSheet styleSheet = null;
+ private ICSSStyleSheet eclipseStyleSheet = null;
+
+ /**
* Constructor.
*
* @param styleFile CSS style class that should initialize CSS model
@@ -55,10 +65,12 @@
if (model instanceof ICSSModel) {
ICSSModel cssModel = (ICSSModel) model;
ICSSDocument document = cssModel.getDocument();
-
if (document instanceof CSSStyleSheet) {
styleSheet = (CSSStyleSheet) document;
}
+ if (document instanceof ICSSStyleSheet) {
+ eclipseStyleSheet = (ICSSStyleSheet) document;
+ }
}
} catch (IOException e) {
JspEditorPlugin.getPluginLog().logError(e.getMessage());
@@ -68,6 +80,27 @@
}
/**
+ * Method is used to select area that corresponds to specific selector.
+ *
+ * @param selector the selector that should be selected in editor area
+ * @param index if CSS file contains more then one elements with the same selector name,
+ * then index is serial number of this selector
+ */
+ public IndexedRegion getSelectorRegion(String selector, int index) {
+ if (eclipseStyleSheet != null) {
+ if (selector != null && !selector.equals(Constants.EMPTY)) {
+ ICSSStyleRule styleRule = Util.getSelector(eclipseStyleSheet, selector, index);
+ if (styleRule != null) {
+ if (styleRule instanceof IndexedRegion) {
+ return (IndexedRegion) styleRule;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
* Get selectors
*
* @return List<String>
@@ -83,7 +116,6 @@
if (list.item(i) instanceof CSSStyleRule) {
CSSStyleRule rule = ((CSSStyleRule) list.item(i));
Selector selector = new Selector(rule.toString(), rule.getSelectorText());
-// selectors.add(((CSSStyleRule) list.item(i)).getSelectorText());
selectors.add(selector);
}
}
@@ -94,12 +126,13 @@
}
/**
- *
- * @param selector
- * @return
+ * Gets CSS attributes for the given selector in string representation.
+ *
+ * @param selector CSS selector value
+ * @return CSS attributes string representation
*/
public String getCSSText(String selector) {
- if (styleSheet != null) {
+ if (styleSheet != null && selector != null) {
CSSRuleList list = styleSheet.getCssRules();
if (list != null) {
@@ -139,11 +172,12 @@
}
/**
+ * Sets CSS style for the given selector.
*
- * @param selector
- * @param style
+ * @param selector CSS selector value
+ * @param styleAttribute the style to be set
*/
- public void setCSS(String selector, String style) {
+ public void setCSS(String selector, StyleAttributes styleAttributes) {
if (styleSheet != null) {
CSSRuleList list = styleSheet.getCssRules();
@@ -152,40 +186,50 @@
for (int i = 0; i < list.getLength(); i++) {
if (list.item(i) instanceof CSSStyleRule &&
((CSSStyleRule) list.item(i)).getSelectorText().equals(selector)) {
+
CSSStyleRule rule = (CSSStyleRule) list.item(i);
CSSStyleDeclaration declaration = rule.getStyle();
- declaration.setCssText(style);
+ // previously before updating remove all existing properties
+ while (declaration.getLength() > 0) {
+ declaration.removeProperty(declaration.item(0));
+ }
+ // set properties
+ Set<Entry<String, String>> set = styleAttributes.entrySet();
+ for (Map.Entry<String, String> me : set) {
+ declaration.setProperty(me.getKey(), me.getValue(), Constants.EMPTY);
+ }
return;
}
}
// insert NEW selector to style sheet
- styleSheet.insertRule(selector + startBraces + style + endBraces, list.getLength());
+ styleSheet.insertRule(selector + startBraces + styleAttributes.getStyle() + endBraces, list.getLength());
formatProcessorCSS.formatModel(model);
}
}
}
/**
- * Save model to file
+ * Gets file associated with current model.
+ *
+ * @return the styleFile
+ */
+ public IFile getStyleFile() {
+ return this.styleFile;
+ }
+
+ /**
+ * Release CSS model correctly from editing.
*/
public void releaseModel() {
model.releaseFromEdit();
}
/**
- * Save model to file
+ * Save model. Associate file will be saved automatically.
*/
public void saveModel() {
-// ICSSModel cssModel = (ICSSModel) model;
-// ICSSDocument document = cssModel.getDocument();
-
-// if (document instanceof CSSStyleSheet) {
-// styleSheet = (CSSStyleSheet) document;
-// }
-// formatProcessorCSS.formatModel(model);
try {
- formatProcessorCSS.formatFile(styleFile);
model.save();
} catch (IOException e) {
JspEditorPlugin.getPluginLog().logError(e.getMessage());
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Util.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Util.java 2008-11-25 17:54:11 UTC (rev 12036)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Util.java 2008-11-25 18:00:37 UTC (rev 12037)
@@ -324,13 +324,15 @@
public static String getActivePageCSSSelectorIfAny() {
IWorkbenchPage page = JspEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
ISelection selection = page.getSelection();
- String sText = null;
if (selection instanceof IStructuredSelection) {
IStructuredSelection ss = (IStructuredSelection)selection;
for (Iterator iterator = ss.iterator(); iterator.hasNext();) {
Object node = iterator.next();
if (node instanceof ICSSNode) {
- return getSelector((ICSSNode)node);
+ ICSSStyleRule styleRule = getSelector((ICSSNode)node, null, 0);
+ if (styleRule != null) {
+ return styleRule.getSelectorText();
+ }
}
}
}
@@ -338,19 +340,40 @@
}
/**
- *
+ *
+ * @param node
+ * @param selector
+ * @param index
+ * @return
*/
- private static String getSelector(ICSSNode node) {
+ public static ICSSStyleRule getSelector(ICSSNode node, String selector, int index) {
if (node != null) {
+ // NOTE: if needed this method should be extended regarding other properties of ICSSNode class
short nodeType = node.getNodeType();
- if (nodeType == ICSSNode.STYLESHEET_NODE) {
+ switch (nodeType) {
+ case ICSSNode.STYLESHEET_NODE:
ICSSStyleSheet styleSheet = (ICSSStyleSheet) node;
- return getSelector(styleSheet.getFirstChild());
- } else if (nodeType == ICSSNode.STYLERULE_NODE) {
+ return getSelector(styleSheet.getFirstChild(), selector, index);
+ case ICSSNode.STYLERULE_NODE:
ICSSStyleRule styleRule = (ICSSStyleRule) node;
- return styleRule.getSelectorText();
- } else {
- return getSelector(node.getParentNode());
+ boolean selectorFound = true;
+ if (selector != null) {
+ if (styleRule.getSelectorText().equals(selector)) {
+ if (index > 0) {
+ index--;
+ selectorFound = false;
+ }
+ } else {
+ selectorFound = false;
+ }
+ }
+ if (selectorFound) {
+ return styleRule;
+ } else {
+ return getSelector(styleRule.getNextSibling(), selector, index);
+ }
+ default:
+ return getSelector(node.getParentNode(), selector, index);
}
}
return null;
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/StyleAttributes.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/StyleAttributes.java 2008-11-25 17:54:11 UTC (rev 12036)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/StyleAttributes.java 2008-11-25 18:00:37 UTC (rev 12037)
@@ -12,15 +12,19 @@
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.Constants;
+
/**
* Class is used to store an array of style attributes and support listeners.
*/
public class StyleAttributes {
- private HashMap<String, String> attributeMap;
+ private String cssSelector = null;
+ private HashMap<String, String> attributeMap = null;
private ArrayList<ChangeStyleListener> listeners = new ArrayList<ChangeStyleListener>();
/**
@@ -126,6 +130,7 @@
*/
public void clear() {
attributeMap.clear();
+ cssSelector = null;
notifyListeners();
}
@@ -138,4 +143,33 @@
listener.styleChanged(event);
}
}
+
+ /**
+ * @param cssSelector the cssSelector to set
+ */
+ public void setCssSelector(String cssSelector) {
+ this.cssSelector = cssSelector;
+ }
+
+ /**
+ * @return the cssSelector
+ */
+ public String getCssSelector() {
+ return cssSelector;
+ }
+
+ /**
+ * String representation of style attributes.
+ *
+ * @return style string representation
+ */
+ public String getStyle() {
+ // update newStyle value
+ StringBuffer buf = new StringBuffer();
+ Set<Entry<String, String>> set = entrySet();
+ for (Map.Entry<String, String> me : set) {
+ buf.append(me.getKey() + Constants.COLON + me.getValue() + Constants.SEMICOLON);
+ }
+ return buf.toString();
+ }
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPreviewControl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPreviewControl.java 2008-11-25 17:54:11 UTC (rev 12036)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPreviewControl.java 2008-11-25 18:00:37 UTC (rev 12037)
@@ -10,11 +10,11 @@
******************************************************************************/
package org.jboss.tools.jst.jsp.outline.cssdialog.tabs;
-import org.eclipse.core.resources.IFile;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.PartInitException;
@@ -24,7 +24,10 @@
import org.eclipse.ui.internal.WorkbenchPage;
import org.eclipse.ui.internal.WorkbenchWindow;
import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.jboss.tools.jst.jsp.messages.JstUIMessages;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.CSSModel;
import org.jboss.tools.jst.jsp.outline.cssdialog.events.StyleAttributes;
/**
@@ -35,8 +38,8 @@
/** Editor in which we open visual page. */
protected final static String EDITOR_ID = "org.eclipse.wst.css.core.csssource.source"; //$NON-NLS-1$
- private IFile cssFile = null;
private StructuredTextEditor editor = null;
+ private CSSModel cssModel = null;
/**
* Constructor for creating controls
@@ -46,15 +49,19 @@
public TabPreviewControl(Composite tabFolder, StyleAttributes styleAttributes) {
super(tabFolder, SWT.NONE);
setLayout(new FillLayout());
+ Label label = new Label(this, SWT.CENTER);
+ label.setText(JstUIMessages.DEFAULT_PREVIEW_TEXT);
}
/**
+ * Method update preview tab with information from the CSS file passed by parameter.
*
+ * @param cssFile CSS file to be displayed in preview area
*/
- public void updateDataFile(IFile cssFile) {
- if (cssFile != null) {
- this.cssFile = cssFile;
- IEditorInput input = new FileEditorInput(cssFile);
+ public void updatePreview(CSSModel cssModel) {
+ this.cssModel = cssModel;
+ if (cssModel != null) {
+ IEditorInput input = new FileEditorInput(cssModel.getStyleFile());
try {
WorkbenchWindow workbenchWindow = (WorkbenchWindow)PlatformUI.getWorkbench().getActiveWorkbenchWindow();
@@ -64,11 +71,9 @@
IEditorReference ref = editorManager.openEditor(EDITOR_ID, input, true, null);
if (ref != null) {
-// if (getChildren() != null && getChildren().length > 0) {
- if (editor != null) {
-// editor.doRevertToSaved();
-// editor.dispose();
- getChildren()[0].dispose();
+ // all preview tab editors should be disposed before adding new editor compoment
+ for (Control control : getChildren()) {
+ control.dispose();
}
editor = (StructuredTextEditor)ref.getEditor(true);
editor.createPartControl(this);
@@ -77,16 +82,37 @@
layout();
} catch (PartInitException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
}
}
+ /**
+ * Method is used to select area that corresponds to specific selector.
+ *
+ * @param selector the selector that should be selected in editor area
+ * @param index if CSS file contains more then one elements with the same selector name,
+ * then index is serial number of this selector
+ */
+ public void selectEditorArea(String selector, int index) {
+ IndexedRegion indexedRegion = cssModel.getSelectorRegion(selector, index);
+ if (editor != null && indexedRegion != null) {
+ editor.selectAndReveal(indexedRegion.getStartOffset(), indexedRegion.getLength());
+ }
+ }
+
+ /**
+ * Method is used to close CSS file editor correctly.
+ *
+ * @param save true if close editor with closure operation; false - otherwise
+ */
public void closeEditor(boolean save) {
if (editor != null) {
+ editor.doRevertToSaved();
editor.close(save);
- editor.doRevertToSaved();
}
+ if (cssModel != null) {
+ cssModel.releaseModel();
+ }
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabQuickEditControl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabQuickEditControl.java 2008-11-25 17:54:11 UTC (rev 12036)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabQuickEditControl.java 2008-11-25 18:00:37 UTC (rev 12037)
@@ -183,20 +183,6 @@
}
}
});
-
- colorCombo.addModifyListener(new ModifyListener() {
- String key = name;
- public void modifyText(ModifyEvent event) {
- if (!colorCombo.getText().trim().equals(Constants.EMPTY)) {
- styleAttributes.addAttribute(key, colorCombo.getText().trim());
- } else {
- styleAttributes.removeAttribute(key);
- }
- if (!updateDataFromStyleAttributes) {
- notifyListeners();
- }
- }
- });
HashMap<String, String> colorMap = ColorParser.getInstance().getMap();
for (String key : colorMap.keySet()) {
RGB rgb = Util.getColor(key);
@@ -207,7 +193,20 @@
}
colorCombo.setText(value);
- //if css attribute contain choose_folder button
+ colorCombo.addModifyListener(new ModifyListener() {
+ String key = name;
+ public void modifyText(ModifyEvent event) {
+ if (!colorCombo.getText().trim().equals(Constants.EMPTY)) {
+ styleAttributes.addAttribute(key, colorCombo.getText().trim());
+ } else {
+ styleAttributes.removeAttribute(key);
+ }
+ if (!updateDataFromStyleAttributes) {
+ notifyListeners();
+ }
+ }
+ });
+ // if css attribute contain choose_folder button
} else if (Util.containFolder(name)) {
Composite tmpComposite = getCompositeElement();
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/css/NewCSSClassWizard.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/css/NewCSSClassWizard.java 2008-11-25 17:54:11 UTC (rev 12036)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/css/NewCSSClassWizard.java 2008-11-25 18:00:37 UTC (rev 12037)
@@ -30,7 +30,7 @@
*/
public class NewCSSClassWizard extends Wizard implements INewWizard {
- private static final String WIZARD_WINDOW_TITLE = "New CSS Class";
+ private static final String WIZARD_WINDOW_TITLE = "CSS Style Class Editor";
// workbench selection when the wizard was started
protected IStructuredSelection selection;
@@ -98,7 +98,7 @@
// TODO: take out to the property manager file
final static String WIZARD_TITLE = "CSS Class";
- final static String WIZARD_DESCRIPTION = "Create New CSS Class.";
+ final static String WIZARD_DESCRIPTION = "Create New CSS Class";
private CSSClassDialog dialog;
15 years, 6 months
JBoss Tools SVN: r12036 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor: selection and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-11-25 12:54:11 -0500 (Tue, 25 Nov 2008)
New Revision: 12036
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/selection/VpeSelectionController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/KeyEventManager.java
Log:
JBIDE-3209, revert changed which was created previously
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 2008-11-25 17:29:18 UTC (rev 12035)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-11-25 17:54:11 UTC (rev 12036)
@@ -329,7 +329,7 @@
sourceEditor, visualSelectionController);
keyEventHandler = new KeyEventManager(sourceEditor, domMapping,
- pageContext,visualSelectionController);
+ pageContext);
// glory
ISelectionProvider provider = sourceEditor.getSelectionProvider();
@@ -3350,7 +3350,7 @@
sourceEditor, visualSelectionController);
keyEventHandler = new KeyEventManager(sourceEditor, domMapping,
- pageContext,visualSelectionController);
+ pageContext);
//restore selection in visula part
sourceSelectionChanged();
}finally {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/selection/VpeSelectionController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/selection/VpeSelectionController.java 2008-11-25 17:29:18 UTC (rev 12035)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/selection/VpeSelectionController.java 2008-11-25 17:54:11 UTC (rev 12036)
@@ -11,6 +11,7 @@
******************************************************************************/
package org.jboss.tools.vpe.editor.selection;
+
import org.mozilla.interfaces.nsISelection;
import org.mozilla.interfaces.nsISelectionController;
@@ -56,18 +57,6 @@
getSelectionController().setSelectionFlags(selectionFlags);
}
/**
- * @see nsISelectionController.lineMove()
- * @param forward
- * @param extend
- */
- public void lineMove(boolean forward, boolean extend) {
- //mareshkau, hack for JBIDE-3209
- getSelectionController().characterMove(forward, extend);
-// selectionController.characterMove(false, false);
-// selectionController.lineMove(forward, extend);
- }
-
- /**
* @return the selectionController
*/
private nsISelectionController getSelectionController() {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/KeyEventManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/KeyEventManager.java 2008-11-25 17:29:18 UTC (rev 12035)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/KeyEventManager.java 2008-11-25 17:54:11 UTC (rev 12036)
@@ -27,7 +27,6 @@
import org.jboss.tools.vpe.editor.util.TextUtil;
import org.mozilla.interfaces.nsIDOMKeyEvent;
import org.mozilla.interfaces.nsIDOMNode;
-import org.mozilla.interfaces.nsISelectionController;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -55,8 +54,6 @@
*/
private VpePageContext pageContext;
-
- private VpeSelectionController selectionController;
/**
*
*
@@ -67,12 +64,10 @@
*/
public KeyEventManager(StructuredTextEditor sourceEditor,
- VpeDomMapping domMapping, VpePageContext pageContext,
- VpeSelectionController selectionController) {
+ VpeDomMapping domMapping, VpePageContext pageContext) {
this.sourceEditor = sourceEditor;
this.domMapping = domMapping;
this.pageContext = pageContext;
- this.selectionController = selectionController;
}
final public boolean handleKeyPress(nsIDOMKeyEvent keyEvent) {
@@ -333,9 +328,6 @@
* @return whether handled event
*/
protected boolean handleDown(nsIDOMKeyEvent keyEvent) {
- selectionController.lineMove(true, false);
- keyEvent.stopPropagation();
- keyEvent.preventDefault();
return false;
}
@@ -362,9 +354,6 @@
* @return whether handled event
*/
protected boolean handleUp(nsIDOMKeyEvent keyEvent) {
- selectionController.lineMove(false, false);
- keyEvent.stopPropagation();
- keyEvent.preventDefault();
return false;
}
15 years, 6 months
JBoss Tools SVN: r12035 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-11-25 12:29:18 -0500 (Tue, 25 Nov 2008)
New Revision: 12035
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3282 Fixed
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2008-11-25 17:18:35 UTC (rev 12034)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2008-11-25 17:29:18 UTC (rev 12035)
@@ -400,7 +400,10 @@
Dialog.applyDialogFont(parent);
initDefaultWizardProperties();
- ((IDataModel)model.getProperty(FacetInstallDataModelProvider.MASTER_PROJECT_DM)).addListener(this);
+ Object parentDm = model.getProperty(FacetInstallDataModelProvider.MASTER_PROJECT_DM);
+ if(parentDm!=null) {
+ ((IDataModel)parentDm).addListener(this);
+ }
}
private boolean isNewSeamProjectWizard() {
15 years, 6 months
JBoss Tools SVN: r12034 - trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/figure.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-11-25 12:18:35 -0500 (Tue, 25 Nov 2008)
New Revision: 12034
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/figure/EndEventFigure.java
Log:
add new figure for end events
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/figure/EndEventFigure.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/figure/EndEventFigure.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/figure/EndEventFigure.java 2008-11-25 17:18:35 UTC (rev 12034)
@@ -0,0 +1,12 @@
+package org.jboss.tools.flow.jpdl4.figure;
+
+import org.jboss.tools.flow.common.figure.EllipseElementFigure;
+
+public class EndEventFigure extends EllipseElementFigure {
+
+ protected void customizeFigure() {
+ super.customizeFigure();
+ ellipse.setLineWidth(5);
+ }
+
+}
15 years, 6 months