Author: sdzmitrovich
Date: 2009-05-30 08:54:25 -0400 (Sat, 30 May 2009)
New Revision: 15616
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/StyleComposite.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/BaseTabControl.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/ICSSTabControl.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
Log:
https://jira.jboss.org/jira/browse/JBIDE-4395
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 2009-05-30
12:46:21 UTC (rev 15615)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java 2009-05-30
12:54:25 UTC (rev 15616)
@@ -218,6 +218,7 @@
clearButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
getStyleComposite().clearStyleComposite();
+ getStyleComposite().updateCurrentTab();
}
});
}
@@ -252,7 +253,7 @@
classCombo.setToolTipText(cssModel.getCSSRuleText(selectorLabel));
getStyleComposite().setStyleProperties(
cssModel.getClassProperties(selectorLabel));
- getStyleComposite().selectTab(StyleComposite.DEFAULT_START_TAB);
+ getStyleComposite().updateCurrentTab();
}
/**
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 2009-05-30
12:46:21 UTC (rev 15615)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/StyleComposite.java 2009-05-30
12:54:25 UTC (rev 15616)
@@ -69,10 +69,7 @@
tabFolder.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
-
- final TabItem tabItem = (TabItem) e.item;
- if (tabItem.getData() instanceof ICSSTabControl)
- ((ICSSTabControl) tabItem.getData()).tabSelected();
+ updateTab((TabItem) e.item);
}
public void widgetDefaultSelected(SelectionEvent e) {
@@ -145,6 +142,8 @@
tabComposite.setContent(baseTabControl);
tabComposite.setMinSize(baseTabControl.computeSize(SWT.DEFAULT,
SWT.DEFAULT));
+
+ tabFolder.setSelection(DEFAULT_START_TAB);
}
@@ -195,9 +194,17 @@
tabFolder.setSelection(index);
TabItem item = tabFolder.getItem(index);
- if (item.getData() instanceof ICSSTabControl)
- ((ICSSTabControl) item.getData()).tabSelected();
+ updateTab(item);
}
+ public void updateCurrentTab() {
+ updateTab(tabFolder.getSelection()[0]);
+ }
+
+ private void updateTab(TabItem item) {
+ if (item.getData() instanceof ICSSTabControl)
+ ((ICSSTabControl) item.getData()).update();
+ }
+
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/BaseTabControl.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/BaseTabControl.java 2009-05-30
12:46:21 UTC (rev 15615)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/BaseTabControl.java 2009-05-30
12:54:25 UTC (rev 15616)
@@ -505,7 +505,7 @@
}
- public void tabSelected() {
+ public void update() {
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/ICSSTabControl.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/ICSSTabControl.java 2009-05-30
12:46:21 UTC (rev 15615)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/ICSSTabControl.java 2009-05-30
12:54:25 UTC (rev 15616)
@@ -2,5 +2,5 @@
public interface ICSSTabControl {
- public void tabSelected();
+ public void update();
}
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 2009-05-30
12:46:21 UTC (rev 15615)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPreviewControl.java 2009-05-30
12:54:25 UTC (rev 15616)
@@ -111,7 +111,7 @@
}
}
- public void tabSelected() {
+ public void update() {
cssModel.updateCSSStyle(selector, styleAttributes);
selectClass(selector);
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 2009-05-30
12:46:21 UTC (rev 15615)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabQuickEditControl.java 2009-05-30
12:54:25 UTC (rev 15616)
@@ -45,24 +45,6 @@
}
/**
- * Update data method.
- */
- protected void updateData() {
-
- Control[] controls = this.getChildren();
- if (controls != null) {
- for (int i = 0; i < controls.length; i++) {
- if (!controls[i].isDisposed()) {
- controls[i].dispose();
- }
- }
- }
-
- addContent();
- this.layout();
- }
-
- /**
* Initialize method.s
*/
private void addContent() {
@@ -81,19 +63,25 @@
String value = getStyleAttributes().getAttribute(key);
if (value != null && value.length() > 0) {
- addLabel(this, getLabel(key));
+ addLabel(this, key);
createControl(this, key);
}
}
}
@Override
- public void tabSelected() {
- updateData();
- }
+ public void update() {
+ Control[] controls = this.getChildren();
+ if (controls != null) {
+ for (int i = 0; i < controls.length; i++) {
+ if (!controls[i].isDisposed()) {
+ controls[i].dispose();
+ }
+ }
+ }
- private String getLabel(String key) {
- return key;
+ addContent();
+ this.layout();
}
}
\ No newline at end of file