diff options
author | Simon Rettberg | 2015-07-13 11:28:40 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-07-13 11:28:40 +0200 |
commit | b05245a9fa1c0b0791f44b0fc76d6b3ae3b10637 (patch) | |
tree | 6b09acfa6076c8e5842509c1cedf5c42b60d2e15 /dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java | |
parent | [client] Formatting, moved generic showMessageBox to Gui class (diff) | |
download | tutor-module-b05245a9fa1c0b0791f44b0fc76d6b3ae3b10637.tar.gz tutor-module-b05245a9fa1c0b0791f44b0fc76d6b3ae3b10637.tar.xz tutor-module-b05245a9fa1c0b0791f44b0fc76d6b3ae3b10637.zip |
[client] Cleaned up and fixed image list window layout
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java index 96bf48a9..4e2acb7c 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java @@ -5,13 +5,16 @@ import org.eclipse.jface.viewers.TableViewer; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.graphics.Point; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.Text; import org.openslx.dozmod.gui.helper.Gui; @@ -19,7 +22,7 @@ import org.openslx.dozmod.gui.helper.TableHelper; public abstract class ImageListWindowLayout extends Composite { - protected String infoTitleString = "Imageauswahl"; + protected String infoTitleString = "Übersicht Virtuelle Maschinen"; protected String newButtonLabel = "Neu"; protected String editButtonLabel = "Bearbeiten"; protected String deleteButtonLabel = "Löschen"; @@ -44,7 +47,7 @@ public abstract class ImageListWindowLayout extends Composite { protected final TableViewer tableViewer; - protected String infoTextString = "Hier können Sie images erstellen, bearbeiten und löschen."; + protected String infoTextString = "Hier können Sie Virtuelle Maschinen hochladen, herunterladen, bearbeiten und löschen."; public ImageListWindowLayout(final Composite mainShell) { super(mainShell, SWT.NONE); @@ -53,7 +56,7 @@ public abstract class ImageListWindowLayout extends Composite { this.setLayout(new GridLayout(2, false)); this.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - // info group with title and text + // -- info group with title and text -- Composite infoComposite = new Composite(this, SWT.BORDER); GridData infoGridData = new GridData(SWT.FILL, SWT.FILL, true, false); infoGridData.horizontalSpan = 2; @@ -71,18 +74,20 @@ public abstract class ImageListWindowLayout extends Composite { // the infotext Label infoText = new Label(infoComposite, SWT.NONE); infoText.setText(infoTextString); + // -- end group of title -- - // group for the table + // -- group for the table -- Group tableGroup = new Group(this, SWT.BORDER); tableGroup.setText(tableGroupLabel); - tableGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - tableGroup.setLayout(new GridLayout(3, true)); + GridData tgLayoutData = new GridData(SWT.FILL, SWT.FILL, true, true); + tgLayoutData.minimumWidth = 400; + tgLayoutData.widthHint = 800; + tableGroup.setLayoutData(tgLayoutData); + tableGroup.setLayout(new GridLayout()); - // jface tableviewer on swt table + // table Table vmTable = new Table(tableGroup, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); GridData tableGridData = new GridData(SWT.FILL, SWT.FILL, true, true); - tableGridData.horizontalSpan = 3; - tableGridData.minimumWidth = 200; vmTable.setLayoutData(tableGridData); vmTable.setHeaderVisible(true); vmTable.setLinesVisible(true); @@ -90,13 +95,11 @@ public abstract class ImageListWindowLayout extends Composite { // TableViewer on the table tableViewer = new TableViewer(vmTable); tableViewer.setContentProvider(ArrayContentProvider.getInstance()); - TableHelper.createImageTableColumns(tableViewer); // create, modify, download and delete buttons Composite buttonComposite = new Composite(tableGroup, SWT.NONE); GridData buttonCompositeGridData = new GridData(SWT.FILL, SWT.FILL, true, false); - buttonCompositeGridData.horizontalSpan = 4; buttonCompositeGridData.minimumWidth = 200; buttonComposite.setLayoutData(buttonCompositeGridData); buttonComposite.setLayout(new RowLayout()); @@ -112,34 +115,34 @@ public abstract class ImageListWindowLayout extends Composite { downloadButton = new Button(buttonComposite, SWT.PUSH); downloadButton.setText(downloadButtonLabel); + // -- end group for table -- - // group for the info of the selected image in the tableViewer - Group vmInfoGroup = new Group(this, SWT.BORDER); + // -- group for details of selected image -- + final Group vmInfoGroup = new Group(this, SWT.BORDER); vmInfoGroup.setText(vmInfoGroupLabel); - buttonCompositeGridData = new GridData(SWT.FILL, SWT.FILL, true, false); - buttonCompositeGridData.minimumWidth = 300; - vmInfoGroup.setLayoutData(buttonCompositeGridData); + final GridData igGridData = new GridData(SWT.FILL, SWT.FILL, true, false); + igGridData.widthHint = 300; + vmInfoGroup.setLayoutData(igGridData); vmInfoGroup.setLayout(new GridLayout(2, false)); // image name info imageSelectedNameLabel = createCaptionAndTextfield("Image Name:", vmInfoGroup); - - // id info idInfo = createCaptionAndTextfield("ID:", vmInfoGroup); versionInfo = createCaptionAndTextfield("Version", vmInfoGroup); lastUpdateInfo = createCaptionAndTextfield("Letztes Update:", vmInfoGroup); permissionInfo = createCaptionAndTextfield("Berechtigungen:", vmInfoGroup); ownerInfo = createCaptionAndTextfield("Besitzer ID", vmInfoGroup); templateInfo = createCaptionAndTextfield("Vorlage:", vmInfoGroup); - + // -- end group of details -- } public Text createCaptionAndTextfield(String captionString, Group group) { Label caption = new Label(group, SWT.NONE); Text textField = new Text(group, SWT.READ_ONLY); caption.setText(captionString); + caption.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false); - gridData.minimumWidth = 100; + gridData.minimumWidth = 180; textField.setLayoutData(gridData); return textField; } |