Commit 1444575f authored by Michael Schwarz's avatar Michael Schwarz 🤔
Browse files

apply button for resolution (blind atm)

default selection in combo box
parent 53a546d0
...@@ -17,6 +17,7 @@ import org.eclipse.swt.graphics.Point; ...@@ -17,6 +17,7 @@ import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Display;
...@@ -78,6 +79,7 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi ...@@ -78,6 +79,7 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
private Label symbolLabel; private Label symbolLabel;
private Combo resolutionOptions; private Combo resolutionOptions;
private Button resolutionButton;
private Composite detailWrapper; private Composite detailWrapper;
private Link detailText; private Link detailText;
...@@ -153,9 +155,17 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi ...@@ -153,9 +155,17 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
this.resolutionOptions = new Combo(this,SWT.DROP_DOWN); this.resolutionOptions = new Combo(this,SWT.DROP_DOWN);
GridData resolutionOptionsData = new GridData(); GridData resolutionOptionsData = new GridData();
resolutionOptionsData.grabExcessHorizontalSpace = true; resolutionOptionsData.grabExcessHorizontalSpace = false;
resolutionOptionsData.horizontalSpan = COLUMNS; resolutionOptionsData.horizontalSpan = 1;
resolutionOptions.setLayoutData(resolutionOptionsData); resolutionOptions.setLayoutData(resolutionOptionsData);
this.resolutionButton = new Button(this,SWT.PUSH);
GridData resolutionButtonData = new GridData();
resolutionButtonData.grabExcessHorizontalSpace = true;
resolutionButtonData.horizontalSpan = 1;
resolutionButton.setLayoutData(resolutionButtonData);
this.resolutionButton.setText("Apply");
} }
private Composite makeDetailWrapper(int columns) { private Composite makeDetailWrapper(int columns) {
...@@ -336,7 +346,7 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi ...@@ -336,7 +346,7 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
gridData.heightHint += detailText.computeSize(SWT.DEFAULT, SWT.DEFAULT).y; gridData.heightHint += detailText.computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
// Begin resolution hints
terminal sourceOfShiftPrec = src.getTerminal(); terminal sourceOfShiftPrec = src.getTerminal();
terminal sourceOfReducePrec = null; terminal sourceOfReducePrec = null;
...@@ -367,6 +377,8 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi ...@@ -367,6 +377,8 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
int shiftPred = src.getTerminal().precedence_num(); int shiftPred = src.getTerminal().precedence_num();
resolutionOptions.removeAll(); resolutionOptions.removeAll();
resolutionOptions.add("-- Choose an option --");
resolutionOptions.select(0);
if(sourceOfShiftPrec.equals(sourceOfReducePrec)) { if(sourceOfShiftPrec.equals(sourceOfReducePrec)) {
// If the precedence of the terminal and the production come from the same terminal // If the precedence of the terminal and the production come from the same terminal
......
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