Commit 88a1cea3 authored by Michael Schwarz's avatar Michael Schwarz

Layout improvements

parent 2a8891d3
......@@ -46,7 +46,7 @@ class ConflictPanel extends Composite {
private static final int BASE_HEIGHT = 85;
private static final int COLUMNS = 3;
private static final int HEADING_FONT_SIZE = 14;
private Conflict conflict;
// srdetails may be null if conflict is not a shift-reduce conflict
......@@ -89,6 +89,8 @@ class ConflictPanel extends Composite {
gridData.grabExcessHorizontalSpace = true;
gridData.widthHint = 100; // Do not remove. This is a bugfix. :-)
gridData.heightHint = BASE_HEIGHT;
gridData.horizontalAlignment = GridData.FILL;
gridData.horizontalSpan = 2;
setLayoutData(gridData);
GridLayout gl = new GridLayout();
......
......@@ -16,6 +16,7 @@ import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
......@@ -102,15 +103,21 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
scrolled.setContent(list);
GridLayout gl = new GridLayout();
gl.numColumns = 1;
gl.makeColumnsEqualWidth = true;
gl.numColumns = 2;
gl.makeColumnsEqualWidth = false;
list.setLayout(gl);
GridData gridDataCountConflicts = new GridData(SWT.FILL, SWT.FILL, true, false);
gridDataCountConflicts.horizontalSpan = 2;
this.countConflictsLabel = new Label(list, SWT.NONE);
this.countConflictsLabel.setBackground(new Color(Display.getCurrent(), Colors.white));
this.countConflictsLabel.setLayoutData(gridDataCountConflicts);
GridData gridDataConnectedResolution = new GridData(SWT.FILL, SWT.FILL, true, false);
gridDataConnectedResolution.horizontalSpan = 2;
this.connectedResolutionLabel = new Label(list,SWT.NONE);
this.connectedResolutionLabel.setBackground(new Color(Display.getCurrent(), Colors.white));
this.connectedResolutionLabel.setLayoutData(gridDataConnectedResolution);
this.connectedResolutionAbort = new Button(list,SWT.PUSH);
this.connectedResolutionAbort.setVisible(false);
......@@ -244,6 +251,7 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
scrolled.layout(true, true);
scrolled.setMinSize(list.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
public void dispose() {
editor.getModel().unregisterModelObserver(this);
......@@ -397,12 +405,9 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
document.replace(positionForPrec, 0, toInsert);
} catch (BadLocationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (de.tum.in.www2.cupplugin.views.PrecedenceToInsert.PrecedenceCyclicException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
finally{
......@@ -410,6 +415,8 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
}
}
//TODO: What happens with breakpoints if we insert precedences
void insertPrecedence(terminal terminal,Precedence.Type assoc){
try {
String toInsert = "precedence " + assoc.toString().toLowerCase() + " " + terminal.name()+ "; // Inserted by Eclipse plugin";
......
Markdown is supported
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