Commit 96af5d5e authored by Johannes Roith's avatar Johannes Roith

- Add the option to display counters on tabs.

- Remove old update site builds.
parent 0df20a3b
package de.tum.in.www2.cupplugin.editors;
import java.util.HashMap;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceChangeListener;
......@@ -36,7 +38,7 @@ public class MultiPageEditor extends MultiPageEditorPart implements
private CupTextEditor editor;
private ZoomContributionViewItem graphReduceZoomContribution;
private IMenuManager graphReduceMenu;
private HashMap<Integer, Integer> counters;
private CupOverviewView overviewView;
private CupConflictsView conflictsView;
private CupActionTableView actionTableView;
......@@ -56,6 +58,7 @@ public class MultiPageEditor extends MultiPageEditorPart implements
public MultiPageEditor() {
super();
this.counters = new HashMap<Integer, Integer>();
ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
}
......@@ -67,6 +70,23 @@ public class MultiPageEditor extends MultiPageEditorPart implements
return conflictGraphView;
}
void setCounter(int pageIndex, int counter) {
boolean update = false;
if (counters.containsKey(pageIndex)) {
if (counters.get(pageIndex) == counter)
return;
update = true;
}
counters.put(pageIndex, counter);
String oldText = getPageText(pageIndex);
if (update) {
int index = oldText.lastIndexOf("(");
oldText = oldText.substring(0, index);
} else
oldText += " ";
setPageText(pageIndex, oldText + "(" + counter + ")");
}
void createEditorPage(Jumper jumper) {
try {
editor = new CupTextEditor(jumper);
......
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