diff --git a/plugins/de.cognicrypt.codegenerator/src/main/java/de/cognicrypt/codegenerator/wizard/CogniCryptWizardDialog.java b/plugins/de.cognicrypt.codegenerator/src/main/java/de/cognicrypt/codegenerator/wizard/CogniCryptWizardDialog.java index a7ee0659d..7f9e7c2c3 100644 --- a/plugins/de.cognicrypt.codegenerator/src/main/java/de/cognicrypt/codegenerator/wizard/CogniCryptWizardDialog.java +++ b/plugins/de.cognicrypt.codegenerator/src/main/java/de/cognicrypt/codegenerator/wizard/CogniCryptWizardDialog.java @@ -13,6 +13,7 @@ import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.wizard.IWizard; import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.swt.graphics.Point; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Shell; @@ -21,6 +22,7 @@ public class CogniCryptWizardDialog extends WizardDialog { public CogniCryptWizardDialog(final Shell parentShell, final IWizard newWizard) { super(parentShell, newWizard); + this.setPageSize(new Point(400, 600)); } @Override @@ -29,5 +31,4 @@ protected void createButtonsForButtonBar(final Composite parent) { final Button finishButton = getButton(IDialogConstants.FINISH_ID); finishButton.setText("Generate"); } - } diff --git a/plugins/de.cognicrypt.codegenerator/src/main/java/de/cognicrypt/codegenerator/wizard/TaskSelectionPage.java b/plugins/de.cognicrypt.codegenerator/src/main/java/de/cognicrypt/codegenerator/wizard/TaskSelectionPage.java index 3875937a4..caf90cbc9 100644 --- a/plugins/de.cognicrypt.codegenerator/src/main/java/de/cognicrypt/codegenerator/wizard/TaskSelectionPage.java +++ b/plugins/de.cognicrypt.codegenerator/src/main/java/de/cognicrypt/codegenerator/wizard/TaskSelectionPage.java @@ -14,7 +14,6 @@ import java.io.File; import java.io.FileInputStream; -import java.io.InputStream; import java.net.URI; import java.net.URL; import java.util.ArrayList; @@ -25,6 +24,9 @@ import org.eclipse.jface.wizard.WizardPage; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.graphics.Image; @@ -33,7 +35,9 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; 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.ui.PlatformUI; @@ -46,9 +50,10 @@ public class TaskSelectionPage extends WizardPage { - private Composite container; - private Task selectedTask = null; - + private TaskItemComposite selectedTaskItem = null; + private Composite listOfTaskItems; // Row Layout Composite that holds task items composite + private List taskItems = new ArrayList(); // ArrayList of all tasks item composite + public TaskSelectionPage() { super(Constants.SELECT_TASK); setTitle(Constants.TASK_LIST); @@ -58,76 +63,46 @@ public TaskSelectionPage() { @Override public void createControl(final Composite parent) { - final List tasks = TaskJSONReader.getTasks(); - - final ScrolledComposite sc = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL); - sc.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - this.container = new Composite(sc, SWT.NONE); - this.container.setBounds(10, 10, 450, 200); + // Make the content able to scroll + final ScrolledComposite sc = new ScrolledComposite(parent, SWT.V_SCROLL); + sc.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true)); - //To display the Help view after clicking the help icon + // To display the Help view after clicking the help icon PlatformUI.getWorkbench().getHelpSystem().setHelp(sc, "de.cognicrypt.codegenerator.TaskSelectionHelp"); - final GridLayout gl = new GridLayout(2, false); - gl.verticalSpacing = -6; - this.container.setLayout(gl); - - new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1); - new Label(this.container, SWT.NONE); - final Label useCaseDescriptionLabel = new Label(this.container, SWT.WRAP); - final GridData gd_selectProjectLabel = new GridData(SWT.FILL, SWT.FILL, false, false, 1, tasks.size() + 1); - gd_selectProjectLabel.heightHint = 200; - gd_selectProjectLabel.widthHint = 600; - useCaseDescriptionLabel.setLayoutData(gd_selectProjectLabel); - Font a = useCaseDescriptionLabel.getFont(); - useCaseDescriptionLabel.setFont(new Font(useCaseDescriptionLabel.getDisplay(), new FontData(a.getFontData()[0].getName(), 12, SWT.None))); - - final List