Author: dmaliarevich
Date: 2009-09-30 09:23:51 -0400 (Wed, 30 Sep 2009)
New Revision: 17817
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/selbar/SelectionBar.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4914, selection bar refresh was updated.
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2009-09-30
12:49:41 UTC (rev 17816)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2009-09-30
13:23:51 UTC (rev 17817)
@@ -1168,7 +1168,9 @@
* controller could be null.
*/
if (getController() != null) {
- selectionBar.setVisible(selectionBar.getAlwaysVisibleOption());
+ selectionBar.setVisible(JspEditorPlugin.getDefault()
+ .getPreferenceStore().getBoolean(
+ IVpePreferencesPage.SHOW_SELECTION_TAG_BAR));
fillContainer(false, null);
getController().getVisualBuilder().setShowInvisibleTags(JspEditorPlugin.getDefault().getPreferenceStore().getBoolean(
IVpePreferencesPage.SHOW_NON_VISUAL_TAGS));
@@ -1179,7 +1181,6 @@
public void updateSelectionBar(boolean isSelectionBarVisible) {
if (selectionBar != null) {
- selectionBar.setAlwaysVisibleOption(isSelectionBarVisible);
selectionBar.setVisible(isSelectionBarVisible);
} else {
VpePlugin.getDefault().logError("VPE Selection Bar is not initialized.");
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/selbar/SelectionBar.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/selbar/SelectionBar.java 2009-09-30
12:49:41 UTC (rev 17816)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/selbar/SelectionBar.java 2009-09-30
13:23:51 UTC (rev 17817)
@@ -98,12 +98,6 @@
private Node currentSelectedNode = null;
private Node currentLastNode = null;
-// private ToolItem arrowButton;
-
-
- final static String PREFERENCE_YES = "yes"; //$NON-NLS-1$
- final static String PREFERENCE_NO = "no"; //$NON-NLS-1$
-
public Composite createToolBarComposite(Composite parent, boolean visible) {
splitter = new Splitter(parent, SWT.NONE);
splitter.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@@ -147,7 +141,6 @@
setAskConfirmationOnClosingSelectionBar(dialog.getToggleState());
}
- setAlwaysVisibleOption(false);
setVisible(false);
}
};
@@ -175,36 +168,6 @@
return splitter;
}
- private void setPersistentOption(String name, String value) {
- XModelObject optionsObject = getOptionsObject();
- optionsObject.setAttributeValue(name, value);
-
- /*
- * Fixes
http://jira.jboss.com/jira/browse/JBIDE-2298
- * To get stored in xml XModelObject
- * should be marked as modified.
- */
- optionsObject.setModified(true);
- performStore(optionsObject);
- }
-
- private XModelObject getOptionsObject() {
- XModelObject optionsObject = ModelUtilities.getPreferenceModel()
- .getByPath(VpePreference.VPE_EDITOR_PATH);
- return optionsObject;
- }
-
- public void setAlwaysVisibleOption(boolean visible) {
- final String optionValue;
- if (visible) {
- optionValue = PREFERENCE_YES;
- } else {
- optionValue = PREFERENCE_NO;
- }
-
- setPersistentOption(VpePreference.ATT_SHOW_SELECTION_TAG_BAR, optionValue);
- }
-
public boolean getAlwaysVisibleOption() {
return JspEditorPlugin.getDefault().getPreferenceStore().getBoolean(
IVpePreferencesPage.SHOW_SELECTION_TAG_BAR);
@@ -561,39 +524,6 @@
public void widgetDefaultSelected(SelectionEvent e) {
}
- /**
- * Performs storing model object in the model and xml file.
- *
- * @param xmo the model object to store
- */
- private void performStore(XModelObject xmo) {
- if (null == xmo || null == xmo.getModel()
- || null == xmo.getModelEntity()) {
- return;
- }
-
- ArrayList<IModelPropertyEditorAdapter> adapters = new
ArrayList<IModelPropertyEditorAdapter>();
- XAttribute[] attribute = xmo.getModelEntity().getAttributes();
- for (int i = 0; i < attribute.length; i++) {
- if(!attribute[i].isVisible()) {
- continue;
- }
- IModelPropertyEditorAdapter adapter = AdapterFactory.getAdapter(attribute[i], xmo,
xmo.getModel());
- adapters.add(adapter);
- }
- /*
- * Stores model object by its adaptors.
- */
- for (IModelPropertyEditorAdapter adapter : adapters) {
- adapter.store();
- }
-
- /*
- * Saves model options
- */
- xmo.getModel().saveOptions();
- }
-
@Override
public String toString() {
StringBuffer st = new StringBuffer("CountItem: "); //$NON-NLS-1$