Author: mareshkau
Date: 2008-09-16 09:42:48 -0400 (Tue, 16 Sep 2008)
New Revision: 10251
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/META-INF/MANIFEST.MF
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSDialog.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/TabPropertySheetMouseAdapter.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/ColorParser.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBackgroundControl.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBoxesControl.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.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabTextControl.java
Log:
JBIDE-2521 some code adjustment
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/META-INF/MANIFEST.MF 2008-09-16 13:20:22 UTC
(rev 10250)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/META-INF/MANIFEST.MF 2008-09-16 13:42:48 UTC
(rev 10251)
@@ -14,6 +14,7 @@
org.jboss.tools.jst.jsp.editor,
org.jboss.tools.jst.jsp.jspeditor,
org.jboss.tools.jst.jsp.outline,
+ org.jboss.tools.jst.jsp.outline.cssdialog.common,
org.jboss.tools.jst.jsp.preferences,
org.jboss.tools.jst.jsp.support.kb,
org.jboss.tools.jst.jsp.text,
@@ -58,4 +59,5 @@
org.eclipse.core.runtime,
org.eclipse.ui.views
Bundle-Version: 2.0.0
+Export-Package: org.jboss.tools.jst.jsp.outline.cssdialog.parsers
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSDialog.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSDialog.java 2008-09-16
13:20:22 UTC (rev 10250)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSDialog.java 2008-09-16
13:42:48 UTC (rev 10251)
@@ -34,8 +34,6 @@
import org.jboss.tools.jst.jsp.outline.cssdialog.common.MessageUtil;
import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.BaseListener;
import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.CSSElementsParser;
-import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParser;
-import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParserListener;
import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ComboParser;
import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.Parser;
import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ParserListener;
@@ -142,11 +140,6 @@
});
cssParser.parse();
- ColorParserListener colorListener = new ColorParserListener();
- ColorParser colorParser = new ColorParser();
- colorParser.setListener(colorListener);
- colorParser.parse();
-
}
/**
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-09-16
13:20:22 UTC (rev 10250)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Util.java 2008-09-16
13:42:48 UTC (rev 10251)
@@ -14,9 +14,8 @@
import java.util.HashMap;
import java.util.Set;
import java.util.StringTokenizer;
-
import org.eclipse.swt.graphics.RGB;
-import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParserListener;
+import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParser;
/**
*
@@ -27,13 +26,13 @@
*/
public class Util {
- private static String RGB = "rgb";
+ private static String RGB = "rgb"; //$NON-NLS-1$
- private static String NONE = "none";
+ private static String NONE = "none"; //$NON-NLS-1$
- private static String THIN = "thin";
+ private static String THIN = "thin"; //$NON-NLS-1$
- private static String COMMA = ",";
+ private static String COMMA = ","; //$NON-NLS-1$
private static int START_INDEX_RED = 1;
private static int END_INDEX_RED = 3;
@@ -57,9 +56,9 @@
private static char CLOSE_BRACKET = '}';
private static char SHARP = '#';
- private static String SHARP_STRING = "#";
+ private static String SHARP_STRING = "#"; //$NON-NLS-1$
- private static String ZERO_STR = "0";
+ private static String ZERO_STR = "0"; //$NON-NLS-1$
private static int NORMAL_MIN_VALUE = 10;
/**
@@ -190,7 +189,7 @@
if (j == COUNT_COLORS)
return convertColorRGB(color);
} else {
- HashMap<String, String> colorMap = ColorParserListener.getMap();
+ HashMap<String, String> colorMap = ColorParser.getInstance().getMap();
for (String key : colorMap.keySet())
if (colorMap.get(key).equalsIgnoreCase(color))
@@ -319,8 +318,8 @@
: Constants.EMPTY_STRING)
+ Integer.toHexString(rgb.blue);
colorStr = colorStr.toUpperCase();
- if (ColorParserListener.getMap().get(colorStr) != null)
- return ColorParserListener.getMap().get(colorStr);
+ if (ColorParser.getInstance().getMap().get(colorStr) != null)
+ return ColorParser.getInstance().getMap().get(colorStr);
return colorStr;
}
}
\ No newline at end of file
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/TabPropertySheetMouseAdapter.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/TabPropertySheetMouseAdapter.java 2008-09-16
13:20:22 UTC (rev 10250)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/TabPropertySheetMouseAdapter.java 2008-09-16
13:42:48 UTC (rev 10251)
@@ -45,7 +45,6 @@
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
-
import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.outline.cssdialog.CSSDialog;
import org.jboss.tools.jst.jsp.outline.cssdialog.FontFamilyDialog;
@@ -55,7 +54,7 @@
import org.jboss.tools.jst.jsp.outline.cssdialog.common.ImageCombo;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.MessageUtil;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.Util;
-import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParserListener;
+import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParser;
import org.jboss.tools.jst.jsp.outline.cssdialog.tabs.TabPropertySheetControl;
/**
@@ -163,7 +162,7 @@
// create combo for color
colorCombo = new ImageCombo(panel, SWT.BORDER);
- HashMap<String, String> colorMap = ColorParserListener.getMap();
+ HashMap<String, String> colorMap = ColorParser.getInstance().getMap();
for (String key : colorMap.keySet()) {
RGB rgb = Util.getColor(key);
@@ -208,7 +207,7 @@
button.getImage().dispose();
}
});
- btn.setToolTipText(MessageUtil.getString("COLOR_DIALOG_TITLE"));
+ btn.setToolTipText(MessageUtil.getString("COLOR_DIALOG_TITLE"));
//$NON-NLS-1$
btn.addSelectionListener(new SelectionAdapter() {
@@ -223,15 +222,15 @@
ColorDialog colorDialog = new ColorDialog(tree.getShell());
colorDialog.setRGB(startRgb);
colorDialog.setText(MessageUtil
- .getString("COLOR_DIALOG_TITLE"));
+ .getString("COLOR_DIALOG_TITLE")); //$NON-NLS-1$
RGB rgb = colorDialog.open();
if (rgb != null) {
String str = Util.createColorString(rgb);
- if (ColorParserListener.getMap().get(str) != null)
+ if (ColorParser.getInstance().getMap().get(str) != null)
item.setText(Constants.SECOND_COLUMN,
- ColorParserListener.getMap().get(str));
+ ColorParser.getInstance().getMap().get(str));
else
item.setText(Constants.SECOND_COLUMN, str);
@@ -258,7 +257,7 @@
button.getImage().dispose();
}
});
- btn.setToolTipText(MessageUtil.getString("IMAGE_DIALOG_MESSAGE"));
+ btn.setToolTipText(MessageUtil.getString("IMAGE_DIALOG_MESSAGE"));
//$NON-NLS-1$
btn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
@@ -269,11 +268,11 @@
new WorkbenchContentProvider());
dialog
.setTitle(MessageUtil
- .getString("IMAGE_DIALOG_TITLE"));
+ .getString("IMAGE_DIALOG_TITLE")); //$NON-NLS-1$
dialog.setMessage(MessageUtil
- .getString("IMAGE_DIALOG_MESSAGE"));
+ .getString("IMAGE_DIALOG_MESSAGE")); //$NON-NLS-1$
dialog.setEmptyListMessage(MessageUtil
- .getString("IMAGE_DIALOG_EMPTY_MESSAGE"));
+ .getString("IMAGE_DIALOG_EMPTY_MESSAGE")); //$NON-NLS-1$
dialog.setAllowMultiple(false);
dialog.setInput(project);
if (dialog.open() == ImageSelectionDialog.OK) {
@@ -390,7 +389,7 @@
button.getImage().dispose();
}
});
- btn.setToolTipText(MessageUtil.getString("FONT_FAMILY_TIP"));
+ btn.setToolTipText(MessageUtil.getString("FONT_FAMILY_TIP"));
//$NON-NLS-1$
btn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/ColorParser.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/ColorParser.java 2008-09-16
13:20:22 UTC (rev 10250)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/ColorParser.java 2008-09-16
13:42:48 UTC (rev 10251)
@@ -12,69 +12,99 @@
import java.io.IOException;
import java.io.InputStream;
+import java.util.HashMap;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
/**
*
* Parser for parse colors elements
*
+ * --==Singleton==--
+ *
* @author Evgeny Zheleznyakov
- *
+ *
*/
public class ColorParser {
- private String FILE_NAME = "cssdialog/colors.xml";
-
- private ColorParserListener listener;
-
private SAXParserFactory fact;
private SAXParser saxParser;
+
+ private HashMap<String, String> map;
+
+ private static ColorParser colorParser = null;
+
+ private static final String NODE_NAME_COLOR = "color"; //$NON-NLS-1$
+ private static final String NODE_ATTRIBUTE_NAME = "name"; //$NON-NLS-1$
+
+ private static final String NODE_ATTRIBUTE_VALUE = "value"; //$NON-NLS-1$
+
+ private static final String FILE_NAME = "cssdialog/colors.xml";
//$NON-NLS-1$
+
+ public static synchronized ColorParser getInstance() {
+
+ if(colorParser==null) {
+ colorParser = new ColorParser();
+ }
+ return colorParser;
+ }
/**
* Constructor for Color parser
*/
- public ColorParser() {
+ private ColorParser() {
- try {
- fact = SAXParserFactory.newInstance();
- saxParser = fact.newSAXParser();
+ try {
+ fact = SAXParserFactory.newInstance();
+ saxParser = fact.newSAXParser();
+ } catch (ParserConfigurationException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ } catch (SAXException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ }
- } catch (ParserConfigurationException e) {
- JspEditorPlugin.getPluginLog().logError(e);
- } catch (SAXException e) {
- JspEditorPlugin.getPluginLog().logError(e);
- }
+ parse();
}
/**
* Parse the content of the file specified as XML using the specified
*/
- public void parse() {
- try {
- InputStream is =
JspEditorPlugin.getDefault().getBundle().getResource(FILE_NAME).openStream();
- saxParser.parse(is, listener);
- } catch (SAXException e) {
- JspEditorPlugin.getPluginLog().logError(e);
- } catch (IOException e) {
- JspEditorPlugin.getPluginLog().logError(e);
+ private void parse() {
+
+ try {
+ InputStream is =
JspEditorPlugin.getDefault().getBundle().getResource(FILE_NAME).openStream();
+ saxParser.parse(is, new DefaultHandler()
+ {
+ public void startElement(String uri, String localName, String nodeName,
+ Attributes attrs) {
+
+ if (nodeName.trim().equalsIgnoreCase(NODE_NAME_COLOR)) {
+ getMap().put(attrs.getValue(NODE_ATTRIBUTE_NAME).trim().toUpperCase(),
+ attrs.getValue(NODE_ATTRIBUTE_VALUE).trim());
+ }
+ }
+ });
+ } catch (SAXException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ } catch (IOException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ }
+ }
+ /**
+ * @return the map
+ */
+ public HashMap<String, String> getMap() {
+ if(map==null) {
+ map = new HashMap<String, String>();
+ }
+ return map;
}
-
- }
-
- /**
- * Method for set listener
- *
- * @param listener
- * ColorParseListener
- */
- public void setListener(ColorParserListener listener) {
- this.listener = listener;
- }
-}
\ No newline at end of file
+}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBackgroundControl.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBackgroundControl.java 2008-09-16
13:20:22 UTC (rev 10250)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBackgroundControl.java 2008-09-16
13:42:48 UTC (rev 10251)
@@ -15,7 +15,6 @@
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -48,8 +47,9 @@
import org.jboss.tools.jst.jsp.outline.cssdialog.common.ImageCombo;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.MessageUtil;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.Util;
-import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParserListener;
+import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParser;
+
/**
* Class for creating control in Background tab
*
@@ -83,13 +83,13 @@
Label label = new Label(this, SWT.LEFT);
label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
false));
- label.setText(MessageUtil.getString("BACKGROUND_COLOR"));
+ label.setText(MessageUtil.getString("BACKGROUND_COLOR")); //$NON-NLS-1$
colorCombo = new ImageCombo(this, SWT.BORDER);
colorCombo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
true, false));
// ////////////////////////////////////////////////////////////////////////
- Set<Entry<String, String>> set = ColorParserListener.getMap()
+ Set<Entry<String, String>> set = ColorParser.getInstance().getMap()
.entrySet();
for (Map.Entry<String, String> me : set) {
@@ -113,7 +113,7 @@
Button button = new Button(this, SWT.PUSH);
button.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
false));
- button.setToolTipText(MessageUtil.getString("BACKGROUND_COLOR_TIP"));
+ button.setToolTipText(MessageUtil.getString("BACKGROUND_COLOR_TIP"));
//$NON-NLS-1$
ImageDescriptor colorDesc = JspEditorPlugin
.getImageDescriptor(Constants.IMAGE_COLORLARGE_FILE_LOCATION);
Image im = colorDesc.createImage();
@@ -132,7 +132,7 @@
.setRGB(Util.getColor((colorCombo.getText().trim())) == null ? new RGB(
0, 0, 0)
: Util.getColor((colorCombo.getText().trim())));
- dlg.setText(MessageUtil.getString("COLOR_DIALOG_TITLE"));
+ dlg.setText(MessageUtil.getString("COLOR_DIALOG_TITLE")); //$NON-NLS-1$
RGB rgb = dlg.open();
if (rgb != null) {
String colorStr = Util.createColorString(rgb);
@@ -144,7 +144,7 @@
label = new Label(this, SWT.LEFT);
label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
false));
- label.setText(MessageUtil.getString("BACKGROUND_IMAGE"));
+ label.setText(MessageUtil.getString("BACKGROUND_IMAGE")); //$NON-NLS-1$
backgroundImageCombo = new Combo(this, SWT.BORDER);
final GridData backgroundImageGridData = new GridData(GridData.FILL,
@@ -168,7 +168,7 @@
button = new Button(this, SWT.PUSH);
button.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
false));
- button.setToolTipText(MessageUtil.getString("BACKGROUND_IMAGE"));
+ button.setToolTipText(MessageUtil.getString("BACKGROUND_IMAGE"));
//$NON-NLS-1$
ImageDescriptor imageDesc = JspEditorPlugin
.getImageDescriptor(Constants.IMAGE_FOLDERLARGE_FILE_LOCATION);
Image image = imageDesc.createImage();
@@ -185,12 +185,12 @@
ImageSelectionDialog dialog = new ImageSelectionDialog(
getShell(), new WorkbenchLabelProvider(),
new WorkbenchContentProvider());
- dialog.setTitle(MessageUtil.getString("IMAGE_DIALOG_TITLE"));
+ dialog.setTitle(MessageUtil.getString("IMAGE_DIALOG_TITLE")); //$NON-NLS-1$
dialog
.setMessage(MessageUtil
- .getString("IMAGE_DIALOG_MESSAGE"));
+ .getString("IMAGE_DIALOG_MESSAGE")); //$NON-NLS-1$
dialog.setEmptyListMessage(MessageUtil
- .getString("IMAGE_DIALOG_EMPTY_MESSAGE"));
+ .getString("IMAGE_DIALOG_EMPTY_MESSAGE")); //$NON-NLS-1$
dialog.setAllowMultiple(false);
dialog.setInput(project);
if (dialog.open() == ImageSelectionDialog.OK) {
@@ -205,7 +205,7 @@
label = new Label(this, SWT.LEFT);
label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
false));
- label.setText(MessageUtil.getString("BACKGROUND_REPEAT"));
+ label.setText(MessageUtil.getString("BACKGROUND_REPEAT")); //$NON-NLS-1$
backgroundRepeatCombo = new Combo(this, SWT.BORDER);
backgroundRepeatCombo.setLayoutData(new GridData(GridData.FILL,
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBoxesControl.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBoxesControl.java 2008-09-16
13:20:22 UTC (rev 10250)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBoxesControl.java 2008-09-16
13:42:48 UTC (rev 10251)
@@ -15,7 +15,6 @@
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
-
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
@@ -42,8 +41,9 @@
import org.jboss.tools.jst.jsp.outline.cssdialog.common.ImageCombo;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.MessageUtil;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.Util;
-import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParserListener;
+import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParser;
+
/**
* Class for creating control in Box tab
*
@@ -96,9 +96,9 @@
label.setFont(JFaceResources.getFontRegistry().get(
JFaceResources.BANNER_FONT));
- label.setText(MessageUtil.getString("DIMENSION_TITLE"));
+ label.setText(MessageUtil.getString("DIMENSION_TITLE")); //$NON-NLS-1$
label = new Label(this, SWT.LEFT);
- label.setText(MessageUtil.getString("WIDTH"));
+ label.setText(MessageUtil.getString("WIDTH")); //$NON-NLS-1$
label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
false));
@@ -154,7 +154,7 @@
}
label = new Label(this, SWT.LEFT);
- label.setText(MessageUtil.getString("HEIGHT"));
+ label.setText(MessageUtil.getString("HEIGHT")); //$NON-NLS-1$
label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
false));
@@ -213,12 +213,12 @@
false, false, 3, 1));
label.setFont(JFaceResources.getFontRegistry().get(
JFaceResources.BANNER_FONT));
- label.setText(MessageUtil.getString("BORDER_TITLE"));
+ label.setText(MessageUtil.getString("BORDER_TITLE")); //$NON-NLS-1$
label = new Label(this, SWT.LEFT);
label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
false));
- label.setText(MessageUtil.getString("BORDER_STYLE"));
+ label.setText(MessageUtil.getString("BORDER_STYLE")); //$NON-NLS-1$
borderStyleCombo = new Combo(this, SWT.BORDER);
@@ -252,7 +252,7 @@
label = new Label(this, SWT.LEFT);
label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
false));
- label.setText(MessageUtil.getString("BORDER_COLOR"));
+ label.setText(MessageUtil.getString("BORDER_COLOR")); //$NON-NLS-1$
borderColorCombo = new ImageCombo(this, SWT.BORDER);
@@ -273,7 +273,7 @@
borderColorCombo.setLayoutData(new GridData(GridData.FILL,
GridData.CENTER, true, false));
- Set<Entry<String, String>> set = ColorParserListener.getMap()
+ Set<Entry<String, String>> set = ColorParser.getInstance().getMap()
.entrySet();
for (Map.Entry<String, String> me : set) {
@@ -284,7 +284,7 @@
final Button button = new Button(this, SWT.PUSH);
button.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
false));
- button.setToolTipText(MessageUtil.getString("BORDER_COLOR_TIP"));
+ button.setToolTipText(MessageUtil.getString("BORDER_COLOR_TIP"));
//$NON-NLS-1$
ImageDescriptor colorDesc = JspEditorPlugin
.getImageDescriptor(Constants.IMAGE_COLORLARGE_FILE_LOCATION);
Image im = colorDesc.createImage();
@@ -303,7 +303,7 @@
.setRGB(Util.getColor((borderColorCombo.getText()
.trim())) == null ? Constants.RGB_BLACK : Util
.getColor((borderColorCombo.getText().trim())));
- dlg.setText(MessageUtil.getString("COLOR_DIALOG_TITLE"));
+ dlg.setText(MessageUtil.getString("COLOR_DIALOG_TITLE")); //$NON-NLS-1$
RGB rgb = dlg.open();
if (rgb != null) {
String colorStr = Util.createColorString(rgb);
@@ -313,7 +313,7 @@
});
label = new Label(this, SWT.LEFT);
- label.setText(MessageUtil.getString("BORDER_WIDTH"));
+ label.setText(MessageUtil.getString("BORDER_WIDTH")); //$NON-NLS-1$
label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
false));
@@ -412,10 +412,10 @@
false, false, 3, 1));
label.setFont(JFaceResources.getFontRegistry().get(
JFaceResources.BANNER_FONT));
- label.setText(MessageUtil.getString("MARGIN_PADDING_TITLE"));
+ label.setText(MessageUtil.getString("MARGIN_PADDING_TITLE")); //$NON-NLS-1$
label = new Label(this, SWT.LEFT);
- label.setText(MessageUtil.getString("MARGIN"));
+ label.setText(MessageUtil.getString("MARGIN")); //$NON-NLS-1$
label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
false));
@@ -471,7 +471,7 @@
}
label = new Label(this, SWT.LEFT);
- label.setText(MessageUtil.getString("PADDING"));
+ label.setText(MessageUtil.getString("PADDING")); //$NON-NLS-1$
label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
false));
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-09-16
13:20:22 UTC (rev 10250)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabQuickEditControl.java 2008-09-16
13:42:48 UTC (rev 10251)
@@ -14,7 +14,6 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.StringTokenizer;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -50,8 +49,9 @@
import org.jboss.tools.jst.jsp.outline.cssdialog.common.ImageCombo;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.MessageUtil;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.Util;
-import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParserListener;
+import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParser;
+
/**
*
* Class for creating control in Quick edit tab
@@ -61,10 +61,10 @@
*/
public class TabQuickEditControl extends Composite {
- private static String COLON_STRING = ":";
- private static String SPACE_STRING = " ";
+ private static String COLON_STRING = ":"; //$NON-NLS-1$
+ private static String SPACE_STRING = " "; //$NON-NLS-1$
- private static String DASH_STRING = "-";
+ private static String DASH_STRING = "-"; //$NON-NLS-1$
private static int FIRST_INDEX = 0;
private static int SECOND_INDEX = 1;
@@ -148,7 +148,7 @@
.getImageDescriptor(Constants.IMAGE_COLOR_FILE_LOCATION);
Image colorImage = imageDes.createImage();
btn.setImage(colorImage);
- btn.setToolTipText(MessageUtil.getString("COLOR_DIALOG_TITLE"));
+ btn.setToolTipText(MessageUtil.getString("COLOR_DIALOG_TITLE"));
//$NON-NLS-1$
btn.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
Button button = (Button) e.getSource();
@@ -169,14 +169,14 @@
.getShell());
colorDialog.setRGB(startRgb);
colorDialog.setText(MessageUtil
- .getString("COLOR_DIALOG_TITLE"));
+ .getString("COLOR_DIALOG_TITLE")); //$NON-NLS-1$
RGB rgb = colorDialog.open();
if (rgb != null) {
String str = Util.createColorString(rgb);
- if (ColorParserListener.getMap().get(str) != null)
- colorCombo.setText(ColorParserListener.getMap()
+ if (ColorParser.getInstance().getMap().get(str) != null)
+ colorCombo.setText(ColorParser.getInstance().getMap()
.get(str));
else
colorCombo.setText(str);
@@ -200,7 +200,7 @@
}
});
- HashMap<String, String> colorMap = ColorParserListener.getMap();
+ HashMap<String, String> colorMap = ColorParser.getInstance().getMap();
for (String key : colorMap.keySet()) {
RGB rgb = Util.getColor(key);
@@ -231,7 +231,7 @@
button.getImage().dispose();
}
});
- btn.setToolTipText(MessageUtil.getString("COLOR_DIALOG_TITLE"));
+ btn.setToolTipText(MessageUtil.getString("COLOR_DIALOG_TITLE"));
//$NON-NLS-1$
ArrayList<String> list = comboMap.get(name);
for (String str : list)
combo.add(str);
@@ -244,11 +244,11 @@
new WorkbenchContentProvider());
dialog
.setTitle(MessageUtil
- .getString("IMAGE_DIALOG_TITLE"));
+ .getString("IMAGE_DIALOG_TITLE")); //$NON-NLS-1$
dialog.setMessage(MessageUtil
- .getString("IMAGE_DIALOG_MESSAGE"));
+ .getString("IMAGE_DIALOG_MESSAGE")); //$NON-NLS-1$
dialog.setEmptyListMessage(MessageUtil
- .getString("IMAGE_DIALOG_EMPTY_MESSAGE"));
+ .getString("IMAGE_DIALOG_EMPTY_MESSAGE")); //$NON-NLS-1$
dialog.setAllowMultiple(false);
dialog.setInput(project);
if (dialog.open() == ImageSelectionDialog.OK) {
@@ -408,7 +408,7 @@
.getImageDescriptor(Constants.IMAGE_FONT_FILE_LOCATION);
Image fontImage = imageDes.createImage();
btn.setImage(fontImage);
- btn.setToolTipText(MessageUtil.getString("FONT_FAMILY_TIP"));
+ btn.setToolTipText(MessageUtil.getString("FONT_FAMILY_TIP"));
//$NON-NLS-1$
btn.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
Button button = (Button) e.getSource();
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabTextControl.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabTextControl.java 2008-09-16
13:20:22 UTC (rev 10250)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabTextControl.java 2008-09-16
13:42:48 UTC (rev 10251)
@@ -15,7 +15,6 @@
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
-
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
@@ -43,8 +42,9 @@
import org.jboss.tools.jst.jsp.outline.cssdialog.common.ImageCombo;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.MessageUtil;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.Util;
-import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParserListener;
+import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParser;
+
/**
* Class for creating Text tab controls
*
@@ -88,7 +88,7 @@
setLayout(gridLayout);
Label label = new Label(this, SWT.LEFT);
- label.setText(MessageUtil.getString("FONT_FAMILY"));
+ label.setText(MessageUtil.getString("FONT_FAMILY")); //$NON-NLS-1$
label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
false));
@@ -112,7 +112,7 @@
Button button = new Button(this, SWT.PUSH);
button.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
false));
- button.setToolTipText(MessageUtil.getString("FONT_FAMILY_TIP"));
+ button.setToolTipText(MessageUtil.getString("FONT_FAMILY_TIP"));
//$NON-NLS-1$
ImageDescriptor fontDesc = JspEditorPlugin
.getImageDescriptor(Constants.IMAGE_FONTLARGE_FILE_LOCATION);
Image fontImage = fontDesc.createImage();
@@ -135,7 +135,7 @@
label = new Label(this, SWT.LEFT);
label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
false));
- label.setText(MessageUtil.getString("COLOR"));
+ label.setText(MessageUtil.getString("COLOR")); //$NON-NLS-1$
colorCombo = new ImageCombo(this, SWT.BORDER);
colorCombo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
@@ -156,7 +156,7 @@
////////////////////////////////////////////////////////////////////////
// //
- Set<Entry<String, String>> set = ColorParserListener.getMap()
+ Set<Entry<String, String>> set = ColorParser.getInstance().getMap()
.entrySet();
for (Map.Entry<String, String> me : set) {
@@ -169,7 +169,7 @@
button = new Button(this, SWT.PUSH);
button.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
false));
- button.setToolTipText(MessageUtil.getString("COLOR_TIP"));
+ button.setToolTipText(MessageUtil.getString("COLOR_TIP")); //$NON-NLS-1$
ImageDescriptor colorDesc = JspEditorPlugin
.getImageDescriptor(Constants.IMAGE_COLORLARGE_FILE_LOCATION);
Image im = colorDesc.createImage();
@@ -187,7 +187,7 @@
dlg
.setRGB(Util.getColor((colorCombo.getText().trim())) == null ? Constants.RGB_BLACK
: Util.getColor((colorCombo.getText().trim())));
- dlg.setText(MessageUtil.getString("COLOR_DIALOG_TITLE"));
+ dlg.setText(MessageUtil.getString("COLOR_DIALOG_TITLE")); //$NON-NLS-1$
RGB rgb = dlg.open();
if (rgb != null) {
String colorStr = Util.createColorString(rgb);
@@ -199,7 +199,7 @@
label = new Label(this, SWT.LEFT);
label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
false));
- label.setText(MessageUtil.getString("FONT_SIZE"));
+ label.setText(MessageUtil.getString("FONT_SIZE")); //$NON-NLS-1$
fontSizeCombo = new Combo(this, SWT.BORDER | SWT.SINGLE);
@@ -275,7 +275,7 @@
label = new Label(this, SWT.LEFT);
label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
false));
- label.setText(MessageUtil.getString("FONT_STYLE"));
+ label.setText(MessageUtil.getString("FONT_STYLE")); //$NON-NLS-1$
fontStyleCombo = new Combo(this, SWT.BORDER);
@@ -308,7 +308,7 @@
label = new Label(this, SWT.LEFT);
label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
false));
- label.setText(MessageUtil.getString("FONT_WEIGHT"));
+ label.setText(MessageUtil.getString("FONT_WEIGHT")); //$NON-NLS-1$
fontWeigthCombo = new Combo(this, SWT.BORDER);
@@ -341,7 +341,7 @@
label = new Label(this, SWT.LEFT);
label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
false));
- label.setText(MessageUtil.getString("TEXT_DECORATION"));
+ label.setText(MessageUtil.getString("TEXT_DECORATION")); //$NON-NLS-1$
textDecorationCombo = new Combo(this, SWT.BORDER);
@@ -374,7 +374,7 @@
label = new Label(this, SWT.LEFT);
label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
false));
- label.setText(MessageUtil.getString("TEXT_ALIGN"));
+ label.setText(MessageUtil.getString("TEXT_ALIGN")); //$NON-NLS-1$
textAlignCombo = new Combo(this, SWT.BORDER);