Author: mareshkau
Date: 2008-11-05 12:32:59 -0500 (Wed, 05 Nov 2008)
New Revision: 11531
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/xpl/CustomSashForm.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
Log:
JBIDE-3093, fix from izhukov
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/xpl/CustomSashForm.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/xpl/CustomSashForm.java 2008-11-05
17:20:00 UTC (rev 11530)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/xpl/CustomSashForm.java 2008-11-05
17:32:59 UTC (rev 11531)
@@ -29,6 +29,7 @@
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Sash;
+import org.jboss.tools.vpe.messages.VpeUIMessages;
/**
* A SashForm that allows move to/from max controls on sash.
@@ -64,10 +65,10 @@
NO_MAX_DOWN = NO_MAX_RIGHT; // Custom style bit for not allow max down
- private static final int NO_WEIGHT = -1;
+ private static final int NO_WEIGHT = -1;
private static final int NO_ARROW = -1;
- private final static String LAYOUT_RATIO = "layout ratio";
- private final static String WEIGHTS = "weights";
+ private final static String WEIGHTS = "weights"; //$NON-NLS-1$
+
private static class SashInfo {
public Sash sash;
public boolean enabled; // Whether this sashinfo is enabled (i.e. if there is more than
one, this will be disabled).
@@ -95,7 +96,7 @@
protected boolean sashBorders[]; // Whether cooresponding control needs a sash border
protected boolean noMaxUp, noMaxDown;
- protected List customSashFormListeners = null;
+ protected List<ICustomSashFormListener> customSashFormListeners = null;
protected PropertyChangeSupport listeners = new PropertyChangeSupport(this);
protected static final int
@@ -293,11 +294,11 @@
* @see org.eclipse.swt.events.ControlAdapter#controlMoved(ControlEvent)
*/
public void controlMoved(ControlEvent e) {
- if(e.widget instanceof Sash){
- Sash s = (Sash) e.widget;
- String text = s.getToolTipText();
+// if(e.widget instanceof Sash){
+// Sash s = (Sash) e.widget;
+// String text = s.getToolTipText();
// if(text.equalsIgnoreCase(anotherString))
- }
+// }
recomputeSashInfo();
}
@@ -336,7 +337,7 @@
int loc = vertical ? x : y;
int locIndex = vertical ? X_INDEX : Y_INDEX;
int sizeIndex = vertical ? WIDTH_INDEX : HEIGHT_INDEX;
- if (locs[locIndex] <= loc && loc <= locs[locIndex]+locs[sizeIndex])
{
+ if (locs[locIndex] <= loc && loc <= locs[locIndex]+locs[sizeIndex])
{
if (currentSashInfo.cursorOver == NO_ARROW) {
currentSashInfo.sash.setCursor(Cursors.ARROW);
}
@@ -346,11 +347,13 @@
switch (locs[ARROW_TYPE_INDEX]) {
case UP_ARROW:
case DOWN_ARROW:
- currentSashInfo.sash.setToolTipText("Restore Previous Location");
+ currentSashInfo.sash.setToolTipText(VpeUIMessages.RESTORE_PREVIOUS_LOCATION);
break;
case UP_MAX_ARROW:
+ currentSashInfo.sash.setToolTipText(VpeUIMessages.MAX_VISUAL_PANE);
+ break;
case DOWN_MAX_ARROW:
- currentSashInfo.sash.setToolTipText("Maximize Pane");
+ currentSashInfo.sash.setToolTipText(VpeUIMessages.MAX_SOURCE_PANE);
break;
}
}
@@ -366,7 +369,7 @@
}
});
-
+
// Need to know when we leave so that we can clear the cursor feedback if set.
newSash.addMouseTrackListener(new MouseTrackAdapter() {
/**
@@ -496,7 +499,7 @@
} else {
addArrows = new int[2];
drawArrows = new int[2];
- // TODO: SashForm as changed the folllwing is a temporary kludge
+ // TODO: SashForm as changed the following is a temporary kludge
Rectangle sashBounds = currentSashInfo.sash.getBounds();
Rectangle clientArea = getClientArea();
final int DRAG_MINIMUM = 20; // TODO: kludge see SashForm.DRAG_MINIMUM
@@ -910,20 +913,21 @@
* @since 1.2.0
*/
public void addCustomSashFormListener(ICustomSashFormListener listener){
- if(customSashFormListeners==null)
- customSashFormListeners = new ArrayList();
+ if (customSashFormListeners == null) {
+ customSashFormListeners = new ArrayList<ICustomSashFormListener>();
+ }
customSashFormListeners.add(listener);
}
/**
* Removes the custom sashform listener.
- *
+ *
* @param listener
- *
+ *
* @since 1.2.0
*/
public void removeCustomSashFormListener(ICustomSashFormListener listener){
- if(customSashFormListeners!=null){
+ if (customSashFormListeners != null) {
customSashFormListeners.remove(listener);
}
}
@@ -934,7 +938,7 @@
if(weights!=null && weights.length==2){
int firstControlWeight = weights[0];
int secondControlWeight = weights[1];
- for (Iterator listenerItr = customSashFormListeners.iterator();
listenerItr.hasNext();) {
+ for (Iterator<ICustomSashFormListener> listenerItr =
customSashFormListeners.iterator(); listenerItr.hasNext();) {
ICustomSashFormListener listener = (ICustomSashFormListener) listenerItr.next();
listener.dividerMoved(firstControlWeight, secondControlWeight);
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2008-11-05
17:20:00 UTC (rev 11530)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2008-11-05
17:32:59 UTC (rev 11531)
@@ -1,103 +1,106 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.messages;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.osgi.util.NLS;
-import org.jboss.tools.vpe.VpePlugin;
-
-public class VpeUIMessages extends NLS {
- private static final String BUNDLE_NAME =
"org.jboss.tools.vpe.messages.messages";//$NON-NLS-1$
- private static ResourceBundle fResourceBundle;
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, VpeUIMessages.class);
- }
- private VpeUIMessages(){}
-
- public static ResourceBundle getResourceBundle() {
- try {
- if (fResourceBundle == null)
- fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME, Locale.getDefault());
- }
- catch (MissingResourceException x) {
- VpePlugin.getPluginLog().logError(x);
- fResourceBundle = null;
- }
- return fResourceBundle;
- }
-
- public static String NAMESPACE_NOT_DEFINED;
- public static String PREFERENCES;
- public static String REFRESH;
- public static String PAGE_DESIGN_OPTIONS;
- public static String HIDE_SELECTIONBAR;
- public static String MOZILLA_LOADING_ERROR;
- public static String MOZILLA_LOADING_ERROR_LINK_TEXT;
- public static String MOZILLA_LOADING_ERROR_LINK;
- public static String SHOW_COMMENTS;
- public static String SHOW_BORDER_FOR_UNKNOWN_TAGS;
- public static String SHOW_BORDER_FOR_ALL_TAGS;
- public static String USE_DETAIL_BORDER;
- public static String SHOW_RESOURCE_BUNDLES_USAGE_AS_EL;
- public static String USE_ABSOLUTE_POSITION;
- public static String ALWAYS_PROMPT_FOR_TAG_ATTRIBUTES_DURING_TAG_INSERT;
- public static String OPTION_LIST;
- public static String SOURCE_VISUAL_EDITORS_WEIGHTS;
- public static String GENERAL;
- public static String TEMPLATES;
- public static String TEMPLATE;
- public static String TAG_ATTRIBUTES;
- public static String TAG_NAME;
- public static String CHILDREN;
- public static String DISPLAY;
- public static String ICON;
- public static String VALUE;
- public static String VALUE_COLOR;
- public static String VALUE_BACKGROUND_COLOR;
- public static String BACKGROUND_COLOR;
- public static String BORDER;
- public static String BORDER_COLOR;
- public static String ERROR_OF_TYPE_CONVERSION;
- public static String INCORRECT_PARAMETER_ERROR;
- public static String HIDE_TOOLBAR;
- public static String SHOW_TOOLBAR;
- public static String MENU;
- public static String SET_BACKGROUND_COLOR;
- public static String SET_FOREGROUND_COLOR;
- public static String TEXT_FORMATTING;
- public static String BLOCK_FORMAT;
- public static String FONT_NAME;
- public static String FONT_SIZE;
- public static String BOLD;
- public static String ITALIC;
- public static String UNDERLINE;
- public static String FOREGROUND_COLOR;
- public static String ALIGN_LEFT;
- public static String CENTER;
- public static String ALIGN_RIGHT;
- public static String JUSTIFY;
- public static String BULLETS;
- public static String NUMBERING;
- public static String CONFIRM_SELECTION_BAR_DIALOG_TITLE;
- public static String CONFIRM_SELECTION_BAR_DIALOG_MESSAGE;
- public static String CONFIRM_SELECTION_BAR_DIALOG_TOGGLE_MESSAGE;
- public static String VPE_UPDATE_JOB_TITLE;
- public static String VPE_VISUAL_REFRESH_JOB;
- public static String NON_VISUAL_TAGS;
- public static String SHOW;
- public static String HIDE;
- public static String TAG_FOR_DISPLAY;
- public static String STYLE;
-}
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.messages;
+
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.vpe.VpePlugin;
+
+public class VpeUIMessages extends NLS {
+ private static final String BUNDLE_NAME =
"org.jboss.tools.vpe.messages.messages";//$NON-NLS-1$
+ private static ResourceBundle fResourceBundle;
+ static {
+ // load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, VpeUIMessages.class);
+ }
+ private VpeUIMessages(){}
+
+ public static ResourceBundle getResourceBundle() {
+ try {
+ if (fResourceBundle == null)
+ fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME, Locale.getDefault());
+ }
+ catch (MissingResourceException x) {
+ VpePlugin.getPluginLog().logError(x);
+ fResourceBundle = null;
+ }
+ return fResourceBundle;
+ }
+
+ public static String NAMESPACE_NOT_DEFINED;
+ public static String PREFERENCES;
+ public static String REFRESH;
+ public static String PAGE_DESIGN_OPTIONS;
+ public static String HIDE_SELECTIONBAR;
+ public static String MOZILLA_LOADING_ERROR;
+ public static String MOZILLA_LOADING_ERROR_LINK_TEXT;
+ public static String MOZILLA_LOADING_ERROR_LINK;
+ public static String SHOW_COMMENTS;
+ public static String SHOW_BORDER_FOR_UNKNOWN_TAGS;
+ public static String SHOW_BORDER_FOR_ALL_TAGS;
+ public static String USE_DETAIL_BORDER;
+ public static String SHOW_RESOURCE_BUNDLES_USAGE_AS_EL;
+ public static String USE_ABSOLUTE_POSITION;
+ public static String ALWAYS_PROMPT_FOR_TAG_ATTRIBUTES_DURING_TAG_INSERT;
+ public static String OPTION_LIST;
+ public static String SOURCE_VISUAL_EDITORS_WEIGHTS;
+ public static String GENERAL;
+ public static String TEMPLATES;
+ public static String TEMPLATE;
+ public static String TAG_ATTRIBUTES;
+ public static String TAG_NAME;
+ public static String CHILDREN;
+ public static String DISPLAY;
+ public static String ICON;
+ public static String VALUE;
+ public static String VALUE_COLOR;
+ public static String VALUE_BACKGROUND_COLOR;
+ public static String BACKGROUND_COLOR;
+ public static String BORDER;
+ public static String BORDER_COLOR;
+ public static String ERROR_OF_TYPE_CONVERSION;
+ public static String INCORRECT_PARAMETER_ERROR;
+ public static String HIDE_TOOLBAR;
+ public static String SHOW_TOOLBAR;
+ public static String MENU;
+ public static String SET_BACKGROUND_COLOR;
+ public static String SET_FOREGROUND_COLOR;
+ public static String TEXT_FORMATTING;
+ public static String BLOCK_FORMAT;
+ public static String FONT_NAME;
+ public static String FONT_SIZE;
+ public static String BOLD;
+ public static String ITALIC;
+ public static String UNDERLINE;
+ public static String FOREGROUND_COLOR;
+ public static String ALIGN_LEFT;
+ public static String CENTER;
+ public static String ALIGN_RIGHT;
+ public static String JUSTIFY;
+ public static String BULLETS;
+ public static String NUMBERING;
+ public static String CONFIRM_SELECTION_BAR_DIALOG_TITLE;
+ public static String CONFIRM_SELECTION_BAR_DIALOG_MESSAGE;
+ public static String CONFIRM_SELECTION_BAR_DIALOG_TOGGLE_MESSAGE;
+ public static String VPE_UPDATE_JOB_TITLE;
+ public static String VPE_VISUAL_REFRESH_JOB;
+ public static String NON_VISUAL_TAGS;
+ public static String SHOW;
+ public static String HIDE;
+ public static String TAG_FOR_DISPLAY;
+ public static String STYLE;
+ public static String MAX_SOURCE_PANE;
+ public static String MAX_VISUAL_PANE;
+ public static String RESTORE_PREVIOUS_LOCATION;
+}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2008-11-05
17:20:00 UTC (rev 11530)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2008-11-05
17:32:59 UTC (rev 11531)
@@ -1,64 +1,66 @@
-NAMESPACE_NOT_DEFINED=Namespace not defined. Template could not be edit.
-ACTUAL_RUN_TIME_ABSOLUTE_FOLDER=Actual Run-Time Absolute Folder
-PREFERENCES=Preferences
-REFRESH=Refresh
-PAGE_DESIGN_OPTIONS=Page Design Options
-HIDE_SELECTIONBAR=Hide Selection Bar
-SHOW_BORDER_FOR_ALL_TAGS=show border for all tags
-MOZILLA_LOADING_ERROR=The VPE editor can't be run because your system environment
needs to be changed slightly.
-MOZILLA_LOADING_ERROR_LINK_TEXT=Find out more.
-MOZILLA_LOADING_ERROR_LINK=http://labs.jboss.com/wiki/JBosstoolsVisualEditorFAQ
-SHOW_COMMENTS=show comments
-SHOW_BORDER_FOR_UNKNOWN_TAGS=show border for unknown tags
-USE_DETAIL_BORDER=use detail border
-SHOW_RESOURCE_BUNDLES_USAGE_AS_EL=show resource bundles usage as EL expressions
-USE_ABSOLUTE_POSITION=use absolute position
-ALWAYS_PROMPT_FOR_TAG_ATTRIBUTES_DURING_TAG_INSERT=always prompt for tag attributes
during tag insert
-OPTION_LIST=option list
-SOURCE_VISUAL_EDITORS_WEIGHTS=Size of Visual Editor pane 0-100%
-GENERAL=General
-TEMPLATES=Templates
-TEMPLATE=Template
-TAG_ATTRIBUTES=Tag Attributes
-TAG_NAME=Tag Name:
-CHILDREN=Children
-DISPLAY=Display
-ICON=Icon
-VALUE=Value
-VALUE_COLOR=Value Color
-VALUE_BACKGROUND_COLOR=Value Background Color
-BACKGROUND_COLOR=Background Color
-BORDER=Border
-BORDER_COLOR=Border Color
-ERROR_OF_TYPE_CONVERSION=Error of type conversion
-INCORRECT_PARAMETER_ERROR=Incorrect parameter error
-HIDE_TOOLBAR=Hide Text Formatting Toolbar
-SHOW_TOOLBAR=Show Text Formatting Toolbar
-MENU=Menu
-SET_BACKGROUND_COLOR=Set Background Color
-SET_FOREGROUND_COLOR=Set Foreground color
-TEXT_FORMATTING=Text Formatting
-BLOCK_FORMAT=Block Format
-FONT_NAME=Font Name
-FONT_SIZE=Font Size
-BOLD=Bold
-ITALIC=Italic
-UNDERLINE=Underline
-FOREGROUND_COLOR=Foreground Color
-ALIGN_LEFT=Align Left
-CENTER=Center
-ALIGN_RIGHT=Align Right
-JUSTIFY=Justify
-BULLETS=Bullets
-NUMBERING=Numbering
-CONFIRM_SELECTION_BAR_DIALOG_TITLE=Confirm hide selection bar
-CONFIRM_SELECTION_BAR_DIALOG_MESSAGE=Hide selection bar ?
-CONFIRM_SELECTION_BAR_DIALOG_TOGGLE_MESSAGE=Always hide selection bar without prompt
-VPE_UPDATE_JOB_TITLE=Visual Editor View Update
-VPE_VISUAL_REFRESH_JOB=Visual Editor Refresh
-NON_VISUAL_TAGS=Non-visual tags
-SHOW=Show
-HIDE=Hide
-TAG_FOR_DISPLAY=Tag for Display
-STYLE=Style
-
+NAMESPACE_NOT_DEFINED=Namespace not defined. Template could not be edit.
+ACTUAL_RUN_TIME_ABSOLUTE_FOLDER=Actual Run-Time Absolute Folder
+PREFERENCES=Preferences
+REFRESH=Refresh
+PAGE_DESIGN_OPTIONS=Page Design Options
+HIDE_SELECTIONBAR=Hide Selection Bar
+SHOW_BORDER_FOR_ALL_TAGS=show border for all tags
+MOZILLA_LOADING_ERROR=The VPE editor can't be run because your system environment
needs to be changed slightly.
+MOZILLA_LOADING_ERROR_LINK_TEXT=Find out more.
+MOZILLA_LOADING_ERROR_LINK=http://labs.jboss.com/wiki/JBosstoolsVisualEditorFAQ
+SHOW_COMMENTS=show comments
+SHOW_BORDER_FOR_UNKNOWN_TAGS=show border for unknown tags
+USE_DETAIL_BORDER=use detail border
+SHOW_RESOURCE_BUNDLES_USAGE_AS_EL=show resource bundles usage as EL expressions
+USE_ABSOLUTE_POSITION=use absolute position
+ALWAYS_PROMPT_FOR_TAG_ATTRIBUTES_DURING_TAG_INSERT=always prompt for tag attributes
during tag insert
+OPTION_LIST=option list
+SOURCE_VISUAL_EDITORS_WEIGHTS=Size of Visual Editor pane 0-100%
+GENERAL=General
+TEMPLATES=Templates
+TEMPLATE=Template
+TAG_ATTRIBUTES=Tag Attributes
+TAG_NAME=Tag Name:
+CHILDREN=Children
+DISPLAY=Display
+ICON=Icon
+VALUE=Value
+VALUE_COLOR=Value Color
+VALUE_BACKGROUND_COLOR=Value Background Color
+BACKGROUND_COLOR=Background Color
+BORDER=Border
+BORDER_COLOR=Border Color
+ERROR_OF_TYPE_CONVERSION=Error of type conversion
+INCORRECT_PARAMETER_ERROR=Incorrect parameter error
+HIDE_TOOLBAR=Hide Text Formatting Toolbar
+SHOW_TOOLBAR=Show Text Formatting Toolbar
+MENU=Menu
+SET_BACKGROUND_COLOR=Set Background Color
+SET_FOREGROUND_COLOR=Set Foreground color
+TEXT_FORMATTING=Text Formatting
+BLOCK_FORMAT=Block Format
+FONT_NAME=Font Name
+FONT_SIZE=Font Size
+BOLD=Bold
+ITALIC=Italic
+UNDERLINE=Underline
+FOREGROUND_COLOR=Foreground Color
+ALIGN_LEFT=Align Left
+CENTER=Center
+ALIGN_RIGHT=Align Right
+JUSTIFY=Justify
+BULLETS=Bullets
+NUMBERING=Numbering
+CONFIRM_SELECTION_BAR_DIALOG_TITLE=Confirm hide selection bar
+CONFIRM_SELECTION_BAR_DIALOG_MESSAGE=Hide selection bar ?
+CONFIRM_SELECTION_BAR_DIALOG_TOGGLE_MESSAGE=Always hide selection bar without prompt
+VPE_UPDATE_JOB_TITLE=Visual Editor View Update
+VPE_VISUAL_REFRESH_JOB=Visual Editor Refresh
+NON_VISUAL_TAGS=Non-visual tags
+SHOW=Show
+HIDE=Hide
+TAG_FOR_DISPLAY=Tag for Display
+STYLE=Style
+MAX_SOURCE_PANE=Maximize Source Pane
+MAX_VISUAL_PANE=Maximize Visual Pane
+RESTORE_PREVIOUS_LOCATION=Restore Previous Location