Author: izhukov
Date: 2008-12-05 11:21:55 -0500 (Fri, 05 Dec 2008)
New Revision: 12313
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java
Log:
set delay to any change event on classStyle combo component: changes applied with 1 second
delay
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-12-05
15:37:41 UTC (rev 12312)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java 2008-12-05
16:21:55 UTC (rev 12313)
@@ -276,8 +276,6 @@
styleChanged = true;
if (currentClassStyle != null &&
!currentClassStyle.equals(Constants.EMPTY)
&& currentFile != null &&
!currentFile.equals(Constants.EMPTY)) {
-// styleComposite.updateStyle();
-// cssModel.setCSS(currentClassStyle, styleAttributes);
applyButton.setEnabled(true);
}
}
@@ -362,7 +360,6 @@
});
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
- // TODO:
// IResource project = Util.getCurrentProject();
IResource project = ResourcesPlugin.getWorkspace().getRoot();
@@ -422,7 +419,7 @@
}
});
}
-
+
/**
* This method is used to create and initialize style class comboBox component.
*
@@ -448,19 +445,13 @@
return;
}
}
- cssStyleClassChanged();
- applyButton.setEnabled(false);
keyInputSelector = false;
}
});
// add key modified listener
classCombo.addKeyListener(new KeyAdapter() {
public void keyReleased(KeyEvent e) {
- if ((currentClassStyle != null &&
currentClassStyle.equals(classCombo.getText().trim()))
- || (currentClassStyle == null &&
classCombo.getText().trim().equals(Constants.EMPTY))) {
- return;
- }
- notifyKeyChanged();
+ keyInputSelector = true;
}
});
// this listener is responsible for processing dialog header message events
@@ -476,14 +467,21 @@
IStatus status = findMostSevere();
notifyListeners(classCombo, status);
applyToStatusLine(status);
+ // update CSS style cmposite if needed
+ if ((currentClassStyle != null &&
currentClassStyle.equals(classCombo.getText().trim()))
+ || (currentClassStyle == null &&
classCombo.getText().trim().equals(Constants.EMPTY))) {
+ return;
+ }
+ notifyStyleClassChanged();
+ applyButton.setEnabled(false);
}
});
}
/**
- * This method is invoked to correctly process class style combo key event.
+ * This method is invoked to correctly process class style combo modify event.
*/
- private void notifyKeyChanged() {
+ private void notifyStyleClassChanged() {
Display display = null;
if (PlatformUI.isWorkbenchRunning()) {
display = PlatformUI.getWorkbench().getDisplay();
@@ -500,8 +498,6 @@
// start operation
cssStyleClassChanged();
- applyButton.setEnabled(true);
- keyInputSelector = true;
// end operation
monitor.done();
@@ -550,11 +546,8 @@
clearButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
styleComposite.clearStyleComposite(currentClassStyle);
- styleComposite.revertPreview();
+ styleComposite.updatePreview(currentClassStyle);
styleComposite.updateStyle();
-// if (currentClassStyle != null &&
!currentClassStyle.equals(Constants.EMPTY)) {
-// cssModel.setCSS(currentClassStyle, styleAttributes);
-// }
applyButton.setEnabled(true);
styleChanged = true;
}
Show replies by date