Commit ea58368a authored by Salman Rahman's avatar Salman Rahman
Browse files

resize current combo box and windows UI adjustment

refs 3039
parent 61e6df57
......@@ -34,6 +34,8 @@ import org.eclipse.jface.action.ContributionItem;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.ControlListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.RGB;
......@@ -104,6 +106,18 @@ class CurrentObjectiveContributionItem extends ContributionItem implements ISele
toolitem = new org.eclipse.swt.widgets.ToolItem(parent, SWT.SEPARATOR, index);
composite = new Composite(parent, SWT.NONE);
composite.addControlListener(new ControlListener() {
@Override
public void controlResized(ControlEvent e) {
composite.getParent().pack(true);
}
@Override
public void controlMoved(ControlEvent e) {
// TODO Auto-generated method stub
}
});
org.eclipse.swt.layout.GridLayout layout = new org.eclipse.swt.layout.GridLayout(2, false);
layout.marginWidth = 0; // <-- HERE
layout.verticalSpacing = 0;
......@@ -111,18 +125,25 @@ class CurrentObjectiveContributionItem extends ContributionItem implements ISele
org.eclipse.swt.layout.GridData gridData = new org.eclipse.swt.layout.GridData();
gridData.verticalAlignment = GridData.CENTER;
composite.setLayout(layout);
org.eclipse.swt.widgets.Label label =
new org.eclipse.swt.widgets.Label(composite, SWT.TRANSPARENT);
label.setText("Current Objective");
String operSys = System.getProperty("os.name").toLowerCase();
if(operSys.contains("nix") || operSys.contains("nux") || operSys.contains("aix")) {
gridData.verticalIndent = -10;
} else if(operSys.contains("mac")) {
gridData.verticalIndent = 0;
}
} else if(operSys.contains("win")) {
gridData.verticalIndent = -20;
gridData.grabExcessVerticalSpace = true;
composite.setLayout(layout);
org.eclipse.swt.widgets.Label label =
new org.eclipse.swt.widgets.Label(composite, SWT.TRANSPARENT);
label.setText("Current Objective");
GridData data = new GridData(0, SWT.FILL, false, false);
data.verticalIndent = -10;
label.setLayoutData(data);
}
currentObjectiveCombo = new org.eclipse.swt.widgets.Combo(composite, SWT.DROP_DOWN);
currentObjectiveCombo.setLayoutData(gridData);
......@@ -340,6 +361,7 @@ class CurrentObjectiveContributionItem extends ContributionItem implements ISele
String currentObjectiveNewName =
currentDevelopmentProcess.getCurrentObjective().getName();
currentObjectiveCombo.setText(currentObjectiveNewName);
toolitem.setWidth(computeWidth(composite));
}
}
......
......@@ -109,6 +109,12 @@ public class UpcomingObjectiveContributionItem extends ContributionItem implemen
layout.marginWidth = 0; // <-- HERE
layout.verticalSpacing = 0;
composite.setLayout(layout);
org.eclipse.swt.widgets.Label label =
new org.eclipse.swt.widgets.Label(composite, SWT.TRANSPARENT);
label.setText(" Upcoming Objective");
org.eclipse.swt.layout.GridData gridData = new org.eclipse.swt.layout.GridData();
gridData.verticalAlignment = GridData.CENTER;
gridData.widthHint = 200;
......@@ -119,14 +125,14 @@ public class UpcomingObjectiveContributionItem extends ContributionItem implemen
gridData.verticalIndent = -10;
} else if(operSys.contains("mac")) {
gridData.verticalIndent = 0;
} else if(operSys.contains("win")) {
gridData.verticalIndent = -20;
gridData.grabExcessVerticalSpace = true;
GridData data = new GridData(0, SWT.FILL, false, false);
data.verticalIndent = -10;
label.setLayoutData(data);
}
composite.setLayout(layout);
org.eclipse.swt.widgets.Label label =
new org.eclipse.swt.widgets.Label(composite, SWT.TRANSPARENT);
label.setText("Upcoming Objective");
upcomingObjectiveCombo = new org.eclipse.swt.widgets.Combo(composite, SWT.DROP_DOWN);
upcomingObjectiveCombo.setLayoutData(gridData);
......@@ -314,6 +320,9 @@ public class UpcomingObjectiveContributionItem extends ContributionItem implemen
.getTopLevelElementFor(currentDevelopmentProcess);
boolean result = true;
if(modelContext == null) {
return result;
}
EList<String> activeConstraints = constraintConfiguration.getActiveConstraints();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment