Skip to content
Snippets Groups Projects
Commit 0cb179ae authored by Alexander Diewald's avatar Alexander Diewald
Browse files

Use a CCombo that looks nicer when being cut

... cutting still occurs and is impossible to resolve without one week
of coding since placing combos in a toolbar is not supported by eclipse.

Issue-Ref: 3672
Issue-Url: https://af3-developer.fortiss.org/issues/3672


Signed-off-by: default avatarAlexander Diewald <diewald@fortiss.org>
parent e2fcbcd1
No related branches found
No related tags found
1 merge request!7Dev Objectives: Fix layout in toolbar
ApplicationActionBarAdvisor.java 3e7c0fd992586e6ca7724b871eb0b2cf59244028 GREEN
ApplicationWorkbenchAdvisor.java ef25d5783a4f75e88334fd679834a6e0421f8c2f GREEN
ApplicationWorkbenchWindowAdvisor.java da5cb38300b384579532c678fbc9faa961c2ca6b GREEN
CurrentObjectiveContributionItem.java 30b220758a01e1ac6b6b67bdcfce76ade789ed4e RED
UpcomingObjectiveContributionItem.java 61822c03cec6f5a00434153e101f4762d112e4ae RED
CurrentObjectiveContributionItem.java 59e0a8730d46eb55f365b1df3308aad878ab041c RED
UpcomingObjectiveContributionItem.java f9ec7ba28ff7473a09767ef94ccf548dd11c2e23 RED
......@@ -35,10 +35,10 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
......@@ -82,7 +82,7 @@ class CurrentObjectiveContributionItem extends WorkbenchWindowControlContributio
private String initialObjective = "No modeling objective selected";
/** The Combo holding the time between the simulation steps. */
private Combo currentObjectiveCombo;
private CCombo currentObjectiveCombo;
/** The control object holding the combo. */
// private ToolItem toolitem;
......@@ -116,17 +116,14 @@ class CurrentObjectiveContributionItem extends WorkbenchWindowControlContributio
protected Control createControl(Composite parent) {
composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(2, false);
layout.marginWidth = 0;
layout.verticalSpacing = 0;
layout.marginHeight = 0;
composite.setLayout(layout);
GridData gridData = new GridData(SWT.NONE, SWT.FILL, false, false, 2, 1);
composite.setLayoutData(gridData);
Label label = new Label(composite, SWT.TRANSPARENT);
label.setText("Current Objective");
// Objective Combo
currentObjectiveCombo = new Combo(composite, SWT.DROP_DOWN);
currentObjectiveCombo = new CCombo(composite, SWT.DROP_DOWN);
currentObjectiveCombo.setItems(initialSetOfObjectives);
currentObjectiveCombo.setText(initialObjective);
currentObjectiveCombo.setToolTipText("Set the next modelling objective.");
......@@ -140,7 +137,7 @@ class CurrentObjectiveContributionItem extends WorkbenchWindowControlContributio
}
});
parent.setSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
parent.setSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));
return composite;
}
......
......@@ -32,11 +32,11 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
......@@ -79,7 +79,7 @@ public class UpcomingObjectiveContributionItem extends WorkbenchWindowControlCon
private String initialObjective = "No upcoming objective available";
/** The Combo holding the upcoming objectives. */
private Combo upcomingObjectiveCombo;
private CCombo upcomingObjectiveCombo;
/** Configuration of the current project selected in the combo box. */
private ConstraintBasedDevelopmentProcess currentDevelopmentProcess = null;
......@@ -113,8 +113,6 @@ public class UpcomingObjectiveContributionItem extends WorkbenchWindowControlCon
layout.marginWidth = 0;
layout.verticalSpacing = 0;
composite.setLayout(layout);
GridData gridData = new GridData(SWT.NONE, SWT.FILL, false, false, 3, 1);
composite.setLayoutData(gridData);
// Add a separator to the current objective combo.
new Label(composite, SWT.HORIZONTAL);
......@@ -123,7 +121,7 @@ public class UpcomingObjectiveContributionItem extends WorkbenchWindowControlCon
label.setText("Upcoming Objective");
// Objective Combo
upcomingObjectiveCombo = new Combo(composite, SWT.DROP_DOWN);
upcomingObjectiveCombo = new CCombo(composite, SWT.DROP_DOWN);
upcomingObjectiveCombo.setItems(initialSetOfObjectives);
upcomingObjectiveCombo.setText(initialObjective);
upcomingObjectiveCombo.setToolTipText("Set the next modelling objective.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment