summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2009-05-05 07:21:25 (EDT)
committerCarsten Drossel2009-05-05 07:21:25 (EDT)
commitd205ce3c27f934e488dee7ded4fba899d6d41911 (patch)
tree0810a0a7d4354202e56d5f9b6b663f996ab5c537
parent68022e330e186ef81b0c58eaf86dd7d148214923 (diff)
downloadorg.eclipse.riena-d205ce3c27f934e488dee7ded4fba899d6d41911.zip
org.eclipse.riena-d205ce3c27f934e488dee7ded4fba899d6d41911.tar.gz
org.eclipse.riena-d205ce3c27f934e488dee7ded4fba899d6d41911.tar.bz2
bug 274921 (layout broken)
-rw-r--r--org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/ExceptionTestView.java62
1 files changed, 22 insertions, 40 deletions
diff --git a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/ExceptionTestView.java b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/ExceptionTestView.java
index 2a3c606..49bc4c3 100644
--- a/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/ExceptionTestView.java
+++ b/org.eclipse.riena.example.client/src/org/eclipse/riena/example/client/views/ExceptionTestView.java
@@ -10,62 +10,44 @@
*******************************************************************************/
package org.eclipse.riena.example.client.views;
-import org.eclipse.riena.example.client.controllers.ExceptionTestController;
-import org.eclipse.riena.navigation.ui.swt.views.SubModuleView;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import com.swtdesigner.SWTResourceManager;
+import org.eclipse.riena.example.client.controllers.ExceptionTestController;
+import org.eclipse.riena.navigation.ui.swt.views.SubModuleView;
+import org.eclipse.riena.ui.swt.utils.UIControlsFactory;
/**
- *
+ * A demo simulating how exceptions are handled.
*/
public class ExceptionTestView extends SubModuleView<ExceptionTestController> {
- /*
- * (non-Javadoc)
- *
- * @seeorg.eclipse.riena.navigation.ui.swt.views.SubModuleView#
- * basicCreatePartControl(org.eclipse.swt.widgets.Composite)
- */
@Override
protected void basicCreatePartControl(Composite parent) {
- Composite container = new Composite(parent, SWT.NONE);
- container.setBackground(SWTResourceManager.getColor(255, 255, 255));
+ parent.setLayout(new GridLayout(1, true));
- final Button localNullPointer = new Button(container, SWT.NONE);
- localNullPointer.setText("throw NullPointerException"); //$NON-NLS-1$
- localNullPointer.setBounds(48, 94, 246, 31);
- addUIControl(localNullPointer, "localNullPointerAction"); //$NON-NLS-1$
+ UIControlsFactory.createLabel(parent, "Testing various Exceptions"); //$NON-NLS-1$
- final Label testingVariousExceptionsLabel = new Label(container, SWT.NONE);
- testingVariousExceptionsLabel.setBackground(SWTResourceManager.getColor(255, 255, 255));
- testingVariousExceptionsLabel.setText("Testing various Exceptions"); //$NON-NLS-1$
- testingVariousExceptionsLabel.setBounds(26, 34, 173, 13);
+ final Button localNullPointer = UIControlsFactory.createButton(parent, "throw NullPointerException", //$NON-NLS-1$
+ "localNullPointerAction"); //$NON-NLS-1$
+ addUIControl(localNullPointer);
- final Button uiprocessNullPointer1 = new Button(container, SWT.NONE);
- uiprocessNullPointer1.setText("throw NullPointerException in UIProcess (runJob)"); //$NON-NLS-1$
- uiprocessNullPointer1.setBounds(49, 149, 261, 23);
- addUIControl(uiprocessNullPointer1, "uiprocessNullPointerActionRunJob"); //$NON-NLS-1$
+ final Button uiprocessNullPointer1 = UIControlsFactory.createButton(parent,
+ "throw NullPointerException in UIProcess (runJob)", "uiprocessNullPointerActionRunJob"); //$NON-NLS-1$ //$NON-NLS-2$
+ addUIControl(uiprocessNullPointer1);
- final Button uiprocessNullPointer2 = new Button(container, SWT.NONE);
- uiprocessNullPointer2.setText("throw NullPointerException in UIProcess (finalUpdateUI)"); //$NON-NLS-1$
- uiprocessNullPointer2.setBounds(48, 188, 288, 23);
- addUIControl(uiprocessNullPointer2, "uiprocessNullPointerActionFinalUpdateUI"); //$NON-NLS-1$
+ final Button uiprocessNullPointer2 = UIControlsFactory.createButton(parent,
+ "throw NullPointerException in UIProcess (finalUpdateUI)", "uiprocessNullPointerActionFinalUpdateUI"); //$NON-NLS-1$ //$NON-NLS-2$
+ addUIControl(uiprocessNullPointer2);
- final Button uiprocessNullPointer3 = new Button(container, SWT.NONE);
- uiprocessNullPointer3.setText("throw NullPointerException in UIProcess (updateUI)"); //$NON-NLS-1$
- uiprocessNullPointer3.setBounds(48, 228, 288, 23);
- addUIControl(uiprocessNullPointer3, "uiprocessNullPointerActionUpdateUI"); //$NON-NLS-1$
+ final Button uiprocessNullPointer3 = UIControlsFactory.createButton(parent,
+ "throw NullPointerException in UIProcess (updateUI)", "uiprocessNullPointerActionUpdateUI"); //$NON-NLS-1$ //$NON-NLS-2$
+ addUIControl(uiprocessNullPointer3);
- final Button serverNullPointer = new Button(container, SWT.NONE);
- serverNullPointer.setText("throw NullPointerException on server"); //$NON-NLS-1$
- serverNullPointer.setBounds(48, 411, 246, 31);
- parent.setLayout(new FillLayout());
- addUIControl(serverNullPointer, "serverNullPointerAction"); //$NON-NLS-1$
+ final Button serverNullPointer = UIControlsFactory.createButton(parent,
+ "throw NullPointerException on server", "serverNullPointerAction"); //$NON-NLS-1$ //$NON-NLS-2$
+ addUIControl(serverNullPointer);
}
}