Author: yzhishko
Date: 2010-03-29 08:32:52 -0400 (Mon, 29 Mar 2010)
New Revision: 21113
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/cssselector/CSSSelectorPartComposite.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/cssselector/dnd/CSSTableDropAdapter.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6092 - some minor fixes.
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/cssselector/CSSSelectorPartComposite.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/cssselector/CSSSelectorPartComposite.java 2010-03-29
11:48:12 UTC (rev 21112)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/cssselector/CSSSelectorPartComposite.java 2010-03-29
12:32:52 UTC (rev 21113)
@@ -443,7 +443,8 @@
int selectionLength = selectedIndices.length;
for (int i = 0; i < selectionLength; i++) {
CSSSelectionEventManager.getInstance().setHandleSelection(false);
- selectedClassesTableViewer.remove(selectedItems[selectionLength - 1 - i]);
+ selectedClassesTableViewer.remove(selectedItems[selectionLength - 1
+ - i]);
if (selectedIndices[selectionLength - 1 - i] == itemsCount - 1) {
TableItem item = new TableItem(selectedClassesTableViewer
.getTable(), selectedClassesTableViewer.getTable()
@@ -461,6 +462,7 @@
selectedClassesTableViewer.refresh();
selectedClassesTableViewer.setSelection(new StructuredSelection(
selectedItems));
+ updateStyles();
}
private void handleMoveUp() {
@@ -487,6 +489,7 @@
selectedClassesTableViewer.refresh();
selectedClassesTableViewer.setSelection(new StructuredSelection(
selectedItems));
+ updateStyles();
}
public void widgetSelected(SelectionEvent e) {
@@ -536,6 +539,7 @@
}
selectedClassesTableViewer.add(itemsToMove.toArray());
updateStyles();
+ allCSSStyleClassViewer.setSelection(new StructuredSelection());
}
}
@@ -592,8 +596,6 @@
}
}
allCSSStyleClassViewer.refresh();
- allCSSStyleClassViewer.setSelection(new StructuredSelection());
- selectedClassesTableViewer.setSelection(new StructuredSelection());
}
public String getCSSStyleClasses() {
@@ -642,14 +644,17 @@
private void fireClassSelectionChanged(
final CSSClassSelectionChangedEvent event) {
- SafeRunner.run(new SafeRunnable() {
- public void run() throws Exception {
- for (int i = 0; i < changedListeners.size(); i++) {
- changedListeners.get(i).classSelectionChanged(event);
+ for (int i = 0; i < changedListeners.size(); i++) {
+ final ICSSClassSelectionChangedListener listener = changedListeners
+ .get(i);
+ SafeRunner.run(new SafeRunnable() {
+ public void run() throws Exception {
+ for (int i = 0; i < changedListeners.size(); i++) {
+ listener.classSelectionChanged(event);
+ }
}
- }
- });
-
+ });
+ }
}
public synchronized void addCSSClassSelectionChangedListener(
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/cssselector/dnd/CSSTableDropAdapter.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/cssselector/dnd/CSSTableDropAdapter.java 2010-03-29
11:48:12 UTC (rev 21112)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/cssselector/dnd/CSSTableDropAdapter.java 2010-03-29
12:32:52 UTC (rev 21113)
@@ -97,6 +97,7 @@
}
parent.updateStyles();
}
+ treeViewer.setSelection(new StructuredSelection());
}
}
@@ -188,6 +189,7 @@
} else {
handleTableMiddleInsert(event);
}
+ parent.updateStyles();
}
private int getItemIndex(TableItem item) {
@@ -221,7 +223,8 @@
}
if (pt.y < bounds.y + bounds.height / 3) {
for (int i = 0; i < selectedItems.size(); i++) {
- CSSSelectionEventManager.getInstance().setHandleSelection(false);
+ CSSSelectionEventManager.getInstance()
+ .setHandleSelection(false);
tableViewer.remove(selectedItems.get(i));
itemIndex = getItemIndex(item);
TableItem tableItem = new TableItem(tableViewer.getTable(),
@@ -233,7 +236,8 @@
true);
} else if (pt.y > bounds.y + 2 * bounds.height / 3) {
for (int i = 0; i < selectedItems.size(); i++) {
- CSSSelectionEventManager.getInstance().setHandleSelection(false);
+ CSSSelectionEventManager.getInstance()
+ .setHandleSelection(false);
tableViewer.remove(selectedItems.get(i));
itemIndex = getItemIndex(item);
itemIndex = itemIndex + i + 1;