Commit f4551f2b authored by Johannes Roith's avatar Johannes Roith
Browse files

- Remove some dead code.

- Fix update site.
parent edf7b776
......@@ -210,7 +210,6 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
resolutionHint.setText(hint.getFirst());
gridData.heightHint += resolutionHint.computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
System.err.println(gridData.heightHint);
int cindex = state.index();
stateLabel.setText("<a href=\"" + cindex + "\">State: " + cindex + "</a>");
......
......@@ -513,57 +513,6 @@ public class CupReduceGraphView extends CupGraphBase
}
/*
* connections.clear(); nodes.clear(); nodeMap.clear();
*
* parse_reduce_table reduceTable =
* this.lalrResult.getReduceTable(); lalr_state gotoState = null;
*
* lalr_state.lalr_state_shared sharedState = lalr_state
* .getShared(lalrContext); Enumeration allEnum = sharedState.all();
* List<lalr_state> allStates = new ArrayList<lalr_state>(); while
* (allEnum.hasMoreElements()) { Object o = allEnum.nextElement();
* if (o instanceof lalr_state) { allStates.add((lalr_state) o); } }
*
* for (lalr_state state : allStates) { ParserReduceNode n = new
* ParserReduceNode(state.index(), "State: " + state.index());
* n.setDescription(state.toString()); nodes.add(n);
* nodeMap.put(state.index(), n); }
*
* for (lalr_state state : allStates) { // List<lalr_transition>
* transitions = new // LinkedList<lalr_transition>();
* lalr_transition trans = state.transitions(); if (trans != null) {
* while (trans != null) { // transitions.add(trans);
* ParserReduceNode first = nodeMap.get(state.index());
* ParserReduceNode seccond = nodeMap.get(trans.to_state()
* .index());
*
* ParserReduceConnection con = new ParserReduceConnection(
* trans.toString(), trans.on_symbol().name(), first, seccond);
* first.getConnectedTo().add(seccond); connections.add(con); trans
* = trans.next(); } } }
*/
/*
* for (int stateRow = 0; stateRow < reduceTable.num_states();
* stateRow++) { ParserReduceNode n = new ParserReduceNode(stateRow,
* "State: " + stateRow); //lalr_state currentState = reduceTable.
* lalr_state current = null; for(lalr_state state:allStates) { if
* (state.index()==stateRow) { current = state; } }
* n.setDescription(current.toString()); nodes.add(n); }
*
* int columSize = parse_reduce_row.size(this.lalrContext); for (int
* stateRow = 0; stateRow < reduceTable.num_states(); stateRow++) {
* for (int stateColum = 0; stateColum < columSize; stateColum++) {
* gotoState =
* reduceTable.under_state[stateRow].under_non_term[stateColum]; if
* (gotoState != null) { //System.out.println(gotoState.toString());
* ParserReduceNode first = nodes.get(stateRow); ParserReduceNode
* seccond = nodes.get(gotoState.index()); ParserReduceConnection
* con = new ParserReduceConnection( "From: " + first.getId() +
* " to: " + seccond.getId(), "Non term " + stateColum, first,
* seccond); first.getConnectedTo().add(seccond);
* connections.add(con); } } }
*/
}
public List<ParserReduceNode> getNodes() {
......@@ -770,8 +719,6 @@ public class CupReduceGraphView extends CupGraphBase
@Override
public IFigure getTooltip(Object entity) {
return null;
/*
Label description = null;
if (entity instanceof ParserReduceNode) {
ParserReduceNode n = (ParserReduceNode) entity;
......@@ -780,7 +727,6 @@ public class CupReduceGraphView extends CupGraphBase
}
description = new Label("");
return description;
*/
}
@Override
......@@ -807,106 +753,8 @@ public class CupReduceGraphView extends CupGraphBase
public int getLineWidth(Object src, Object dest) {
return 0;
}
}
/*
static class CupToolTipHelper extends PopUpHelper {
private Timer timer;
private IFigure currentTipSource;
public CupToolTipHelper(org.eclipse.swt.widgets.Control c) {
super(c, SWT.TOOL | SWT.ON_TOP);
getShell().setBackground(ColorConstants.tooltipBackground);
getShell().setForeground(ColorConstants.tooltipForeground);
}
private Point computeWindowLocation(IFigure tip, int eventX, int eventY) {
org.eclipse.swt.graphics.Rectangle clientArea = control
.getDisplay().getClientArea();
Point preferredLocation = new Point(eventX, eventY + 26);
Dimension tipSize = getLightweightSystem().getRootFigure()
.getPreferredSize().getExpanded(getShellTrimSize());
// Adjust location if tip is going to fall outside display
if (preferredLocation.y + tipSize.height > clientArea.height)
preferredLocation.y = eventY - tipSize.height;
if (preferredLocation.x + tipSize.width > clientArea.width)
preferredLocation.x -= (preferredLocation.x + tipSize.width)
- clientArea.width;
return preferredLocation;
}
public void displayToolTipNear(IFigure hoverSource, IFigure tip,
int eventX, int eventY) {
if (tip != null && hoverSource != currentTipSource) {
getLightweightSystem().setContents(tip);
Point displayPoint = computeWindowLocation(tip, eventX, eventY);
Dimension shellSize = getLightweightSystem().getRootFigure()
.getPreferredSize().getExpanded(getShellTrimSize());
setShellBounds(displayPoint.x, displayPoint.y, shellSize.width,
shellSize.height);
show();
currentTipSource = hoverSource;
timer = new Timer(true);
timer.schedule(new TimerTask() {
public void run() {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
hide();
timer.cancel();
}
});
}
}, 15000);
}
}
public void dispose() {
if (isShowing()) {
timer.cancel();
hide();
}
getShell().dispose();
}
protected void hookShellListeners() {
// Close the tooltip window if the mouse enters the tooltip
getShell().addMouseTrackListener(new MouseTrackAdapter() {
public void mouseEnter(org.eclipse.swt.events.MouseEvent e) {
hide();
currentTipSource = null;
if (timer != null) {
timer.cancel();
}
}
});
}
public void updateToolTip(IFigure figureUnderMouse, IFigure tip,
int eventX, int eventY) {
if (figureUnderMouse == null) {
if (isShowing()) {
hide();
timer.cancel();
}
}
// Makes tooltip appear without a hover event if a tip is currently
// being displayed
if (isShowing() && figureUnderMouse != currentTipSource) {
hide();
timer.cancel();
displayToolTipNear(figureUnderMouse, tip, eventX, eventY);
} else if (!isShowing() && figureUnderMouse != currentTipSource)
currentTipSource = null;
}
}
*/
static class BuildUpNodeFilter extends ViewerFilter {
private List<ParserReduceNode> nodeList;
......
......@@ -108,13 +108,6 @@ public abstract class TooltipBase {
this.scrolled.setBackground(background);
this.label.setBackground(background);
this.label.addMouseListener(new MouseAdapter() {
@Override
public void mouseDown(MouseEvent e) {
System.out.println("clicked label!");
}
});
popup.setSize(10, 10);
}
......
......@@ -3,8 +3,8 @@
<description name="Cup Update Site" url="http://johannes.io/cup">
Test.
</description>
<feature url="features/CupEclipsePluginFeature_1.0.0.201412021347.jar" id="CupEclipsePluginFeature" version="1.0.0.201412021347">
<category name="Cup"/>
<feature url="features/CupEclipsePluginFeature_1.0.0.201412051433.jar" id="CupEclipsePluginFeature" version="1.0.0.201412051433">
<category name="cup"/>
</feature>
<category-def name="Cup" label="Cup"/>
<category-def name="cup" label="Cup"/>
</site>
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