aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Wegmueller2013-05-06 01:07:49 (EDT)
committerGerrit Code Review @ Eclipse.org2013-05-06 07:26:03 (EDT)
commit1d0407af1cba6865aa02557f8883018b61353d93 (patch)
tree4ce810c7b4f39584be40508fa4c90cdb5dc22631
parent292726cde7a7703e706e3228b23ac1f4c9e9248c (diff)
downloadorg.eclipse.scout.rt-1d0407af1cba6865aa02557f8883018b61353d93.zip
org.eclipse.scout.rt-1d0407af1cba6865aa02557f8883018b61353d93.tar.gz
org.eclipse.scout.rt-1d0407af1cba6865aa02557f8883018b61353d93.tar.bz2
Bug 405354: Swing: hard-wired SwingScoutTable instantiationrefs/changes/95/12095/4
* Modification of ISwingEnvironment (add a new createTable(..) method) * Modification of the swing fields using a table * Add tests https://bugs.eclipse.org/bugs/show_bug.cgi?id=405354 Change-Id: Ied79fc60568ec04553a6bb31d97a59fce0d1bd4b
-rw-r--r--org.eclipse.scout.rt.ui.swing.test/src/org/eclipse/scout/rt/ui/swing/form/fields/listbox/SwingScoutListBoxUiTest.java74
-rw-r--r--org.eclipse.scout.rt.ui.swing.test/src/org/eclipse/scout/rt/ui/swing/form/fields/plannerfield/SwingScoutPlannerFieldUiTest.java85
-rw-r--r--org.eclipse.scout.rt.ui.swing.test/src/org/eclipse/scout/rt/ui/swing/form/fields/tablefield/SwingScoutTableFieldUiTest.java82
-rw-r--r--org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/AbstractSwingEnvironment.java9
-rw-r--r--org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/ISwingEnvironment.java25
-rw-r--r--org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/form/fields/listbox/SwingScoutListBox.java7
-rw-r--r--org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/form/fields/plannerfield/SwingScoutPlannerField.java7
-rw-r--r--org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/form/fields/tablefield/SwingScoutTableField.java5
8 files changed, 281 insertions, 13 deletions
diff --git a/org.eclipse.scout.rt.ui.swing.test/src/org/eclipse/scout/rt/ui/swing/form/fields/listbox/SwingScoutListBoxUiTest.java b/org.eclipse.scout.rt.ui.swing.test/src/org/eclipse/scout/rt/ui/swing/form/fields/listbox/SwingScoutListBoxUiTest.java
new file mode 100644
index 0000000..ec851d7
--- /dev/null
+++ b/org.eclipse.scout.rt.ui.swing.test/src/org/eclipse/scout/rt/ui/swing/form/fields/listbox/SwingScoutListBoxUiTest.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2013 BSI Business Systems Integration AG.
+ * 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:
+ * BSI Business Systems Integration AG - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.scout.rt.ui.swing.form.fields.listbox;
+
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.createNiceMock;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+
+import org.easymock.EasyMock;
+import org.eclipse.scout.rt.client.ui.action.keystroke.IKeyStroke;
+import org.eclipse.scout.rt.client.ui.basic.table.AbstractTable;
+import org.eclipse.scout.rt.client.ui.basic.table.ITable;
+import org.eclipse.scout.rt.client.ui.form.fields.GridData;
+import org.eclipse.scout.rt.client.ui.form.fields.IFormField;
+import org.eclipse.scout.rt.client.ui.form.fields.listbox.IListBox;
+import org.eclipse.scout.rt.ui.swing.ISwingEnvironment;
+import org.eclipse.scout.rt.ui.swing.basic.table.SwingScoutTable;
+import org.eclipse.scout.rt.ui.swing.ext.JStatusLabelEx;
+import org.junit.Test;
+
+/**
+ * Test for {@link SwingScoutListBox}
+ *
+ * @since 3.9.0
+ */
+public class SwingScoutListBoxUiTest {
+
+ /**
+ * Test method for {@link SwingScoutListBox#initializeSwing()}.
+ */
+ @Test
+ public void testInitializeSwing() {
+
+ ITable scoutTable = new P_Table();
+
+ IListBox scoutObject = createNiceMock(IListBox.class);
+ scoutObject.getTable();
+ expectLastCall().andReturn(scoutTable);
+ scoutObject.getGridData();
+ expectLastCall().andReturn(new GridData(1, 1, 1, 1, 1.0, 1.0)).anyTimes();
+ scoutObject.getFields();
+ expectLastCall().andReturn(new IFormField[]{});
+ scoutObject.getKeyStrokes();
+ expectLastCall().andReturn(new IKeyStroke[]{}).anyTimes();
+
+ ISwingEnvironment environment = createMock(ISwingEnvironment.class);
+ environment.createStatusLabel(EasyMock.<IFormField> anyObject());
+ expectLastCall().andReturn(new JStatusLabelEx());
+ environment.createTable(scoutTable); //Bug 405354: creation of the table is delegated to ISwingEnvironment
+ expectLastCall().andReturn(new SwingScoutTable());
+ environment.getFieldLabelWidth();
+ expectLastCall().andReturn(100).anyTimes();
+
+ replay(scoutObject, environment);
+
+ SwingScoutListBox field = new SwingScoutListBox();
+ field.createField(scoutObject, environment); //initializeSwing() will be called in callInitializers().
+
+ verify(environment);
+ }
+
+ public static class P_Table extends AbstractTable {
+ }
+}
diff --git a/org.eclipse.scout.rt.ui.swing.test/src/org/eclipse/scout/rt/ui/swing/form/fields/plannerfield/SwingScoutPlannerFieldUiTest.java b/org.eclipse.scout.rt.ui.swing.test/src/org/eclipse/scout/rt/ui/swing/form/fields/plannerfield/SwingScoutPlannerFieldUiTest.java
new file mode 100644
index 0000000..c49cab3
--- /dev/null
+++ b/org.eclipse.scout.rt.ui.swing.test/src/org/eclipse/scout/rt/ui/swing/form/fields/plannerfield/SwingScoutPlannerFieldUiTest.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2013 BSI Business Systems Integration AG.
+ * 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:
+ * BSI Business Systems Integration AG - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.scout.rt.ui.swing.form.fields.plannerfield;
+
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.createNiceMock;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+
+import org.eclipse.scout.rt.client.ui.action.keystroke.IKeyStroke;
+import org.eclipse.scout.rt.client.ui.basic.activitymap.IActivityMap;
+import org.eclipse.scout.rt.client.ui.basic.activitymap.TimeScale;
+import org.eclipse.scout.rt.client.ui.basic.table.AbstractTable;
+import org.eclipse.scout.rt.client.ui.basic.table.ITable;
+import org.eclipse.scout.rt.client.ui.form.fields.GridData;
+import org.eclipse.scout.rt.client.ui.form.fields.plannerfield.IPlannerField;
+import org.eclipse.scout.rt.ui.swing.ISwingEnvironment;
+import org.eclipse.scout.rt.ui.swing.basic.table.SwingScoutTable;
+import org.junit.Test;
+
+/**
+ * Test for {@link SwingScoutPlannerFieldUiTest}
+ *
+ * @since 3.9.0
+ */
+public class SwingScoutPlannerFieldUiTest {
+
+ /**
+ * Test method for {@link SwingScoutPlannerField#initializeSwing()}.
+ */
+ @Test
+ public void testInitializeSwing() {
+ ITable scoutTable = new P_Table();
+
+ IActivityMap<?, ?> activityMap = createNiceMock(IActivityMap.class);
+ activityMap.getResourceIds();
+ expectLastCall().andReturn(new Object[]{}).anyTimes();
+ activityMap.getSelectedResourceIds();
+ expectLastCall().andReturn(new Object[]{});
+ activityMap.getTimeScale();
+ expectLastCall().andReturn(new TimeScale()).anyTimes();
+
+ IPlannerField<?, ?, ?, ?> scoutObject = createNiceMock(IPlannerField.class);
+ scoutObject.getResourceTable();
+ expectLastCall().andReturn(scoutTable);
+ scoutObject.getGridData();
+ expectLastCall().andReturn(new GridData(1, 1, 1, 1, 1.0, 1.0)).anyTimes();
+ scoutObject.getActivityMap();
+ expectLastCall().andReturn(activityMap);
+ scoutObject.getKeyStrokes();
+ expectLastCall().andReturn(new IKeyStroke[]{}).anyTimes();
+
+ ISwingEnvironment environment = createMock(ISwingEnvironment.class);
+ environment.createTable(scoutTable); //Bug 405354: creation of the table is delegated to ISwingEnvironment
+ expectLastCall().andReturn(new SwingScoutTable());
+ environment.getFormColumnWidth();
+ expectLastCall().andReturn(400).anyTimes();
+ environment.getFormColumnGap();
+ expectLastCall().andReturn(14).anyTimes();
+ environment.getFormRowHeight();
+ expectLastCall().andReturn(20).anyTimes();
+ environment.getFormRowGap();
+ expectLastCall().andReturn(5).anyTimes();
+
+ replay(activityMap, scoutObject, environment);
+
+ SwingScoutPlannerField field = new SwingScoutPlannerField();
+ field.createField(scoutObject, environment); //initializeSwing() will be called in callInitializers().
+
+ verify(environment);
+ }
+
+ public static class P_Table extends AbstractTable {
+ }
+
+}
diff --git a/org.eclipse.scout.rt.ui.swing.test/src/org/eclipse/scout/rt/ui/swing/form/fields/tablefield/SwingScoutTableFieldUiTest.java b/org.eclipse.scout.rt.ui.swing.test/src/org/eclipse/scout/rt/ui/swing/form/fields/tablefield/SwingScoutTableFieldUiTest.java
new file mode 100644
index 0000000..47c24ca
--- /dev/null
+++ b/org.eclipse.scout.rt.ui.swing.test/src/org/eclipse/scout/rt/ui/swing/form/fields/tablefield/SwingScoutTableFieldUiTest.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2013 BSI Business Systems Integration AG.
+ * 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:
+ * BSI Business Systems Integration AG - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.scout.rt.ui.swing.form.fields.tablefield;
+
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.createNiceMock;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+
+import org.easymock.EasyMock;
+import org.eclipse.scout.rt.client.ui.action.keystroke.IKeyStroke;
+import org.eclipse.scout.rt.client.ui.basic.table.AbstractTable;
+import org.eclipse.scout.rt.client.ui.basic.table.ITable;
+import org.eclipse.scout.rt.client.ui.form.IForm;
+import org.eclipse.scout.rt.client.ui.form.fields.GridData;
+import org.eclipse.scout.rt.client.ui.form.fields.IFormField;
+import org.eclipse.scout.rt.client.ui.form.fields.tablefield.ITableField;
+import org.eclipse.scout.rt.ui.swing.ISwingEnvironment;
+import org.eclipse.scout.rt.ui.swing.basic.table.SwingScoutTable;
+import org.eclipse.scout.rt.ui.swing.ext.JStatusLabelEx;
+import org.junit.Test;
+
+/**
+ * Junit test for {@link SwingScoutTableField}
+ *
+ * @since 3.9.0
+ */
+public class SwingScoutTableFieldUiTest {
+
+ /**
+ * Test method for {@link SwingScoutTableField#setTableFromScout()}.
+ */
+ @Test
+ public void testSetTableFromScout() {
+ IForm form = createNiceMock(IForm.class);
+ form.getDisplayViewId();
+ expectLastCall().andReturn(IForm.VIEW_ID_CENTER);
+ form.getOuterForm();
+ expectLastCall().andReturn(form);
+
+ ITable scoutTable = new P_Table();
+
+ ITableField<?> scoutObject = createNiceMock(ITableField.class);
+ scoutObject.getGridData();
+ expectLastCall().andReturn(new GridData(1, 1, 1, 1, 1.0, 1.0)).anyTimes();
+ scoutObject.getKeyStrokes();
+ expectLastCall().andReturn(new IKeyStroke[]{}).anyTimes();
+ scoutObject.getTable();
+ expectLastCall().andReturn(scoutTable);
+ scoutObject.getLabelPosition();
+ expectLastCall().andReturn(IFormField.LABEL_POSITION_DEFAULT);
+ scoutObject.getForm();
+ expectLastCall().andReturn(form).anyTimes();
+
+ ISwingEnvironment environment = createMock(ISwingEnvironment.class);
+ environment.createStatusLabel(EasyMock.<IFormField> anyObject());
+ expectLastCall().andReturn(new JStatusLabelEx());
+ environment.getFieldLabelWidth();
+ expectLastCall().andReturn(100).anyTimes();
+ environment.createTable(scoutTable); //Bug 405354: creation of the table is delegated to ISwingEnvironment
+ expectLastCall().andReturn(new SwingScoutTable());
+
+ replay(form, scoutObject, environment);
+
+ SwingScoutTableField field = new SwingScoutTableField();
+ field.createField(scoutObject, environment); //setTableFromScout() will be called in attachScout().
+
+ verify(environment);
+ }
+
+ public static class P_Table extends AbstractTable {
+ }
+}
diff --git a/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/AbstractSwingEnvironment.java b/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/AbstractSwingEnvironment.java
index d223a48..a24ba74 100644
--- a/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/AbstractSwingEnvironment.java
+++ b/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/AbstractSwingEnvironment.java
@@ -57,6 +57,7 @@ import org.eclipse.scout.rt.client.busy.IBusyManagerService;
import org.eclipse.scout.rt.client.ui.ClientUIPreferences;
import org.eclipse.scout.rt.client.ui.action.IAction;
import org.eclipse.scout.rt.client.ui.basic.filechooser.IFileChooser;
+import org.eclipse.scout.rt.client.ui.basic.table.ITable;
import org.eclipse.scout.rt.client.ui.desktop.DesktopEvent;
import org.eclipse.scout.rt.client.ui.desktop.DesktopListener;
import org.eclipse.scout.rt.client.ui.desktop.IDesktop;
@@ -69,6 +70,8 @@ import org.eclipse.scout.rt.client.ui.form.fields.mailfield.IMailField;
import org.eclipse.scout.rt.client.ui.messagebox.IMessageBox;
import org.eclipse.scout.rt.ui.swing.action.ISwingScoutAction;
import org.eclipse.scout.rt.ui.swing.basic.SwingScoutComposite;
+import org.eclipse.scout.rt.ui.swing.basic.table.ISwingScoutTable;
+import org.eclipse.scout.rt.ui.swing.basic.table.SwingScoutTable;
import org.eclipse.scout.rt.ui.swing.concurrency.SwingScoutSynchronizer;
import org.eclipse.scout.rt.ui.swing.ext.IEmbeddedFrameProviderService;
import org.eclipse.scout.rt.ui.swing.ext.JDialogEx;
@@ -1189,4 +1192,10 @@ public abstract class AbstractSwingEnvironment implements ISwingEnvironment {
ClientUIPreferences.getInstance(getScoutSession()).setFormBounds(m_form, bounds);
}
}
+
+ @Override
+ public ISwingScoutTable createTable(ITable table) {
+ return new SwingScoutTable();
+ }
+
}
diff --git a/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/ISwingEnvironment.java b/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/ISwingEnvironment.java
index 4a386be..f57d513 100644
--- a/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/ISwingEnvironment.java
+++ b/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/ISwingEnvironment.java
@@ -27,6 +27,7 @@ import org.eclipse.scout.commons.job.JobEx;
import org.eclipse.scout.rt.client.IClientSession;
import org.eclipse.scout.rt.client.ui.action.IAction;
import org.eclipse.scout.rt.client.ui.basic.filechooser.IFileChooser;
+import org.eclipse.scout.rt.client.ui.basic.table.ITable;
import org.eclipse.scout.rt.client.ui.desktop.IDesktop;
import org.eclipse.scout.rt.client.ui.form.FormEvent;
import org.eclipse.scout.rt.client.ui.form.IForm;
@@ -34,6 +35,7 @@ import org.eclipse.scout.rt.client.ui.form.fields.IFormField;
import org.eclipse.scout.rt.client.ui.form.fields.groupbox.IGroupBox;
import org.eclipse.scout.rt.client.ui.messagebox.IMessageBox;
import org.eclipse.scout.rt.ui.swing.action.ISwingScoutAction;
+import org.eclipse.scout.rt.ui.swing.basic.table.ISwingScoutTable;
import org.eclipse.scout.rt.ui.swing.ext.JDialogEx;
import org.eclipse.scout.rt.ui.swing.ext.JStatusLabelEx;
import org.eclipse.scout.rt.ui.swing.form.ISwingScoutForm;
@@ -370,8 +372,7 @@ public interface ISwingEnvironment {
/**
* Use this decorator to complete and style (incomplete) client html text for html and label fields in order to match
- * current style
- * sheet settings based on a {@link component}s font and color
+ * current style sheet settings based on a {@link component}s font and color.
*/
String styleHtmlText(ISwingScoutFormField<?> uiComposite, String rawHtml);
@@ -382,12 +383,28 @@ public interface ISwingEnvironment {
FormEvent[] fetchPendingPrintEvents(IForm form);
/**
- * Enables customization of JDialogEx by returning subtypes
+ * Enables customization of JDialogEx by returning subtypes.
+ *
+ * @return
*/
JDialogEx createJDialogEx(Dialog swingParent);
/**
- * Enables customization of JDialogEx by returning subtypes
+ * Enables customization of JDialogEx by returning subtypes.
+ *
+ * @return
*/
JDialogEx createJDialogEx(Frame swingParent);
+
+ /**
+ * Creates a swing scout table instance for the given table model. The default implementation returns a
+ * SwingScoutTable instance.
+ *
+ * @param table
+ * Table model
+ * @return
+ * @since 3.9.0 (Bug 405354)
+ */
+ ISwingScoutTable createTable(ITable table);
+
}
diff --git a/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/form/fields/listbox/SwingScoutListBox.java b/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/form/fields/listbox/SwingScoutListBox.java
index 462af19..91b5866 100644
--- a/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/form/fields/listbox/SwingScoutListBox.java
+++ b/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/form/fields/listbox/SwingScoutListBox.java
@@ -14,13 +14,13 @@ import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.UIManager;
+import org.eclipse.scout.rt.client.ui.basic.table.ITable;
import org.eclipse.scout.rt.client.ui.form.fields.IFormField;
import org.eclipse.scout.rt.client.ui.form.fields.listbox.IListBox;
import org.eclipse.scout.rt.ui.swing.LogicalGridData;
import org.eclipse.scout.rt.ui.swing.LogicalGridLayout;
import org.eclipse.scout.rt.ui.swing.basic.ISwingScoutComposite;
import org.eclipse.scout.rt.ui.swing.basic.table.ISwingScoutTable;
-import org.eclipse.scout.rt.ui.swing.basic.table.SwingScoutTable;
import org.eclipse.scout.rt.ui.swing.ext.JPanelEx;
import org.eclipse.scout.rt.ui.swing.ext.JStatusLabelEx;
import org.eclipse.scout.rt.ui.swing.ext.JTableEx;
@@ -36,8 +36,9 @@ public class SwingScoutListBox extends SwingScoutValueFieldComposite<IListBox<?>
container.setOpaque(false);
JStatusLabelEx label = getSwingEnvironment().createStatusLabel(getScoutObject());
container.add(label);
- m_tableComposite = new SwingScoutTable();
- m_tableComposite.createField(getScoutObject().getTable(), getSwingEnvironment());
+ ITable scoutTable = getScoutObject().getTable();
+ m_tableComposite = getSwingEnvironment().createTable(scoutTable);
+ m_tableComposite.createField(scoutTable, getSwingEnvironment());
//adjust table row height
JTable table = m_tableComposite.getSwingTable();
if (UIManager.get("ListBox.rowHeight") != null) {
diff --git a/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/form/fields/plannerfield/SwingScoutPlannerField.java b/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/form/fields/plannerfield/SwingScoutPlannerField.java
index cebbcc1..cf6a681 100644
--- a/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/form/fields/plannerfield/SwingScoutPlannerField.java
+++ b/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/form/fields/plannerfield/SwingScoutPlannerField.java
@@ -30,11 +30,11 @@ import javax.swing.table.JTableHeader;
import org.eclipse.scout.commons.OptimisticLock;
import org.eclipse.scout.rt.client.ui.basic.activitymap.IActivityMap;
+import org.eclipse.scout.rt.client.ui.basic.table.ITable;
import org.eclipse.scout.rt.client.ui.form.fields.plannerfield.IPlannerField;
import org.eclipse.scout.rt.ui.swing.SwingUtility;
import org.eclipse.scout.rt.ui.swing.basic.activitymap.SwingScoutActivityMap;
import org.eclipse.scout.rt.ui.swing.basic.table.ISwingScoutTable;
-import org.eclipse.scout.rt.ui.swing.basic.table.SwingScoutTable;
import org.eclipse.scout.rt.ui.swing.ext.JPanelEx;
import org.eclipse.scout.rt.ui.swing.ext.calendar.CalendarViewEvent;
import org.eclipse.scout.rt.ui.swing.ext.calendar.CalendarViewListener;
@@ -58,8 +58,9 @@ public class SwingScoutPlannerField extends SwingScoutFieldComposite<IPlannerFie
protected void initializeSwing() {
JPanel container = new JPanel(new PlannerFieldLayout(getSwingEnvironment(), getScoutObject().getGridData()));
container.setOpaque(false);
- m_resourceTableComposite = new SwingScoutTable();
- m_resourceTableComposite.createField(getScoutObject().getResourceTable(), getSwingEnvironment());
+ ITable scoutTable = getScoutObject().getResourceTable();
+ m_resourceTableComposite = getSwingEnvironment().createTable(scoutTable);
+ m_resourceTableComposite.createField(scoutTable, getSwingEnvironment());
JTableHeader h = m_resourceTableComposite.getSwingTable().getTableHeader();
if (h != null) {
h.setPreferredSize(new Dimension(h.getPreferredSize().width, h.getFontMetrics(h.getFont()).getHeight() * 5 / 2));
diff --git a/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/form/fields/tablefield/SwingScoutTableField.java b/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/form/fields/tablefield/SwingScoutTableField.java
index d8ef67e..710603e 100644
--- a/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/form/fields/tablefield/SwingScoutTableField.java
+++ b/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/form/fields/tablefield/SwingScoutTableField.java
@@ -22,7 +22,6 @@ import org.eclipse.scout.rt.client.ui.form.fields.tablefield.ITableField;
import org.eclipse.scout.rt.ui.swing.LogicalGridData;
import org.eclipse.scout.rt.ui.swing.LogicalGridLayout;
import org.eclipse.scout.rt.ui.swing.basic.table.ISwingScoutTable;
-import org.eclipse.scout.rt.ui.swing.basic.table.SwingScoutTable;
import org.eclipse.scout.rt.ui.swing.ext.JPanelEx;
import org.eclipse.scout.rt.ui.swing.ext.JStatusLabelEx;
import org.eclipse.scout.rt.ui.swing.ext.JTableEx;
@@ -94,7 +93,7 @@ public class SwingScoutTableField extends SwingScoutFieldComposite<ITableField<?
getSwingTable().getTableHeader().repaint();
}
}
- // << bugzilla 364121
+ // << bugzilla 364121
}
protected void setTableStatusFromScout() {
@@ -117,7 +116,7 @@ public class SwingScoutTableField extends SwingScoutFieldComposite<ITableField<?
m_tableComposite = null;
}
if (newTable != null) {
- ISwingScoutTable newTableComposite = new SwingScoutTable();
+ ISwingScoutTable newTableComposite = getSwingEnvironment().createTable(newTable);
newTableComposite.createField(newTable, getSwingEnvironment());
// TODO replace with AbstractSwingEnvironment.createFormField.