Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2010-04-05 20:41:50 +0000
committerkmoore2010-04-05 20:41:50 +0000
commite5e856827aa522da5aac2ea19694edf931ef5e1a (patch)
tree2ca5a1c3261edfed4364b6387ebb19fe05ae9b0a
parent05ad76eb2a832eeb91b03baf598b6b4c82a35269 (diff)
downloadwebtools.dali-e5e856827aa522da5aac2ea19694edf931ef5e1a.tar.gz
webtools.dali-e5e856827aa522da5aac2ea19694edf931ef5e1a.tar.xz
webtools.dali-e5e856827aa522da5aac2ea19694edf931ef5e1a.zip
switch from CCombo to Combo
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkConvertComposite.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkExpiryComposite.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkObjectTypeConverterComposite.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkConvert1_0Composite.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/CacheStatementsPropertiesComposite.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/SessionNameComposite.java13
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/SessionsXmlComposite.java13
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/TargetDatabaseComposite.java13
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/TargetServerComposite.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/CreateDdlFileNameComposite.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/DropDdlFileNameComposite.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_details.properties4
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/WidgetFactory.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/AbstractInheritanceComposite.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/EntityNameComposite.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/GeneratedValueComposite.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/swt/CComboModelAdapter.java210
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/SWTUtil.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/utility/swt/SWTCComboAdapter.java121
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/utility/swt/SWTTools.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/ComboPane.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/DefaultWidgetFactory.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumComboViewer.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumDialogComboViewer.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumFormComboViewer.java18
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FileChooserComboPane.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FolderChooserComboPane.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FormWidgetFactory.java18
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/IntegerCombo.java17
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/Pane.java365
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/CComboModelAdapterTest.java75
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/JptUiSWTTests.java3
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/utility/swt/DropDownListBoxModelBindingUITest.java75
33 files changed, 140 insertions, 1053 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkConvertComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkConvertComposite.java
index e6d3488c65..0ff0e3663b 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkConvertComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkConvertComposite.java
@@ -38,8 +38,8 @@ import org.eclipse.jpt.utility.model.value.ListValueModel;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
/**
@@ -85,7 +85,7 @@ public class EclipseLinkConvertComposite extends Pane<EclipseLinkConvert>
@Override
protected void initializeLayout(Composite container) {
- CCombo combo = addLabeledEditableCCombo(
+ Combo combo = addLabeledEditableCombo(
container,
EclipseLinkUiDetailsMessages.EclipseLinkConvertComposite_converterNameLabel,
buildConvertNameListHolder(),
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkExpiryComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkExpiryComposite.java
index f7c789c450..82fc7962bc 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkExpiryComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkExpiryComposite.java
@@ -17,9 +17,9 @@ import org.eclipse.jpt.utility.internal.StringConverter;
import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
@@ -211,8 +211,8 @@ public class EclipseLinkExpiryComposite extends Pane<EclipseLinkCaching> {
return new IntegerCombo<EclipseLinkCaching>(this, container) {
@Override
- protected CCombo addIntegerCombo(Composite container) {
- return this.addEditableCCombo(
+ protected Combo addIntegerCombo(Composite container) {
+ return this.addEditableCombo(
container,
buildDefaultListHolder(),
buildSelectedItemStringHolder(),
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkObjectTypeConverterComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkObjectTypeConverterComposite.java
index b3e8ba6554..29916f1800 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkObjectTypeConverterComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkObjectTypeConverterComposite.java
@@ -85,7 +85,7 @@ public class EclipseLinkObjectTypeConverterComposite extends Pane<EclipseLinkObj
addConversionValuesTable(container);
- addLabeledEditableCCombo(
+ addLabeledEditableCombo(
container,
EclipseLinkUiDetailsMessages.EclipseLinkObjectTypeConverterComposite_defaultObjectValueLabel,
buildDefaultObjectValueListHolder(),
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkConvert1_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkConvert1_0Composite.java
index 8ec8973143..dd054ac042 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkConvert1_0Composite.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkConvert1_0Composite.java
@@ -33,7 +33,7 @@ import org.eclipse.jpt.utility.model.value.ListValueModel;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
/**
@@ -82,7 +82,7 @@ public class OrmEclipseLinkConvert1_0Composite extends Pane<EclipseLinkConvert>
@Override
protected void initializeLayout(Composite container) {
- CCombo combo = addLabeledEditableCCombo(
+ Combo combo = addLabeledEditableCombo(
container,
EclipseLinkUiDetailsMessages.EclipseLinkConvertComposite_converterNameLabel,
buildConvertNameListHolder(),
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/CacheStatementsPropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/CacheStatementsPropertiesComposite.java
index 0a4e0e5572..a0a2a52fab 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/CacheStatementsPropertiesComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/CacheStatementsPropertiesComposite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2008, 2009 Oracle. All rights reserved.
+* Copyright (c) 2008, 2010 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -19,7 +19,7 @@ import org.eclipse.jpt.utility.internal.StringConverter;
import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
/**
@@ -83,8 +83,8 @@ public class CacheStatementsPropertiesComposite<T extends Connection>
return new IntegerCombo<Connection>(this, container) {
@Override
- protected CCombo addIntegerCombo(Composite container) {
- return this.addEditableCCombo(
+ protected Combo addIntegerCombo(Composite container) {
+ return this.addEditableCombo(
container,
buildDefaultListHolder(),
buildSelectedItemStringHolder(),
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/SessionNameComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/SessionNameComposite.java
index 8ff99cd903..c7abb3ea66 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/SessionNameComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/SessionNameComposite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2008, 2009 Oracle. All rights reserved.
+* Copyright (c) 2008, 2010 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -20,7 +20,7 @@ import org.eclipse.jpt.utility.model.value.ListValueModel;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
/**
@@ -88,18 +88,13 @@ public class SessionNameComposite extends Pane<Options>
defaultValue
);
}
- else {
- return EclipseLinkUiMessages.PersistenceXmlOptionsTab_defaultEmpty;
- }
+ return EclipseLinkUiMessages.PersistenceXmlOptionsTab_defaultEmpty;
}
- /*
- * (non-Javadoc)
- */
@Override
protected void initializeLayout(Composite container) {
- CCombo combo = addLabeledEditableCCombo(
+ Combo combo = addLabeledEditableCombo(
container,
EclipseLinkUiMessages.PersistenceXmlOptionsTab_sessionName,
this.buildDefaultSessionNameListHolder(),
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/SessionsXmlComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/SessionsXmlComposite.java
index e4d5efcc15..6219d274e4 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/SessionsXmlComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/SessionsXmlComposite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2008, 2009 Oracle. All rights reserved.
+* Copyright (c) 2008, 2010 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -20,7 +20,7 @@ import org.eclipse.jpt.utility.model.value.ListValueModel;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
/**
@@ -88,18 +88,13 @@ public class SessionsXmlComposite extends Pane<Options>
defaultValue
);
}
- else {
- return EclipseLinkUiMessages.PersistenceXmlOptionsTab_defaultEmpty;
- }
+ return EclipseLinkUiMessages.PersistenceXmlOptionsTab_defaultEmpty;
}
- /*
- * (non-Javadoc)
- */
@Override
protected void initializeLayout(Composite container) {
- CCombo combo = addLabeledEditableCCombo(
+ Combo combo = addLabeledEditableCombo(
container,
EclipseLinkUiMessages.PersistenceXmlOptionsTab_sessionsXml,
this.buildDefaultSessionsXmlFileNameListHolder(),
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/TargetDatabaseComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/TargetDatabaseComposite.java
index 2b7d12fddd..504aee56d9 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/TargetDatabaseComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/TargetDatabaseComposite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2010 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -33,7 +33,7 @@ import org.eclipse.jpt.utility.model.value.ListValueModel;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
/**
@@ -163,18 +163,13 @@ public class TargetDatabaseComposite extends Pane<Options>
defaultValue
);
}
- else {
- return EclipseLinkUiMessages.PersistenceXmlOptionsTab_defaultEmpty;
- }
+ return EclipseLinkUiMessages.PersistenceXmlOptionsTab_defaultEmpty;
}
- /*
- * (non-Javadoc)
- */
@Override
protected void initializeLayout(Composite container) {
- CCombo combo = addLabeledEditableCCombo(
+ Combo combo = addLabeledEditableCombo(
container,
EclipseLinkUiMessages.PersistenceXmlOptionsTab_targetDatabaseLabel,
this.buildTargetDatabaseListHolder(),
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/TargetServerComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/TargetServerComposite.java
index e577b77721..ec912c7ca3 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/TargetServerComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/TargetServerComposite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2008, 2009 Oracle. All rights reserved.
+* Copyright (c) 2008, 2010 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -33,7 +33,7 @@ import org.eclipse.jpt.utility.model.value.ListValueModel;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
/**
@@ -163,18 +163,12 @@ public class TargetServerComposite extends Pane<Options>
defaultValue
);
}
- else {
- return EclipseLinkUiMessages.PersistenceXmlOptionsTab_defaultEmpty;
- }
+ return EclipseLinkUiMessages.PersistenceXmlOptionsTab_defaultEmpty;
}
- /*
- * (non-Javadoc)
- */
@Override
protected void initializeLayout(Composite container) {
-
- CCombo combo = addLabeledEditableCCombo(
+ Combo combo = addLabeledEditableCombo(
container,
EclipseLinkUiMessages.PersistenceXmlOptionsTab_targetServerLabel,
this.buildTargetServerListHolder(),
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/CreateDdlFileNameComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/CreateDdlFileNameComposite.java
index 624e927c04..5ec55e81cf 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/CreateDdlFileNameComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/CreateDdlFileNameComposite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2008, 2009 Oracle. All rights reserved.
+* Copyright (c) 2008, 2010 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -20,7 +20,7 @@ import org.eclipse.jpt.utility.model.value.ListValueModel;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
/**
@@ -88,18 +88,12 @@ public class CreateDdlFileNameComposite extends Pane<SchemaGeneration>
defaultValue
);
}
- else {
- return EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_defaultEmpty;
- }
+ return EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_defaultEmpty;
}
- /*
- * (non-Javadoc)
- */
@Override
protected void initializeLayout(Composite container) {
-
- CCombo combo = addLabeledEditableCCombo(
+ Combo combo = addLabeledEditableCombo(
container,
EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_createDdlFileNameLabel,
this.buildDefaultCreateDdlFileNameListHolder(),
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/DropDdlFileNameComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/DropDdlFileNameComposite.java
index 7c927926ae..ae609404ac 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/DropDdlFileNameComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/DropDdlFileNameComposite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2008, 2009 Oracle. All rights reserved.
+* Copyright (c) 2008, 2010 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -20,7 +20,7 @@ import org.eclipse.jpt.utility.model.value.ListValueModel;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
/**
@@ -88,18 +88,12 @@ public class DropDdlFileNameComposite extends Pane<SchemaGeneration>
defaultValue
);
}
- else {
- return EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_defaultEmpty;
- }
+ return EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_defaultEmpty;
}
- /*
- * (non-Javadoc)
- */
@Override
protected void initializeLayout(Composite container) {
-
- CCombo combo = addLabeledEditableCCombo(
+ Combo combo = addLabeledEditableCombo(
container,
EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_dropDdlFileNameLabel,
this.buildDefaultDropDdlFileNameListHolder(),
diff --git a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_details.properties b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_details.properties
index 5d394fea23..2313f78572 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_details.properties
+++ b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_details.properties
@@ -106,8 +106,8 @@ BasicGeneralSection_enumeratedLabel=Enumerated:
TypeSection_type=Type
TypeSection_default=Default
TypeSection_lob=Lob
-TypeSection_temporal=Temporal
-TypeSection_enumerated=Enumerated
+TypeSection_temporal=Temporal:
+TypeSection_enumerated=Enumerated:
TableChooser_label=Name:
CatalogChooser_label=Catalog:
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/WidgetFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/WidgetFactory.java
index 22e0dd2d55..cfee242e5a 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/WidgetFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/WidgetFactory.java
@@ -52,9 +52,11 @@ public interface WidgetFactory {
/**
* Creates a new non-editable custom <code>Combo</code>.
*
+ * @deprecated
* @param parent The parent container
* @return A new <code>CCombo</code>
*/
+ @Deprecated
CCombo createCCombo(Composite parent);
/**
@@ -95,9 +97,11 @@ public interface WidgetFactory {
/**
* Creates a new editable custom <code>CCombo</code>.
*
+ * @deprecated
* @param parent The parent container
* @return A new <code>CCombo</code>
*/
+ @Deprecated
CCombo createEditableCCombo(Composite parent);
/**
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/AbstractInheritanceComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/AbstractInheritanceComposite.java
index 99945a06f8..254cfca706 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/AbstractInheritanceComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/AbstractInheritanceComposite.java
@@ -23,7 +23,7 @@ import org.eclipse.jpt.utility.model.value.ListValueModel;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
@@ -113,7 +113,7 @@ public abstract class AbstractInheritanceComposite<T extends Entity> extends Pan
// Discrinator Value widgets
PropertyValueModel<Boolean> dvEnabled = this.buildDiscriminatorValueEnabledHolder();
- CCombo discriminatorValueCombo = addEditableCCombo(
+ Combo discriminatorValueCombo = addEditableCombo(
subPane,
buildDiscriminatorValueListHolder(),
buildDiscriminatorValueHolder(),
@@ -128,7 +128,7 @@ public abstract class AbstractInheritanceComposite<T extends Entity> extends Pan
addLabeledComposite(
subPane,
discriminatorValueLabel,
- discriminatorValueCombo.getParent(),
+ discriminatorValueCombo,
null,
JpaHelpContextIds.ENTITY_INHERITANCE_DISCRIMINATOR_VALUE
);
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/EntityNameComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/EntityNameComposite.java
index e64df76026..c5f3c7b56f 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/EntityNameComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/EntityNameComposite.java
@@ -19,7 +19,7 @@ import org.eclipse.jpt.utility.model.value.ListValueModel;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
/**
@@ -56,7 +56,7 @@ public class EntityNameComposite
@Override
protected void initializeLayout(Composite container) {
- CCombo combo = addLabeledEditableCCombo(
+ Combo combo = addLabeledEditableCombo(
container,
JptUiDetailsMessages.EntityNameComposite_name,
buildDefaultEntityNameListHolder(),
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/GeneratedValueComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/GeneratedValueComposite.java
index 4e90930023..aff39d8b1c 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/GeneratedValueComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/GeneratedValueComposite.java
@@ -29,9 +29,9 @@ import org.eclipse.jpt.utility.model.listener.ListChangeAdapter;
import org.eclipse.jpt.utility.model.listener.ListChangeListener;
import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
/**
@@ -57,7 +57,7 @@ import org.eclipse.swt.widgets.Composite;
public class GeneratedValueComposite extends Pane<IdMapping>
{
private PropertyChangeListener generatedValuePropertyChangeListener;
- private CCombo generatorNameCombo;
+ private Combo generatorNameCombo;
private PropertyChangeListener generatorNamePropertyChangeListener;
private ListChangeListener generatorsListChangeListener;
@@ -106,7 +106,7 @@ public class GeneratedValueComposite extends Pane<IdMapping>
return;
}
- String generatorName = ((CCombo) e.getSource()).getText();
+ String generatorName = ((Combo) e.getSource()).getText();
GeneratedValue generatedValue = getSubject().getGeneratedValue();
if (StringTools.stringIsEmpty(generatorName)) {
@@ -289,7 +289,7 @@ public class GeneratedValueComposite extends Pane<IdMapping>
);
// Generator Name widgets
- this.generatorNameCombo = addLabeledEditableCCombo(
+ this.generatorNameCombo = addLabeledEditableCombo(
container,
JptUiDetailsMessages.GeneratedValueComposite_generatorName,
buildGeneratorNameModifyListener(),
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/swt/CComboModelAdapter.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/swt/CComboModelAdapter.java
deleted file mode 100644
index 65a8d12e2f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/swt/CComboModelAdapter.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.swt;
-
-import org.eclipse.jpt.utility.internal.StringConverter;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionListener;
-
-/**
- * This adapter provides a more object-oriented interface to the items and
- * selected item in a <code>CCombo</code>.
- * <p>
- * <b>listHolder</b> contains the items in the <code>CCombo</code>.<br>
- * <b>selectedItemHolder</b> contains the items in 'listHolder' that are
- * selected in the <code>CCombo</code>.
- *
- * @param <E> The type of the items in <b>listHolder</b>
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public class CComboModelAdapter<E> extends AbstractComboModelAdapter<E> {
-
- // ********** static methods **********
-
- /**
- * Constructor - the list holder, selections holder, combo, and
- * string converter are required.
- */
- protected CComboModelAdapter(
- ListValueModel<E> listHolder,
- WritablePropertyValueModel<E> selectedItemHolder,
- CCombo combo,
- StringConverter<E> stringConverter)
- {
- super(listHolder,
- selectedItemHolder,
- new CComboHolder(combo),
- stringConverter);
- }
-
- /**
- * Adapt the specified model list and selection to the specified combo.
- * Use the default string converter to convert the model items to strings
- * to be displayed in the combo, which calls #toString() on the
- * items in the model list.
- */
- public static <T> CComboModelAdapter<T> adapt(
- ListValueModel<T> listHolder,
- WritablePropertyValueModel<T> selectedItemHolder,
- CCombo combo)
- {
- return adapt(
- listHolder,
- selectedItemHolder,
- combo,
- StringConverter.Default.<T>instance()
- );
- }
-
-
- // ********** constructors **********
-
- /**
- * Adapt the specified model list and selection to the specified combo.
- * Use the specified string converter to convert the model items to strings
- * to be displayed in the combo.
- */
- public static <T> CComboModelAdapter<T> adapt(
- ListValueModel<T> listHolder,
- WritablePropertyValueModel<T> selectedItemHolder,
- CCombo combo,
- StringConverter<T> stringConverter)
- {
- return new CComboModelAdapter<T>(
- listHolder,
- selectedItemHolder,
- combo,
- stringConverter
- );
- }
-
-
- // ********** Internal member **********
-
- private static class CComboHolder implements ComboHolder {
- private final CCombo combo;
- private final boolean editable;
- private String selectedItem;
-
- CComboHolder(CCombo combo) {
- super();
- this.combo = combo;
- this.editable = combo.getEditable();
- }
-
- public void add(String item, int index) {
- this.combo.add(item, index);
-
- // It is possible the selected item was set before the combo is being
- // populated, update the selected item if it's matches the item being
- // added
- if ((this.selectedItem != null) && this.selectedItem.equals(item)) {
- this.setText(this.selectedItem);
- this.selectedItem = null;
- }
- }
-
- public void addDisposeListener(DisposeListener disposeListener) {
- this.combo.addDisposeListener(disposeListener);
- }
-
- public void addModifyListener(ModifyListener modifyListener) {
- this.combo.addModifyListener(modifyListener);
- }
-
- public void addSelectionListener(SelectionListener selectionListener) {
- this.combo.addSelectionListener(selectionListener);
- }
-
- public void deselectAll() {
- this.combo.deselectAll();
- }
-
- public int getItemCount() {
- return this.combo.getItemCount();
- }
-
- public String[] getItems() {
- return this.combo.getItems();
- }
-
- public int getSelectionIndex() {
- return this.combo.getSelectionIndex();
- }
-
- public String getText() {
- return this.combo.getText();
- }
-
- public boolean isDisposed() {
- return this.combo.isDisposed();
- }
-
- public boolean isEditable() {
- return editable;
- }
-
- public boolean isPopulating() {
- return this.combo.getData("populating") == Boolean.TRUE;
- }
-
- public void remove(int start, int end) {
- this.combo.remove(start, end);
- }
-
- public void removeAll() {
- this.combo.removeAll();
- }
-
- public void removeDisposeListener(DisposeListener disposeListener) {
- this.combo.removeDisposeListener(disposeListener);
- }
-
- public void removeModifyListener(ModifyListener modifyListener) {
- this.combo.removeModifyListener(modifyListener);
- }
-
- public void removeSelectionListener(SelectionListener selectionListener) {
- this.combo.removeSelectionListener(selectionListener);
- }
-
- public void setItem(int index, String item) {
- this.combo.setItem(index, item);
- }
-
- public void setItems(String[] items) {
- this.combo.setItems(items);
- }
-
- public void setPopulating(boolean populating) {
- this.combo.setData("populating", Boolean.valueOf(populating));
- }
-
- public void setText(String item) {
-
- // Keep track of the selected item since it's possible the selected
- // item is before the combo is populated
- if (this.combo.getItemCount() == 0) {
- this.selectedItem = item;
- }
- else {
- this.selectedItem = null;
- }
-
- this.combo.setText(item);
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/SWTUtil.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/SWTUtil.java
index e2ebb35447..1039d095e8 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/SWTUtil.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/SWTUtil.java
@@ -18,7 +18,6 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jpt.ui.internal.widgets.NullPostExecution;
import org.eclipse.jpt.ui.internal.widgets.PostExecution;
import org.eclipse.jpt.utility.internal.ReflectionTools;
-import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.events.ModifyEvent;
@@ -61,20 +60,6 @@ public class SWTUtil {
}
/**
- * Tweaks the given <code>CCombo</code> to remove the default value when the
- * widget receives the focus and to show the default when the widget loses
- * the focus.
- *
- * @param combo The widget having a default value that is always at the
- * beginning of the list
- */
- public static void attachDefaultValueHandler(CCombo combo) {
- CComboHandler handler = new CComboHandler();
- combo.addFocusListener(handler);
- combo.addModifyListener(handler);
- }
-
- /**
* Tweaks the given <code>Combo</code> to remove the default value when the
* widget receives the focus and to show the default when the widget loses
* the focus.
@@ -381,94 +366,6 @@ public class SWTUtil {
return widget.getDisplay().getThread() == Thread.currentThread();
}
- /**
- * This handler is responsible for removing the default value when the combo
- * has the focus or when the selected item is the default value and to select
- * it when the combo loses the focus.
- */
- private static class CComboHandler implements ModifyListener,
- FocusListener {
-
-
- public void focusGained(FocusEvent e) {
- CCombo combo = (CCombo) e.widget;
-
- if (combo.getSelectionIndex() == 0) {
- // The text selection has to be changed outside of the context of this
- // listener otherwise the combo won't update because it's currently
- // notifying its listeners
- asyncExec(new SelectText(combo));
- }
- }
-
- public void focusLost(FocusEvent e) {
- //do nothing
- }
-
- public void modifyText(ModifyEvent e) {
-
- CCombo combo = (CCombo) e.widget;
-
- if (combo.isFocusControl() &&
- combo.getSelectionIndex() <= 0) {
-
- // Make sure the current text is the default value
- String currentValue = combo.getText();
-
- if (currentValue.length() > 0 &&
- combo.getItemCount() > 0 &&
- !currentValue.equals(combo.getItem(0))) {
-
- return;
- }
-
- // The text has to be changed outside of the context of this
- // listener otherwise the combo won't update because it's currently
- // notifying its listeners
- asyncExec(new ModifyText(combo));
- }
- }
-
- private class SelectText implements Runnable {
- private final CCombo combo;
-
- public SelectText(CCombo combo) {
- super();
- this.combo = combo;
- }
-
- public void run() {
- if (this.combo.isDisposed()) {
- return;
- }
- String text = this.combo.getText();
- this.combo.setSelection(new Point(0, text.length()));
- }
- }
-
- private class ModifyText implements Runnable {
- private final CCombo combo;
-
- public ModifyText(CCombo combo) {
- super();
- this.combo = combo;
- }
-
- public void run() {
- if (this.combo.isDisposed()) {
- return;
- }
- String text = this.combo.getText();
-
- if (text.length() == 0) {
- text = this.combo.getItem(0);
- this.combo.setText(text);
- }
-
- this.combo.setSelection(new Point(0, text.length()));
- }
- }
- }
/**
* This handler is responsible for removing the default value when the combo
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/utility/swt/SWTCComboAdapter.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/utility/swt/SWTCComboAdapter.java
deleted file mode 100644
index 461dff8534..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/utility/swt/SWTCComboAdapter.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.utility.swt;
-
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.custom.CCombo;
-
-/**
- * Adapt an SWT {@link CCombo} to the list widget expected by
- * {@link ListWidgetModelBinding} and the
- * drop-down list box expected by {@link DropDownListBoxSelectionBinding}.
- */
-final class SWTCComboAdapter
- extends AbstractListWidgetAdapter<CCombo>
- implements DropDownListBoxSelectionBinding.DropDownListBox
-{
- SWTCComboAdapter(CCombo combo) {
- super(combo);
- }
-
- // ********** ListWidgetModelBinding.ListWidget implementation **********
-
- public String[] getItems() {
- return this.widget.getItems();
- }
-
- /**
- * {@link CCombo#setItem(int)} does not update the text field if we are
- * changing the currently selected item. So if we are changing the
- * currently selected item, we deselect it, set it in the list, and
- * re-select it so the text field updates.
- */
- public void setItem(int index, String item) {
- int currentIndex = this.widget.getSelectionIndex();
- if (currentIndex == index) {
- this.widget.deselectAll();
- }
- this.widget.setItem(index, item);
- if (currentIndex == index) {
- this.widget.select(currentIndex);
- }
- }
-
- /**
- * {@link CCombo#setItems(String[])} will clear the text field if it is
- * read-only.
- */
- public void setItems(String[] items) {
- this.widget.setItems(items);
- }
-
- /**
- * The text field will be updated when we synch the selection after an
- * item is added to the list.
- */
- public void add(String item, int index) {
- this.widget.add(item, index);
- }
-
- /**
- * The text field will be updated when we synch the selection after
- * items are removed from the list. If the selection was among the removed
- * items, the model should have already cleared the selection <em>before</em>
- * the master list was modified.
- */
- public void remove(int start, int end) {
- this.widget.remove(start, end);
- }
-
- /**
- * {@link CCombo#removeAll()} will clear the text field.
- * The model selection should have already been cleared.
- */
- public void removeAll() {
- this.widget.removeAll();
- }
-
-
- // ********** ComboBoxSelectionBinding.ComboBox implementation **********
-
- public void addSelectionListener(SelectionListener listener) {
- this.widget.addSelectionListener(listener);
- }
-
- public void removeSelectionListener(SelectionListener listener) {
- this.widget.removeSelectionListener(listener);
- }
-
- public int getSelectionIndex() {
- return this.widget.getSelectionIndex();
- }
-
- public void select(int index) {
- this.widget.select(index);
- }
-
- /**
- * {@link CCombo#deselect(int)} will clear the text field if the index
- * matches the current selection index.
- */
- public void deselect(int index) {
- this.widget.deselect(index);
- }
-
- /**
- * {@link CCombo#deselectAll()} will clear the text field.
- * The model selection should have already been cleared.
- */
- public void deselectAll() {
- this.widget.deselectAll();
- }
-
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/utility/swt/SWTTools.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/utility/swt/SWTTools.java
index cfb89d2474..1f25f5289e 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/utility/swt/SWTTools.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/utility/swt/SWTTools.java
@@ -21,7 +21,6 @@ import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.utility.model.value.WritableCollectionValueModel;
import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Control;
@@ -172,32 +171,6 @@ public final class SWTTools {
);
}
- /**
- * Bind the specified model list and selection to the specified drop-down list box.
- * Use the default string converter to convert the model items to strings
- * to be displayed in the drop-down list box, which calls {@link Object#toString()}
- * on the items in the model list.
- */
- public static <E> void bind(ListValueModel<E> listModel, WritablePropertyValueModel<E> selectedItemModel, CCombo dropDownListBox) {
- bind(listModel, selectedItemModel, dropDownListBox, StringConverter.Default.<E>instance());
- }
-
- /**
- * Adapt the specified model list and selection to the specified drop-down list box.
- * Use the specified string converter to convert the model items to strings
- * to be displayed in the drop-down list box.
- */
- public static <E> void bind(ListValueModel<E> listModel, WritablePropertyValueModel<E> selectedItemModel, CCombo dropDownListBox, StringConverter<E> stringConverter) {
- checkForReadOnlyStyle(dropDownListBox);
- SWTCComboAdapter comboAdapter = new SWTCComboAdapter(dropDownListBox);
- bind(
- listModel,
- comboAdapter,
- stringConverter,
- new DropDownListBoxSelectionBinding<E>(listModel, selectedItemModel, comboAdapter)
- );
- }
-
private static void checkForReadOnlyStyle(Widget comboBox) {
if ( ! BitTools.flagIsSet(comboBox.getStyle(), SWT.READ_ONLY)) {
throw new IllegalStateException("combo-box must be read-only: " + comboBox);
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/ComboPane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/ComboPane.java
index e94bcbad0f..c08f9a2f0e 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/ComboPane.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/ComboPane.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2010 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -16,9 +16,9 @@ import org.eclipse.jpt.utility.internal.StringTools;
import org.eclipse.jpt.utility.model.Model;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
/**
@@ -32,7 +32,7 @@ public abstract class ComboPane<T extends Model> extends Pane<T>
/**
* The main (only) widget of this pane.
*/
- protected CCombo comboBox;
+ protected Combo comboBox;
// **************** constructors ******************************************
@@ -65,7 +65,7 @@ public abstract class ComboPane<T extends Model> extends Pane<T>
@Override
protected void initializeLayout(Composite container) {
- this.comboBox = this.addEditableCCombo(container);
+ this.comboBox = this.addEditableCombo(container);
this.comboBox.addModifyListener(this.buildModifyListener());
SWTUtil.attachDefaultValueHandler(this.comboBox);
}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/DefaultWidgetFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/DefaultWidgetFactory.java
index ae23f0c27d..a69961d40d 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/DefaultWidgetFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/DefaultWidgetFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2010 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -84,6 +84,7 @@ public class DefaultWidgetFactory implements WidgetFactory {
/**
* {@inheritDoc}
*/
+ @Deprecated
public CCombo createCCombo(Composite parent) {
return new CCombo(parent, SWT.BORDER | SWT.READ_ONLY);
}
@@ -119,6 +120,7 @@ public class DefaultWidgetFactory implements WidgetFactory {
/**
* {@inheritDoc}
*/
+ @Deprecated
public CCombo createEditableCCombo(Composite parent) {
return new CCombo(parent, SWT.BORDER);
}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumComboViewer.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumComboViewer.java
index 5ddfc61ebc..0810236b7a 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumComboViewer.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumComboViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2010 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -128,7 +128,9 @@ abstract class EnumComboViewer<T extends Model, V> extends Pane<T>
* @param container The container of the combo
* @return A new <code>ComboViewer</code> containing the right combo widget
*/
- abstract ComboViewer addComboViewer(Composite container);
+ protected ComboViewer addComboViewer(Composite container) {
+ return addComboViewer(container, buildLabelProvider());
+ }
private Comparator<Object> buildComparator() {
return new Comparator<Object>() {
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumDialogComboViewer.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumDialogComboViewer.java
index c670b6a42e..591a32d0de 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumDialogComboViewer.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumDialogComboViewer.java
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.ui.internal.widgets;
-import org.eclipse.jface.viewers.ComboViewer;
import org.eclipse.jpt.utility.model.Model;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.swt.graphics.Point;
@@ -53,13 +52,6 @@ public abstract class EnumDialogComboViewer<T extends Model, V>
}
@Override
- ComboViewer addComboViewer(Composite container) {
- ComboViewer comboViewer = addComboViewer(container, buildLabelProvider());
- comboViewer.getCombo().setVisibleItemCount(Integer.MAX_VALUE);
- return comboViewer;
- }
-
- @Override
public void enableWidgets(boolean enabled) {
super.enableWidgets(enabled);
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumFormComboViewer.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumFormComboViewer.java
index d73739aee2..67d7a41ac2 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumFormComboViewer.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumFormComboViewer.java
@@ -9,17 +9,16 @@
******************************************************************************/
package org.eclipse.jpt.ui.internal.widgets;
-import org.eclipse.jface.viewers.ComboViewer;
import org.eclipse.jpt.utility.model.Model;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
/**
* This <code>EnumComboViewer</code> should be used within a form pane.
*
- * @version 2.0
+ * @version 2.3
* @since 1.0
*/
public abstract class EnumFormComboViewer<T extends Model, V>
@@ -53,24 +52,17 @@ public abstract class EnumFormComboViewer<T extends Model, V>
}
@Override
- ComboViewer addComboViewer(Composite container) {
- ComboViewer comboViewer = addCComboViewer(container, buildLabelProvider());
- comboViewer.getCCombo().setVisibleItemCount(Integer.MAX_VALUE);
- return comboViewer;
- }
-
- @Override
public void enableWidgets(boolean enabled) {
super.enableWidgets(enabled);
- CCombo combo = getCombo();
+ Combo combo = getCombo();
if ( ! combo.isDisposed()) {
combo.setEnabled(enabled);
}
}
- protected final CCombo getCombo() {
- return this.getComboViewer().getCCombo();
+ protected final Combo getCombo() {
+ return this.getComboViewer().getCombo();
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FileChooserComboPane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FileChooserComboPane.java
index 01279b3a25..7599ec6d23 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FileChooserComboPane.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FileChooserComboPane.java
@@ -65,7 +65,7 @@ public abstract class FileChooserComboPane<T extends Model> extends FileChooserP
@Override
protected Control addMainControl(Composite container) {
- return addEditableCCombo(
+ return addEditableCombo(
container,
this.buildListHolder(),
this.getTextHolder(),
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FolderChooserComboPane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FolderChooserComboPane.java
index 12c788a06b..f505869b27 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FolderChooserComboPane.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FolderChooserComboPane.java
@@ -66,7 +66,7 @@ public abstract class FolderChooserComboPane<T extends Model> extends FolderChoo
@Override
protected Control addMainControl(Composite container) {
- return addEditableCCombo(
+ return addEditableCombo(
container,
this.buildListHolder(),
this.getTextHolder(),
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FormWidgetFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FormWidgetFactory.java
index 52cf3dfc65..3364b3aaf8 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FormWidgetFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FormWidgetFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2010 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -117,6 +117,7 @@ public class FormWidgetFactory implements WidgetFactory {
/**
* {@inheritDoc}
*/
+ @Deprecated
public CCombo createCCombo(Composite parent) {
return createCCombo(parent, SWT.READ_ONLY);
}
@@ -153,16 +154,14 @@ public class FormWidgetFactory implements WidgetFactory {
* {@inheritDoc}
*/
public Combo createCombo(Composite parent) {
- return new Combo(parent, SWT.READ_ONLY);
+ return new Combo(parent, SWT.READ_ONLY | SWT.FLAT);
}
/**
* {@inheritDoc}
*/
public Composite createComposite(Composite parent) {
- Composite composite = widgetFactory.createComposite(parent);
- widgetFactory.paintBordersFor(composite);
- return composite;
+ return this.widgetFactory.createComposite(parent);
}
/**
* {@inheritDoc}
@@ -180,6 +179,7 @@ public class FormWidgetFactory implements WidgetFactory {
/**
* {@inheritDoc}
*/
+ @Deprecated
public CCombo createEditableCCombo(Composite parent) {
return createCCombo(parent, SWT.NULL);
}
@@ -196,10 +196,8 @@ public class FormWidgetFactory implements WidgetFactory {
* {@inheritDoc}
*/
public Group createGroup(Composite parent, String title) {
- Group group = new Group(parent, SWT.SHADOW_NONE);
+ Group group = new Group(parent, SWT.NULL);
group.setText(title);
- group.setBackground(widgetFactory.getColors().getBackground());
- group.setForeground(widgetFactory.getColors().getForeground());
return group;
}
@@ -314,11 +312,11 @@ public class FormWidgetFactory implements WidgetFactory {
* {@inheritDoc}
*/
public Text createText(Composite parent) {
- return createText(parent, SWT.NULL);
+ return createText(parent, SWT.NONE);
}
protected Text createText(Composite parent, int style) {
- return widgetFactory.createText(parent, null, SWT.FLAT | style);
+ return widgetFactory.createText(parent, null, SWT.BORDER | SWT.FLAT | style);
}
/**
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/IntegerCombo.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/IntegerCombo.java
index 26610fdf6a..8ec13a8848 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/IntegerCombo.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/IntegerCombo.java
@@ -20,10 +20,10 @@ import org.eclipse.jpt.utility.model.value.ListValueModel;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.events.VerifyListener;
import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
/**
@@ -37,7 +37,7 @@ public abstract class IntegerCombo<T extends Model>
/**
* The main (only) widget of this pane.
*/
- private CCombo comboBox;
+ private Combo comboBox;
private PropertyValueModel<String> defaultValueHolder;
@@ -59,7 +59,7 @@ public abstract class IntegerCombo<T extends Model>
super(parentPane, subjectHolder, parent);
}
- public CCombo getCombo() {
+ public Combo getCombo() {
return this.comboBox;
}
@@ -81,8 +81,8 @@ public abstract class IntegerCombo<T extends Model>
SWTUtil.attachDefaultValueHandler(this.comboBox);
}
- protected CCombo addIntegerCombo(Composite container) {
- return this.addLabeledEditableCCombo(
+ protected Combo addIntegerCombo(Composite container) {
+ return this.addLabeledEditableCombo(
container,
getLabelText(),
buildDefaultListHolder(),
@@ -107,6 +107,13 @@ public abstract class IntegerCombo<T extends Model>
private PropertyValueModel<String> buildDefaultStringHolder() {
return new TransformationPropertyValueModel<Integer, String>(buildDefaultHolder()) {
@Override
+ protected String transform(Integer value) {
+ if (value == null) {
+ return JptUiDetailsMessages.NoneSelected;
+ }
+ return super.transform(value);
+ }
+ @Override
protected String transform_(Integer value) {
return getDefaultValueString(value);
}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/Pane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/Pane.java
index ae6442060c..19083c7ee3 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/Pane.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/Pane.java
@@ -21,7 +21,6 @@ import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jpt.ui.WidgetFactory;
import org.eclipse.jpt.ui.internal.Tracing;
import org.eclipse.jpt.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.ui.internal.swt.CComboModelAdapter;
import org.eclipse.jpt.ui.internal.swt.ComboModelAdapter;
import org.eclipse.jpt.ui.internal.swt.DateTimeModelAdapter;
import org.eclipse.jpt.ui.internal.swt.SpinnerModelAdapter;
@@ -43,7 +42,6 @@ import org.eclipse.jpt.utility.model.value.ListValueModel;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
@@ -596,22 +594,6 @@ public abstract class Pane<T extends Model>
}
/**
- * Creates a new non-editable <code>CCombo</code>.
- *
- * @param container The parent container
- * @return The newly created <code>Combo</code>
- *
- * @category Layout
- */
- protected final CCombo addCCombo(Composite container) {
-
- CCombo combo = this.widgetFactory.createCCombo(container);
- combo.setLayoutData(getFieldGridData());
- this.manageWidget(combo);
- return combo;
- }
-
- /**
* This layout will leave space for decorations on widgets.
* Whether decorated or not, all of the widgets need the same indent
* so that they align properly.
@@ -628,76 +610,6 @@ public abstract class Pane<T extends Model>
}
/**
- * Creates a new non-editable <code>CCombo</code>.
- *
- * @param container The parent container
- * @param listHolder The <code>ListValueHolder</code>
- * @param selectedItemHolder The holder of the selected item
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- protected final <V> CCombo addCCombo(Composite container,
- ListValueModel<V> listHolder,
- WritablePropertyValueModel<V> selectedItemHolder) {
-
- return this.addCCombo(
- container,
- listHolder,
- selectedItemHolder,
- StringConverter.Default.<V>instance()
- );
- }
-
- /**
- * Creates a new non-editable <code>CCombo</code>.
- *
- * @param container The parent container
- * @param listHolder The <code>ListValueHolder</code>
- * @param selectedItemHolder The holder of the selected item
- * @param stringConverter The converter responsible to transform each item
- * into a string representation
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- protected final <V> CCombo addCCombo(Composite container,
- ListValueModel<V> listHolder,
- WritablePropertyValueModel<V> selectedItemHolder,
- StringConverter<V> stringConverter) {
-
- CCombo combo = this.addCCombo(container);
-
- CComboModelAdapter.adapt(
- listHolder,
- selectedItemHolder,
- combo,
- stringConverter
- );
-
- return combo;
- }
-
- /**
- * Creates a new <code>ComboViewer</code> using a <code>CCombo</code>.
- *
- * @param container The parent container
- * @param labelProvider The provider responsible to convert the combo's items
- * into human readable strings
- * @return The newly created <code>ComboViewer</code>
- *
- * @category Layout
- */
- protected final ComboViewer addCComboViewer(Composite container,
- IBaseLabelProvider labelProvider) {
-
- CCombo combo = this.addCCombo(container);
- ComboViewer viewer = new ComboViewer(combo);
- viewer.setLabelProvider(labelProvider);
- return viewer;
- }
-
- /**
* Creates a new check box using the given information.
*
* @param parent The parent container
@@ -1046,76 +958,19 @@ public abstract class Pane<T extends Model>
return this.addSubPane(parent);
}
- /**
- * Creates a new editable <code>CCombo</code>.
- *
- * @param container The parent container
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- protected final CCombo addEditableCCombo(Composite container) {
-
- CCombo combo = addUnmanagedEditableCCombo(container);
- this.manageWidget(combo);
- return combo;
- }
-
- /**
- * Creates a new editable <code>CCombo</code>.
- *
- * @param container The parent container
- * @param listHolder The <code>ListValueHolder</code>
- * @param selectedItemHolder The holder of the selected item
- * @param stringConverter The converter responsible to transform each item
- * into a string representation
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- protected final <V> CCombo addEditableCCombo(Composite container,
- ListValueModel<V> listHolder,
- WritablePropertyValueModel<V> selectedItemHolder,
- StringConverter<V> stringConverter) {
-
- CCombo combo = addUnmanagedEditableCCombo(container, listHolder, selectedItemHolder, stringConverter);
- this.manageWidget(combo);
-
- return combo;
- }
-
- protected final <V> CCombo addEditableCCombo(
+ protected final <V> Combo addEditableCombo(
Composite container,
ListValueModel<V> listHolder,
WritablePropertyValueModel<V> selectedItemHolder,
StringConverter<V> stringConverter,
PropertyValueModel<Boolean> enabledModel
) {
- CCombo combo = this.addUnmanagedEditableCCombo(container, listHolder, selectedItemHolder, stringConverter);
+ Combo combo = this.addUnmanagedEditableCombo(container, listHolder, selectedItemHolder, stringConverter);
this.controlEnabledState(enabledModel, combo);
return combo;
}
/**
- * Creates a new editable <code>ComboViewer</code> using a <code>CCombo</code>.
- *
- * @param container The parent container
- * @param labelProvider The provider responsible to convert the combo's items
- * into human readable strings
- * @return The newly created <code>ComboViewer</code>
- *
- * @category Layout
- */
- protected final ComboViewer addEditableCComboViewer(Composite container,
- IBaseLabelProvider labelProvider) {
-
- CCombo combo = this.addEditableCCombo(container);
- ComboViewer viewer = new ComboViewer(combo);
- viewer.setLabelProvider(labelProvider);
- return viewer;
- }
-
- /**
* Creates a new editable <code>Combo</code>.
*
* @param container The parent container
@@ -1282,80 +1137,6 @@ public abstract class Pane<T extends Model>
* @param rightControl The control shown to the right of the main widget
* @param helpId The topic help ID to be registered for the given center
* compositer
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- protected final <V> CCombo addLabeledCCombo(Composite container,
- String labelText,
- ListValueModel<V> listHolder,
- WritablePropertyValueModel<V> selectedItemHolder,
- StringConverter<V> stringConverter,
- Control rightControl,
- String helpId) {
-
- CCombo combo = this.addCCombo(
- container,
- listHolder,
- selectedItemHolder,
- stringConverter
- );
-
- this.addLabeledComposite(
- container,
- labelText,
- (combo.getParent() != container) ? combo.getParent() : combo,
- rightControl,
- helpId
- );
-
- return combo;
- }
-
- /**
- * Creates a new container that will have a non-editable combo labeled with
- * the given text.
- *
- * @param container The parent container
- * @param labelText The text of the label
- * @param listHolder The <code>ListValueHolder</code>
- * @param selectedItemHolder The holder of the selected item
- * @param rightControl The control shown to the right of the main widget
- * @param helpId The topic help ID to be registered for the given center
- * compositer
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- protected final <V> CCombo addLabeledCCombo(Composite container,
- String labelText,
- ListValueModel<V> listHolder,
- WritablePropertyValueModel<V> selectedItemHolder,
- StringConverter<V> stringConverter,
- String helpId) {
-
- return this.addLabeledCCombo(
- container,
- labelText,
- listHolder,
- selectedItemHolder,
- stringConverter,
- null,
- helpId
- );
- }
-
- /**
- * Creates a new container that will have a non-editable combo labeled with
- * the given text.
- *
- * @param container The parent container
- * @param labelText The text of the label
- * @param listHolder The <code>ListValueHolder</code>
- * @param selectedItemHolder The holder of the selected item
- * @param rightControl The control shown to the right of the main widget
- * @param helpId The topic help ID to be registered for the given center
- * compositer
* @return The container of the label and the given center control
*
* @category Layout
@@ -1439,7 +1220,7 @@ public abstract class Pane<T extends Model>
String helpId) {
// Container for the label and main composite
- container = this.addSubPane(container, 3, 5, 0, 0, 0);
+ container = this.addSubPane(container, 3, 0, 0, 0, 0);
// Left control
GridData gridData = new GridData();
@@ -1621,114 +1402,6 @@ public abstract class Pane<T extends Model>
}
/**
- * Creates a new container that will have an editable combo labeled with the
- * given text.
- *
- * @param container The parent container
- * @param labelText The text of the label
- * @param listHolder The <code>ListValueHolder</code>
- * @param selectedItemHolder The holder of the selected item
- * @param helpId The topic help ID to be registered for the given center
- * compositer
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- protected final <V> CCombo addLabeledEditableCCombo(Composite container,
- String labelText,
- ListValueModel<V> listHolder,
- WritablePropertyValueModel<V> selectedItemHolder,
- String helpId) {
-
- return this.addLabeledEditableCCombo(
- container,
- labelText,
- listHolder,
- selectedItemHolder,
- StringConverter.Default.<V>instance(),
- null,
- helpId
- );
- }
-
- /**
- * Creates a new container that will have the given center control labeled
- * with the given label.
- *
- * @param container The parent container
- * @param labelText The text of the label
- * @param listHolder The <code>ListValueHolder</code>
- * @param selectedItemHolder The holder of the selected item
- * @param stringConverter The converter responsible to transform each item
- * into a string representation
- * @param rightControl The control shown to the right of the main widget
- * @param helpId The topic help ID to be registered for the given center
- * compositer
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- protected final <V> CCombo addLabeledEditableCCombo(Composite container,
- String labelText,
- ListValueModel<V> listHolder,
- WritablePropertyValueModel<V> selectedItemHolder,
- StringConverter<V> stringConverter,
- Control rightControl,
- String helpId) {
-
- CCombo combo = this.addEditableCCombo(
- container,
- listHolder,
- selectedItemHolder,
- stringConverter
- );
-
- this.addLabeledComposite(
- container,
- labelText,
- (combo.getParent() != container) ? combo.getParent() : combo,
- rightControl,
- helpId
- );
-
- return combo;
- }
-
- /**
- * Creates a new container that will have an editable combo labeled with the
- * given text.
- *
- * @param container The parent container
- * @param labelText The text of the label
- * @param listHolder The <code>ListValueHolder</code>
- * @param selectedItemHolder The holder of the selected item
- * @param stringConverter The converter responsible to transform each item
- * into a string representation
- * @param helpId The topic help ID to be registered for the given center
- * compositer
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- protected final <V> CCombo addLabeledEditableCCombo(Composite container,
- String labelText,
- ListValueModel<V> listHolder,
- WritablePropertyValueModel<V> selectedItemHolder,
- StringConverter<V> stringConverter,
- String helpId) {
-
- return this.addLabeledEditableCCombo(
- container,
- labelText,
- listHolder,
- selectedItemHolder,
- stringConverter,
- null,
- helpId
- );
- }
-
- /**
* Creates a new container that will have the given center control labeled
* with the given label.
*
@@ -1742,13 +1415,13 @@ public abstract class Pane<T extends Model>
*
* @category Layout
*/
- protected final CCombo addLabeledEditableCCombo(Composite container,
+ protected final Combo addLabeledEditableCombo(Composite container,
String labelText,
ModifyListener comboListener,
Control rightControl,
String helpId) {
- CCombo combo = this.addEditableCCombo(container);
+ Combo combo = this.addEditableCombo(container);
combo.addModifyListener(comboListener);
this.addLabeledComposite(
@@ -1776,12 +1449,12 @@ public abstract class Pane<T extends Model>
*
* @category Layout
*/
- protected final CCombo addLabeledEditableCCombo(Composite container,
+ protected final Combo addLabeledEditableCombo(Composite container,
String labelText,
ModifyListener comboListener,
String helpId) {
- return this.addLabeledEditableCCombo(
+ return this.addLabeledEditableCombo(
container,
labelText,
comboListener,
@@ -1806,19 +1479,19 @@ public abstract class Pane<T extends Model>
*
* @category Layout
*/
- protected final CCombo addLabeledEditableCComboViewer(Composite container,
+ protected final Combo addLabeledEditableComboViewer(Composite container,
String labelText,
ModifyListener comboListener,
ILabelProvider labelProvider,
Control rightControl,
String helpId) {
- ComboViewer comboViewer = this.addEditableCComboViewer(
+ ComboViewer comboViewer = this.addEditableComboViewer(
container,
labelProvider
);
- CCombo combo = comboViewer.getCCombo();
+ Combo combo = comboViewer.getCombo();
combo.addModifyListener(comboListener);
this.addLabeledComposite(
@@ -1848,13 +1521,13 @@ public abstract class Pane<T extends Model>
*
* @category Layout
*/
- protected final CCombo addLabeledEditableCComboViewer(Composite container,
+ protected final Combo addLabeledEditableComboViewer(Composite container,
String labelText,
ModifyListener comboListener,
ILabelProvider labelProvider,
String helpId) {
- return this.addLabeledEditableCComboViewer(
+ return this.addLabeledEditableComboViewer(
container,
labelText,
comboListener,
@@ -2277,7 +1950,7 @@ public abstract class Pane<T extends Model>
return dateTime;
}
/**
- * Creates a new editable <code>CCombo</code>.
+ * Creates a new editable <code>Combo</code>.
*
* @param container The parent container
* @param listHolder The <code>ListValueHolder</code>
@@ -2288,14 +1961,14 @@ public abstract class Pane<T extends Model>
*
* @category Layout
*/
- private <V> CCombo addUnmanagedEditableCCombo(Composite container,
+ private <V> Combo addUnmanagedEditableCombo(Composite container,
ListValueModel<V> listHolder,
WritablePropertyValueModel<V> selectedItemHolder,
StringConverter<V> stringConverter) {
- CCombo combo = addUnmanagedEditableCCombo(container);
+ Combo combo = addUnmanagedEditableCombo(container);
- CComboModelAdapter.adapt(
+ ComboModelAdapter.adapt(
listHolder,
selectedItemHolder,
combo,
@@ -2307,16 +1980,16 @@ public abstract class Pane<T extends Model>
/**
- * Creates a new editable <code>CCombo</code>.
+ * Creates a new editable <code>Combo</code>.
*
* @param container The parent container
* @return The newly created <code>CCombo</code>
*
* @category Layout
*/
- private CCombo addUnmanagedEditableCCombo(Composite container) {
+ private Combo addUnmanagedEditableCombo(Composite container) {
- CCombo combo = this.widgetFactory.createEditableCCombo(container);
+ Combo combo = this.widgetFactory.createEditableCombo(container);
combo.setLayoutData(getFieldGridData());
return combo;
}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/CComboModelAdapterTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/CComboModelAdapterTest.java
deleted file mode 100644
index 4cf143eb90..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/CComboModelAdapterTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.swt;
-
-import org.eclipse.jpt.ui.internal.swt.AbstractComboModelAdapter;
-import org.eclipse.jpt.ui.internal.swt.CComboModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.SimpleDisplayable;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.junit.After;
-
-public class CComboModelAdapterTest extends AbstractComboModelAdapterTest {
-
- private CCombo combo;
-
- @Override
- protected AbstractComboModelAdapter<SimpleDisplayable> buildEditableComboModelAdapter() {
-
- combo = new CCombo(shell(), SWT.NULL);
-
- return CComboModelAdapter.adapt(
- buildListHolder(),
- selectedItemHolder(),
- combo,
- buildStringConverter()
- );
- }
-
- @Override
- protected AbstractComboModelAdapter<SimpleDisplayable> buildReadOnlyComboModelAdapter() {
-
- combo = new CCombo(shell(), SWT.READ_ONLY);
-
- return CComboModelAdapter.adapt(
- buildListHolder(),
- selectedItemHolder(),
- combo,
- buildStringConverter()
- );
- }
-
- @Override
- public String comboSelectedItem() {
- return combo.getText();
- }
-
- @Override
- protected boolean emptyComboCanHaveSelectedValue() {
- return true;
- }
-
- @Override
- protected String itemAt(int index) {
- return this.combo.getItem(index);
- }
-
- @Override
- protected int itemCounts() {
- return combo.getItemCount();
- }
-
- @After
- @Override
- public void tearDown() throws Exception {
- super.tearDown();
- combo = null;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/JptUiSWTTests.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/JptUiSWTTests.java
index 12a8c2fbce..79dc602321 100644
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/JptUiSWTTests.java
+++ b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/JptUiSWTTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2010 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -18,7 +18,6 @@ import org.junit.runners.Suite.SuiteClasses;
@SuiteClasses
({
- CComboModelAdapterTest.class,
ComboModelAdapterTest.class,
SpinnerModelAdapterTest.class,
TableModelAdapterTest.class
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/utility/swt/DropDownListBoxModelBindingUITest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/utility/swt/DropDownListBoxModelBindingUITest.java
index 15f31aa182..65499c2cb3 100644
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/utility/swt/DropDownListBoxModelBindingUITest.java
+++ b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/utility/swt/DropDownListBoxModelBindingUITest.java
@@ -31,7 +31,6 @@ import org.eclipse.jpt.utility.model.Model;
import org.eclipse.jpt.utility.model.value.ListValueModel;
import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
@@ -97,30 +96,29 @@ public class DropDownListBoxModelBindingUITest
panel.setLayoutData(fd);
panel.setLayout(new FormLayout());
- this.buildTaskListPanel(panel, false); // false = native (Combo)
- this.buildTaskListPanel(panel, true); // true = custom (CCombo)
+ this.buildTaskListPanel_(panel); // false = native (Combo)
return panel;
}
- private Control buildTaskListPanel(Composite parent, boolean custom) {
+ private Control buildTaskListPanel_(Composite parent) {
Composite panel = new Composite(parent, SWT.NONE);
FormData fd = new FormData();
- fd.top = new FormAttachment(custom ? 50 : 0);
- fd.bottom = new FormAttachment(custom ? 100 : 50);
+ fd.top = new FormAttachment(0);
+ fd.bottom = new FormAttachment(50);
fd.left = new FormAttachment(0);
fd.right = new FormAttachment(100);
panel.setLayoutData(fd);
panel.setLayout(new FormLayout());
- this.buildPrimitiveTaskListPanel(panel, custom);
- this.buildObjectTaskListPanel(panel, custom);
+ this.buildPrimitiveTaskListPanel(panel);
+ this.buildObjectTaskListPanel(panel);
return panel;
}
- private void buildPrimitiveTaskListPanel(Composite parent, boolean custom) {
+ private void buildPrimitiveTaskListPanel(Composite parent) {
Composite panel = new Composite(parent, SWT.NONE);
FormData fd = new FormData();
@@ -131,12 +129,12 @@ public class DropDownListBoxModelBindingUITest
panel.setLayoutData(fd);
panel.setLayout(new FillLayout());
- this.buildUnsortedPrimitiveListPanel(panel, custom);
- this.buildStandardSortedPrimitiveListPanel(panel, custom);
- this.buildCustomSortedPrimitiveListPanel(panel, custom);
+ this.buildUnsortedPrimitiveListPanel(panel);
+ this.buildStandardSortedPrimitiveListPanel(panel);
+ this.buildCustomSortedPrimitiveListPanel(panel);
}
- private void buildObjectTaskListPanel(Composite parent, boolean custom) {
+ private void buildObjectTaskListPanel(Composite parent) {
Composite panel = new Composite(parent, SWT.NONE);
FormData fd = new FormData();
@@ -147,45 +145,39 @@ public class DropDownListBoxModelBindingUITest
panel.setLayoutData(fd);
panel.setLayout(new FillLayout());
- this.buildUnsortedObjectListPanel(panel, custom);
- this.buildStandardSortedObjectListPanel(panel, custom);
- this.buildCustomSortedObjectListPanel(panel, custom);
+ this.buildUnsortedObjectListPanel(panel);
+ this.buildStandardSortedObjectListPanel(panel);
+ this.buildCustomSortedObjectListPanel(panel);
}
- private void buildUnsortedPrimitiveListPanel(Composite parent, boolean custom) {
+ private void buildUnsortedPrimitiveListPanel(Composite parent) {
String label = "primitive unsorted";
- if (custom) label += " (custom)";
- this.buildComboBoxPanel(parent, label, this.buildUnsortedPrimitiveListModel(), this.buildPriorityTaskNameAdapter(), custom);
+ this.buildComboBoxPanel(parent, label, this.buildUnsortedPrimitiveListModel(), this.buildPriorityTaskNameAdapter());
}
- private void buildStandardSortedPrimitiveListPanel(Composite parent, boolean custom) {
+ private void buildStandardSortedPrimitiveListPanel(Composite parent) {
String label = "primitive sorted";
- if (custom) label += " (custom)";
- this.buildComboBoxPanel(parent, label, this.buildStandardSortedPrimitiveListModel(), this.buildPriorityTaskNameAdapter(), custom);
+ this.buildComboBoxPanel(parent, label, this.buildStandardSortedPrimitiveListModel(), this.buildPriorityTaskNameAdapter());
}
- private void buildCustomSortedPrimitiveListPanel(Composite parent, boolean custom) {
+ private void buildCustomSortedPrimitiveListPanel(Composite parent) {
String label = "primitive reverse sorted";
- if (custom) label += " (custom)";
- this.buildComboBoxPanel(parent, label, this.buildCustomSortedPrimitiveListModel(), this.buildPriorityTaskNameAdapter(), custom);
+ this.buildComboBoxPanel(parent, label, this.buildCustomSortedPrimitiveListModel(), this.buildPriorityTaskNameAdapter());
}
- private void buildUnsortedObjectListPanel(Composite parent, boolean custom) {
+ private void buildUnsortedObjectListPanel(Composite parent) {
String label = "object unsorted";
- if (custom) label += " (custom)";
- this.buildComboBoxPanel(parent, label, this.buildUnsortedObjectListModel(), this.buildPriorityTaskAdapter(), custom);
+ this.buildComboBoxPanel(parent, label, this.buildUnsortedObjectListModel(), this.buildPriorityTaskAdapter());
}
- private void buildStandardSortedObjectListPanel(Composite parent, boolean custom) {
+ private void buildStandardSortedObjectListPanel(Composite parent) {
String label = "object sorted";
- if (custom) label += " (custom)";
- this.buildComboBoxPanel(parent, label, this.buildStandardSortedObjectListModel(), this.buildPriorityTaskAdapter(), custom);
+ this.buildComboBoxPanel(parent, label, this.buildStandardSortedObjectListModel(), this.buildPriorityTaskAdapter());
}
- private void buildCustomSortedObjectListPanel(Composite parent, boolean custom) {
+ private void buildCustomSortedObjectListPanel(Composite parent) {
String label = "object reverse sorted";
- if (custom) label += " (custom)";
- this.buildComboBoxPanel(parent, label, this.buildCustomSortedObjectListModel(), this.buildPriorityTaskAdapter(), custom);
+ this.buildComboBoxPanel(parent, label, this.buildCustomSortedObjectListModel(), this.buildPriorityTaskAdapter());
}
private ListValueModel<String> buildUnsortedPrimitiveListModel() {
@@ -212,7 +204,7 @@ public class DropDownListBoxModelBindingUITest
return new SortedListValueModelWrapper<Task>(this.buildObjectTaskListAdapter(), this.buildCustomTaskComparator());
}
- private <E> void buildComboBoxPanel(Composite parent, String label, ListValueModel<E> model, WritablePropertyValueModel<E> selectedItemModel, boolean custom) {
+ private <E> void buildComboBoxPanel(Composite parent, String label, ListValueModel<E> model, WritablePropertyValueModel<E> selectedItemModel) {
Composite panel = new Composite(parent, SWT.NONE);
panel.setLayout(new FormLayout());
@@ -225,23 +217,18 @@ public class DropDownListBoxModelBindingUITest
fd.right = new FormAttachment(100);
comboBoxLabel.setLayoutData(fd);
- Control comboBox = this.buildComboBox(panel, custom);
+ Combo comboBox = this.buildComboBox(panel);
fd = new FormData();
fd.top = new FormAttachment(comboBoxLabel);
fd.bottom = new FormAttachment(100);
fd.left = new FormAttachment(0);
fd.right = new FormAttachment(100);
comboBox.setLayoutData(fd);
- if (custom) {
- SWTTools.bind(model, selectedItemModel, (CCombo) comboBox); // use #toString()
- } else {
- SWTTools.bind(model, selectedItemModel, (Combo) comboBox); // use #toString()
- }
+ SWTTools.bind(model, selectedItemModel, comboBox); // use #toString()
}
- private Control buildComboBox(Composite parent, boolean custom) {
- int style = SWT.READ_ONLY;
- return custom ? new CCombo(parent, style) : new Combo(parent, style);
+ private Combo buildComboBox(Composite parent) {
+ return new Combo(parent, SWT.READ_ONLY);
}
private Comparator<String> buildCustomStringComparator() {

Back to the top