Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2008-08-21 13:03:29 -0400
committerkmoore2008-08-21 13:03:29 -0400
commit249a117a96f027ecd864b0962cf33d96e70aa16b (patch)
treeac83a25273e23f0dd73570fc6ef5c3588373516c
parent70f5fd613d6ddf6c94b006a4ca5d3fecfe7ca66a (diff)
downloadwebtools.dali-249a117a96f027ecd864b0962cf33d96e70aa16b.tar.gz
webtools.dali-249a117a96f027ecd864b0962cf33d96e70aa16b.tar.xz
webtools.dali-249a117a96f027ecd864b0962cf33d96e70aa16b.zip
removed extra ListChangeListener in AddRemoveListPane
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AddRemoveListPane.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AddRemovePane.java55
2 files changed, 87 insertions, 61 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AddRemoveListPane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AddRemoveListPane.java
index 40f530e058..65465de16e 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AddRemoveListPane.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AddRemoveListPane.java
@@ -13,7 +13,6 @@ import org.eclipse.jface.viewers.IBaseLabelProvider;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jpt.ui.internal.listeners.SWTListChangeListenerWrapper;
import org.eclipse.jpt.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
import org.eclipse.jpt.ui.internal.swt.ColumnAdapter;
import org.eclipse.jpt.ui.internal.swt.TableModelAdapter;
@@ -25,7 +24,6 @@ import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionMod
import org.eclipse.jpt.utility.model.Model;
import org.eclipse.jpt.utility.model.event.ListChangeEvent;
import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
import org.eclipse.jpt.utility.model.value.ListValueModel;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
@@ -210,48 +208,52 @@ public class AddRemoveListPane<T extends Model> extends AddRemovePane<T>
};
}
- private ListChangeListener buildListChangeListener() {
- return new SWTListChangeListenerWrapper(buildListChangeListener_());
+ @Override
+ protected void itemsAdded(ListChangeEvent e) {
+ super.itemsAdded(e);
+ if (!this.table.isDisposed()) {
+ this.table.getParent().layout();
+ }
}
-
- private ListChangeListener buildListChangeListener_() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent e) {
- if (!table.isDisposed()) {
- table.getParent().layout();
- }
- }
-
- public void itemsMoved(ListChangeEvent e) {
- if (!table.isDisposed()) {
- table.getParent().layout();
- }
- }
-
- public void itemsRemoved(ListChangeEvent e) {
- if (!table.isDisposed()) {
- table.getParent().layout();
- }
- }
-
- public void itemsReplaced(ListChangeEvent e) {
- if (!table.isDisposed()) {
- table.getParent().layout();
- }
- }
-
- public void listChanged(ListChangeEvent e) {
- if (!table.isDisposed()) {
- table.getParent().layout();
- }
- }
-
- public void listCleared(ListChangeEvent e) {
- if (!table.isDisposed()) {
- table.getParent().layout();
- }
- }
- };
+
+ @Override
+ protected void itemsMoved(ListChangeEvent e) {
+ super.itemsMoved(e);
+ if (!this.table.isDisposed()) {
+ this.table.getParent().layout();
+ }
+ }
+
+ @Override
+ protected void itemsRemoved(ListChangeEvent e) {
+ super.itemsRemoved(e);
+ if (!this.table.isDisposed()) {
+ this.table.getParent().layout();
+ }
+ }
+
+ @Override
+ protected void itemsReplaced(ListChangeEvent e) {
+ super.itemsReplaced(e);
+ if (!this.table.isDisposed()) {
+ this.table.getParent().layout();
+ }
+ }
+
+ @Override
+ protected void listChanged(ListChangeEvent e) {
+ super.listChanged(e);
+ if (!this.table.isDisposed()) {
+ this.table.getParent().layout();
+ }
+ }
+
+ @Override
+ protected void listCleared(ListChangeEvent e) {
+ super.listCleared(e);
+ if (!this.table.isDisposed()) {
+ this.table.getParent().layout();
+ }
}
private SimplePropertyValueModel<Object> buildSelectedItemHolder() {
@@ -458,11 +460,6 @@ public class AddRemoveListPane<T extends Model> extends AddRemovePane<T>
buildSelectedItemPropertyChangeListener()
);
- listHolder.addListChangeListener(
- ListValueModel.LIST_VALUES,
- buildListChangeListener()
- );
-
initializeTable(table);
}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AddRemovePane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AddRemovePane.java
index 2a1df95058..96ae1cc920 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AddRemovePane.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AddRemovePane.java
@@ -262,38 +262,67 @@ public abstract class AddRemovePane<T extends Model> extends AbstractPane<T>
return new ListChangeListener() {
public void itemsAdded(ListChangeEvent e) {
+ AddRemovePane.this.itemsAdded(e);
}
public void itemsMoved(ListChangeEvent e) {
+ AddRemovePane.this.itemsMoved(e);
}
public void itemsRemoved(ListChangeEvent e) {
- Object selectedItem = selectedItemHolder.getValue();
-
- if (selectedItem == null) {
- updateButtons();
- return;
- }
-
- if (CollectionTools.contains(e.items(), selectedItem)) {
- selectedItemHolder.setValue(null);
- updateButtons();
- }
+ AddRemovePane.this.itemsRemoved(e);
}
public void itemsReplaced(ListChangeEvent e) {
+ AddRemovePane.this.itemsReplaced(e);
}
public void listChanged(ListChangeEvent e) {
+ AddRemovePane.this.listChanged(e);
}
public void listCleared(ListChangeEvent e) {
- selectedItemHolder.setValue(null);
- updateButtons();
+ AddRemovePane.this.listCleared(e);
}
};
}
+ protected void itemsAdded(ListChangeEvent e) {
+
+ }
+
+ protected void itemsMoved(ListChangeEvent e) {
+
+ }
+
+ protected void itemsRemoved(ListChangeEvent e) {
+ Object selectedItem = this.selectedItemHolder.getValue();
+
+ if (selectedItem == null) {
+ updateButtons();
+ return;
+ }
+
+ if (CollectionTools.contains(e.items(), selectedItem)) {
+ this.selectedItemHolder.setValue(null);
+ updateButtons();
+ }
+ }
+
+ protected void itemsReplaced(ListChangeEvent e) {
+
+ }
+
+ protected void listChanged(ListChangeEvent e) {
+
+ }
+
+ protected void listCleared(ListChangeEvent e) {
+ this.selectedItemHolder.setValue(null);
+ updateButtons();
+ }
+
+
/**
* @category Option
*/

Back to the top