import org.eclipse.jface.resource.ColorDescriptor;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.resource.LocalResourceManager;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTError;
import org.eclipse.swt.browser.Browser;
void historyChanged();
}
- private static final String STATEMENT_PART_SEPARATOR = ",";
- private final static String DEFAULT_DEBUGGER_CSS_FILE = "debugger.css";
- private final static String DEFAULT_DEBUGGER_CSS_PATH = "css/" + DEFAULT_DEBUGGER_CSS_FILE;
+ private static final String STATEMENT_PART_SEPARATOR = ","; //$NON-NLS-1$
+ private final static String DEFAULT_DEBUGGER_CSS_FILE = "debugger.css"; //$NON-NLS-1$
+ private final static String DEFAULT_DEBUGGER_CSS_PATH = "css/" + DEFAULT_DEBUGGER_CSS_FILE; //$NON-NLS-1$
private static int RESOURCE_NAME_MAX_LENGTH = 1000;
private static int RESOURCE_VALUE_MAX_SIZE = 16384;
*/
public GraphDebugger(Composite parent, int style, final Session session, Resource resource) {
super(parent, style);
- Assert.isNotNull(session, "session is null");
+ Assert.isNotNull(session, "session is null"); //$NON-NLS-1$
this.session = session;
this.currentElement = resource;
this.resourceManager = new LocalResourceManager(JFaceResources.getResources(), parent);
* When given to setStatus, indicates that the message shouldn't be touched
* since <code>null</code> has a different meaning.
*/
- private static final String DONT_TOUCH = "DONT_TOUCH";
+ private static final String DONT_TOUCH = "DONT_TOUCH"; //$NON-NLS-1$
protected void setStatus(String message, String error) {
IStatusLineManager status = WorkbenchUtils.getStatusLine(site);
if (!css.exists()) {
URL url = FileLocator.find(Activator.getDefault().getBundle(), new Path(DEFAULT_DEBUGGER_CSS_PATH), null);
if (url == null)
- throw new FileNotFoundException("Could not find '" + DEFAULT_DEBUGGER_CSS_PATH + "' in bundle '" + Activator.PLUGIN_ID + "'");
+ throw new FileNotFoundException("Could not find '" + DEFAULT_DEBUGGER_CSS_PATH + "' in bundle '" + Activator.PLUGIN_ID + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
cssPath = FileUtils.copyResource(url, css, true).toURI().toString();
} else {
cssPath = css.toURI().toString();
}
}
- private static final String PROMPT_TEXT = "Enter resource ID (RID) or URI";
+ private static final String PROMPT_TEXT = Messages.GraphDebugger_EnterResourceIDorURI;
public void createResourceText(final Composite parent) {
final Text text = new Text(parent, SWT.BORDER);
text.addFocusListener(new FocusListener() {
@Override
public void focusLost(FocusEvent e) {
- if (text.getText().trim().equals("")) {
+ if (text.getText().trim().equals("")) { //$NON-NLS-1$
text.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
text.setText(PROMPT_TEXT);
}
public void focusGained(FocusEvent e) {
if (text.getText().trim().equals(PROMPT_TEXT)) {
text.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_BLACK));
- text.setText("");
+ text.setText(""); //$NON-NLS-1$
}
text.selectAll();
}
});
final Button button = new Button(parent, SWT.FLAT);
- button.setText("&Lookup");
+ button.setText(Messages.GraphDebugger_Lookup);
button.setEnabled(false);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(false, false).applyTo(button);
@Override
public void modifyText(ModifyEvent e) {
String input = text.getText().trim();
- if (!input.equals(PROMPT_TEXT) && !input.equals(""))
+ if (!input.equals(PROMPT_TEXT) && !input.equals("")) //$NON-NLS-1$
button.setEnabled(true);
else
button.setEnabled(false);
input = input.trim();
SerialisationSupport support = session.getService(SerialisationSupport.class);
- if (input.startsWith("$")) {
+ if (input.startsWith("$")) { //$NON-NLS-1$
try {
Resource r = support.getResource(Long.parseLong(input.substring(1)));
changeLocation(r);
} catch (NumberFormatException e1) {
// Ignore, may happen for crap input
- setStatus(DONT_TOUCH, "Invalid '$'-prefixed input, expected resource ID");
+ setStatus(DONT_TOUCH, Messages.GraphDebugger_StatusInvalidPrefixedInput);
} catch (Exception e1) {
ErrorLogger.defaultLogError(e1);
- setStatus(DONT_TOUCH, "Resource ID lookup failed. See Error Log.");
+ setStatus(DONT_TOUCH, Messages.GraphDebugger_StatusResourceIDFailed);
}
return;
}
- String[] parts = input.split("-");
+ String[] parts = input.split("-"); //$NON-NLS-1$
if (parts.length == 1) {
try {
}
} catch (NumberFormatException e1) {
// Ignore, may happen for crap input
- setStatus(DONT_TOUCH, "Invalid input, expected transient resource ID");
+ setStatus(DONT_TOUCH, Messages.GraphDebugger_StatusInvalidInput);
} catch (Exception e1) {
ErrorLogger.defaultLogError(e1);
- setStatus(DONT_TOUCH, "Transient resource ID lookup failed. See Error Log.");
+ setStatus(DONT_TOUCH, Messages.GraphDebugger_StatusTransientResourceID);
}
} else if (parts.length == 2) {
try {
changeLocation(r);
} catch (NumberFormatException e1) {
// Ignore, may happen for crap input
- setStatus(DONT_TOUCH, "Invalid input, expected index & cluster IDs");
+ setStatus(DONT_TOUCH, Messages.GraphDebugger_StatusInvalidInputExpectIdxClusterIds);
} catch (Exception e1) {
ErrorLogger.defaultLogError(e1);
- setStatus(DONT_TOUCH, "Index & cluster -based lookup failed. See Error Log.");
+ setStatus(DONT_TOUCH, Messages.GraphDebugger_StatusIndexLookpuFailed);
}
}
try {
// First check that the input really is a proper URI.
String uri = input;
- if (!input.equals("http:/") && input.endsWith("/"))
+ if (!input.equals("http:/") && input.endsWith("/")) //$NON-NLS-1$ //$NON-NLS-2$
uri = input.substring(0, input.length() - 1);
new URI(uri);
Resource r = session.syncRequest( Queries.resource( uri ) );
// Ignore, this is not a proper URI at all.
} catch (ResourceNotFoundException e1) {
// Ok, this was an URI, but no resource was found.
- setStatus(DONT_TOUCH, "Resource for URI '" + input + "' not found");
+ setStatus(DONT_TOUCH, NLS.bind( Messages.GraphDebugger_StatusResourceforURI , input ));
return;
} catch (DatabaseException e1) {
- setStatus(DONT_TOUCH, "URI lookup failed. See Error Log.");
+ setStatus(DONT_TOUCH, Messages.GraphDebugger_StatusURIlookupFailed);
ErrorLogger.defaultLogError(e1);
}
- setStatus(DONT_TOUCH, "Invalid input, resource ID or URI expected");
+ setStatus(DONT_TOUCH, Messages.GraphDebugger_StatusInvalidInputResIdORURIExpected);
}
public Label createDropLabel(Composite parent) {
final Label label = new Label(parent, SWT.BORDER);
label.setAlignment(SWT.CENTER);
- label.setText("Drag a resource here to examine it in this debugger!");
+ label.setText(Messages.GraphDebugger_LabelDragResource);
label.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).hint(SWT.DEFAULT, 20).span(2, 1).grab(true, false).applyTo(label);
@Override
public void changing(LocationEvent event) {
String location = event.location;
- if (location.startsWith("simantics:browser"))
- location = "about:" + location.substring(17);
+ if (location.startsWith("simantics:browser")) //$NON-NLS-1$
+ location = "about:" + location.substring(17); //$NON-NLS-1$
//System.out.println("changing: location=" + location);
// Do not follow links that are meant as actions that are
// handled below.
event.doit = false;
- if ("about:blank".equals(location)) {
+ if ("about:blank".equals(location)) { //$NON-NLS-1$
// Just changing to the same old blank url is ok since it
// allows the browser to refresh itself.
event.doit = true;
}
- if (location.startsWith("about:-link")) {
- String target = location.replace("about:-link", "");
+ if (location.startsWith("about:-link")) { //$NON-NLS-1$
+ String target = location.replace("about:-link", ""); //$NON-NLS-1$ //$NON-NLS-2$
Resource element = links.getRight(target);
if (element == currentElement) {
event.doit = false;
return;
}
changeLocation(element);
- } else if (location.startsWith("about:-remove")) {
- String target = location.replace("about:-remove", "");
+ } else if (location.startsWith("about:-remove")) { //$NON-NLS-1$
+ String target = location.replace("about:-remove", ""); //$NON-NLS-1$ //$NON-NLS-2$
String n[] = target.split(STATEMENT_PART_SEPARATOR);
if (n.length != 3)
return;
// Make sure this is what the use wants.
MessageDialog md = new MessageDialog(
getShell(),
- "Confirm action...",
+ Messages.GraphDebugger_ConfirmActionsDots,
null,
- "This action will remove the selected statement.\nAre you sure you want to proceed with this action?",
- MessageDialog.QUESTION, new String[] { "Cancel", "Continue" }, 0);
+ Messages.GraphDebugger_ConfirmActionsDotsMsg,
+ MessageDialog.QUESTION, new String[] { Messages.GraphDebugger_Cancel, Messages.GraphDebugger_Continue }, 0);
if (md.open() != 1) {
return;
}
}, parameter -> refreshBrowser()
);
- } else if (location.startsWith("about:-edit-value")) {
- String target = location.replace("about:-edit-value", "");
+ } else if (location.startsWith("about:-edit-value")) { //$NON-NLS-1$
+ String target = location.replace("about:-edit-value", ""); //$NON-NLS-1$ //$NON-NLS-2$
final Resource o = links.getRight(target);
session.asyncRequest(new ReadRequest() {
public void run() {
InputDialog dialog = new InputDialog(
getShell(),
- "Edit Value",
+ Messages.GraphDebugger_EditValue,
null,
previousValue,
new IInputValidator() {
{
Label label = new Label(composite, SWT.NONE);
label.moveAbove(getText());
- label.setText("Input new property value. For numeric vector values, separate numbers with comma (',').");
+ label.setText(Messages.GraphDebugger_InputNewPropertyValue);
GridData data = new GridData(GridData.GRAB_HORIZONTAL
| GridData.HORIZONTAL_ALIGN_FILL
| GridData.VERTICAL_ALIGN_CENTER);
if (o instanceof byte[]) {
byte[] arr = (byte[]) o;
byte[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
- return truncated("byte", Arrays.toString(arr2), arr.length);
+ return truncated("byte", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
} else if (o instanceof int[]) {
int[] arr = (int[]) o;
int[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
- return truncated("int", Arrays.toString(arr2), arr.length);
+ return truncated("int", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
} else if (o instanceof long[]) {
long[] arr = (long[]) o;
long[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
- return truncated("long", Arrays.toString(arr2), arr.length);
+ return truncated("long", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
} else if (o instanceof float[]) {
float[] arr = (float[]) o;
float[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
- return truncated("float", Arrays.toString(arr2), arr.length);
+ return truncated("float", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
} else if (o instanceof double[]) {
double[] arr = (double[]) o;
double[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
- return truncated("double", Arrays.toString(arr2), arr.length);
+ return truncated("double", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
} else if (o instanceof boolean[]) {
boolean[] arr = (boolean[]) o;
boolean[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
- return truncated("boolean", Arrays.toString(arr2), arr.length);
+ return truncated("boolean", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
} else if (o instanceof Object[]) {
Object[] arr = (Object[]) o;
Object[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
- return truncated("Object", Arrays.toString(arr2), arr.length);
+ return truncated("Object", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
} else {
- return "Unknown big array " + o.getClass();
+ return "Unknown big array " + o.getClass(); //$NON-NLS-1$
}
} else {
- return o.getClass().getComponentType() + "[" + length + "] = " + ObjectUtils.toString(o);
+ return o.getClass().getComponentType() + "[" + length + "] = " + ObjectUtils.toString(o); //$NON-NLS-1$ //$NON-NLS-2$
}
}
return null;
}
protected String truncated(String type, String string, int originalLength) {
- return type + "[" + RESOURCE_NAME_MAX_LENGTH + "/" + originalLength + "] = " + string;
+ return type + "[" + RESOURCE_NAME_MAX_LENGTH + "/" + originalLength + "] = " + string; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
public static String htmlEscape(String s)
{
- return s.replace("&", "&").replace("<", "<").replace(">", ">").replace("\n", "<br/>");
+ return s.replace("&", "&").replace("<", "<").replace(">", ">").replace("\n", "<br/>"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
}
/**
// Object v = graph.getValue(r, b);
// Serializer s = Bindings.getSerializerUnchecked(b);
// int size = s.getSize(v);
- name = "Approx. " + valueSize + " byte literal of type " + type.toSingleLineString();
+ name = "Approx. " + valueSize + " byte literal of type " + type.toSingleLineString(); //$NON-NLS-1$ //$NON-NLS-2$
} else {
Binding b = Bindings.getBinding(type);
Object v = graph.getValue(r, b);
}
if(name.isEmpty()) {
- name = "<empty value>";
+ name = "<empty value>"; //$NON-NLS-1$
}
}
//if(name.isEmpty())
name = DebugUtils.getSafeLabel(graph, r);
if (name.isEmpty())
- name = "<empty name>";
+ name = "<empty name>"; //$NON-NLS-1$
}
// ClusteringSupport support = graph.getSession().getService(ClusteringSupport.class);
// if(name == null)
// Don't know how I encountered this but it seems to be possible in some cases..
// Resource obj = graph.getSingleObject(r, L0.HasObject);
Resource obj = graph.getPossibleObject(r, L0.HasObject);
- String tmp = htmlEscape( (pred == null ? "No predicate ?" : getResourceName(graph, pred)) + " -> " + (obj == null ? "No object ?" : getResourceName(graph, obj)) + " (Assertion)" );
+ String tmp = htmlEscape( (pred == null ? "No predicate ?" : getResourceName(graph, pred)) + " -> " + (obj == null ? "No object ?" : getResourceName(graph, obj)) + " (Assertion)" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
name = tmp.substring(0, Math.min(80, tmp.length()));
} else {
String resourceName = getResourceName(graph, r);
- if(resourceName.equals("Inverse")) {
+ if(resourceName.equals("Inverse")) { //$NON-NLS-1$
Resource inverse = graph.getPossibleInverse(r);
if(inverse != null && graph.hasStatement(inverse, L0.ConsistsOf, r))
- resourceName = getResourceName(graph, inverse) + "/Inverse";
+ resourceName = getResourceName(graph, inverse) + "/Inverse"; //$NON-NLS-1$
}
String tmp = htmlEscape( resourceName );
name = tmp.substring(0, Math.min(80, tmp.length()));
}
} catch (OutOfMemoryError e) {
- name = "OutOfMemoryError";
+ name = "OutOfMemoryError"; //$NON-NLS-1$
}
- String ret = "<a href=\"simantics:browser-link" + getLinkString(r) + "\">"
+ String ret = "<a href=\"simantics:browser-link" + getLinkString(r) + "\">" //$NON-NLS-1$ //$NON-NLS-2$
+ name
- + "</a>";
+ + "</a>"; //$NON-NLS-1$
if (graph.isInstanceOf(r, L0.Literal)) {
- ret += " <a class=\"edit-link\" href=\"simantics:browser-edit-value" + getLinkString(r) + "\">"
- + "(edit)"
- + "</a>";
+ ret += " <a class=\"edit-link\" href=\"simantics:browser-edit-value" + getLinkString(r) + "\">" //$NON-NLS-1$ //$NON-NLS-2$
+ + "(edit)" //$NON-NLS-1$
+ + "</a>"; //$NON-NLS-1$
}
return ret;
}
private String getStatementRemoveRef(Resource s, Resource p, Resource o) {
- return "<a href=\"simantics:browser-remove" + getStatementString(s, p, o)
- + "\" title=\"Remove this statement\">X</a>";
+ return "<a href=\"simantics:browser-remove" + getStatementString(s, p, o) //$NON-NLS-1$
+ + "\" title=\"Remove this statement\">X</a>"; //$NON-NLS-1$
}
private void updatePred(StringBuffer content, ReadGraph graph, Resource subj, Resource pred, List<Resource[]> stats) throws DatabaseException {
// Make a note if the statement was acquired.
if(!stmSubject.equals(subj)) {
- objects[i][3] = " (in " + getResourceRef(graph, stmSubject) + ")";
+ objects[i][3] = " (in " + getResourceRef(graph, stmSubject) + ")"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
// Output table rows
for (int i = 0; i < objects.length; ++i) {
- content.append("<tr>");
+ content.append("<tr>"); //$NON-NLS-1$
// Predicate column
if (i == 0)
- content.append("<td rowspan=\"").append(objects.length).append("\" valign=\"top\">").append(getResourceRef(graph, pred)).append("</td>");
+ content.append("<td rowspan=\"").append(objects.length).append("\" valign=\"top\">").append(getResourceRef(graph, pred)).append("</td>"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
// Object column
- if (objects[i][3] == null) content.append("<td>");
- else content.append("<td class=\"acquired\">");
+ if (objects[i][3] == null) content.append("<td>"); //$NON-NLS-1$
+ else content.append("<td class=\"acquired\">"); //$NON-NLS-1$
content.append(objects[i][2]);
if (objects[i][3] != null)
content.append(objects[i][3]);
- content.append("</td>");
+ content.append("</td>"); //$NON-NLS-1$
VirtualGraphSupport vgs = graph.getService(VirtualGraphSupport.class);
VirtualGraph vg = vgs.getGraph(graph, subj, pred, links.getRight(objects[i][0]));
if(vg != null) {
- content.append("<td>").append(vg.toString()).append("</td>");
+ content.append("<td>").append(vg.toString()).append("</td>"); //$NON-NLS-1$ //$NON-NLS-2$
} else {
- content.append("<td>DB</td>");
+ content.append("<td>DB</td>"); //$NON-NLS-1$
}
// Statement remove -link column
// Only allowed for non-acquired statements.
if (objects[i][3] == null) {
- content.append("<td class=\"remove\">");
+ content.append("<td class=\"remove\">"); //$NON-NLS-1$
content.append(getStatementRemoveRef(subj, pred, links.getRight(objects[i][0])));
- content.append("</td>");
+ content.append("</td>"); //$NON-NLS-1$
}
- content.append("</tr>");
+ content.append("</tr>"); //$NON-NLS-1$
}
}
// Generate output content from statements
String ref = getResourceRef(graph, tag);
- content.append("<tr>");
- content.append("<td rowspan=\"1\" colspan=\"3\" valign=\"top\">").append(ref).append("</td>");
+ content.append("<tr>"); //$NON-NLS-1$
+ content.append("<td rowspan=\"1\" colspan=\"3\" valign=\"top\">").append(ref).append("</td>"); //$NON-NLS-1$ //$NON-NLS-2$
//content.append("<td>" + name + "</td>");
- content.append("<td class=\"remove\">");
+ content.append("<td class=\"remove\">"); //$NON-NLS-1$
content.append(getStatementRemoveRef(subj, tag, subj));
- content.append("</td>");
- content.append("</tr>");
+ content.append("</td>"); //$NON-NLS-1$
+ content.append("</tr>"); //$NON-NLS-1$
}
try {
cur = OrderedSetUtils.next(graph, subj, cur);
} catch(DatabaseException e) {
- list.add("<span style=\"color:red;font-weight:bold\">BROKEN ORDERED SET:<br/></span><span style=\"color:red\">" + e.getMessage() + "</span>");
+ list.add("<span style=\"color:red;font-weight:bold\">BROKEN ORDERED SET:<br/></span><span style=\"color:red\">" + e.getMessage() + "</span>"); //$NON-NLS-1$ //$NON-NLS-2$
Resource inv = graph.getPossibleInverse(subj);
for(Statement stat : graph.getStatements(cur, L0.IsRelatedTo)) {
if(stat.getSubject().equals(cur)) {
if(stat.getPredicate().equals(subj)) {
- list.add("next " + getResourceRef(graph, stat.getObject()));
+ list.add("next " + getResourceRef(graph, stat.getObject())); //$NON-NLS-1$
}
else if(stat.getPredicate().equals(inv)) {
- list.add("prev " + getResourceRef(graph, stat.getObject()));
+ list.add("prev " + getResourceRef(graph, stat.getObject())); //$NON-NLS-1$
}
}
}
// Output table rows
for (int i = 0; i < list.size() ; ++i) {
- content.append("<tr>");
+ content.append("<tr>"); //$NON-NLS-1$
// Predicate column
if (i == 0)
- content.append("<td rowspan=\"").append(list.size()).append("\" valign=\"top\">Ordered Set Elements</td>");
+ content.append("<td rowspan=\"").append(list.size()).append("\" valign=\"top\">Ordered Set Elements</td>"); //$NON-NLS-1$ //$NON-NLS-2$
// Object column
- content.append("<td>");
+ content.append("<td>"); //$NON-NLS-1$
content.append(list.get(i));
- content.append("</td>");
+ content.append("</td>"); //$NON-NLS-1$
// Statement remove -link column
// Only allowed for non-acquired statements.
content.append(getStatementRemoveRef(subj, pred, links.getRight(objects[i][0])));
content.append("</td>");
}*/
- content.append("</tr>");
+ content.append("</tr>"); //$NON-NLS-1$
}
}
// Output table rows
for (int i = 0; i < list.size() ; ++i) {
- content.append("<tr>");
+ content.append("<tr>"); //$NON-NLS-1$
// Predicate column
if (i == 0)
- content.append("<td rowspan=\"").append(list.size()).append("\" valign=\"top\">Linked List Elements</td>");
+ content.append("<td rowspan=\"").append(list.size()).append("\" valign=\"top\">Linked List Elements</td>"); //$NON-NLS-1$ //$NON-NLS-2$
// Object column
- content.append("<td>");
+ content.append("<td>"); //$NON-NLS-1$
content.append(list.get(i));
- content.append("</td><td>DB</td>");
+ content.append("</td><td>DB</td>"); //$NON-NLS-1$
// Statement remove -link column
// Only allowed for non-acquired statements.
content.append(getStatementRemoveRef(subj, pred, links.getRight(objects[i][0])));
content.append("</td>");
}*/
- content.append("</tr>");
+ content.append("</tr>"); //$NON-NLS-1$
}
}
StringBuffer content = new StringBuffer();
// Generate HTML -page
- content.append("<html>\n<head>\n")
+ content.append("<html>\n<head>\n") //$NON-NLS-1$
.append(getHead())
- .append("\n</head>\n")
- .append("<body>\n")
- .append("<div id=\"mainContent\">\n\n");
+ .append("\n</head>\n") //$NON-NLS-1$
+ .append("<body>\n") //$NON-NLS-1$
+ .append("<div id=\"mainContent\">\n\n"); //$NON-NLS-1$
for (Resource r : resources) {
if (r == null)
uri = graph.syncRequest(new ResourceToPossibleURI(r));
} catch (Exception e) {
ErrorLogger.defaultLogError(e);
- uri = "Cannot get URI: " + e.getMessage();
+ uri = "Cannot get URI: " + e.getMessage(); //$NON-NLS-1$
}
// Top DIV
- content.append("<div id=\"top\">\n");
- content.append("<table class=\"top\">\n");
+ content.append("<div id=\"top\">\n"); //$NON-NLS-1$
+ content.append("<table class=\"top\">\n"); //$NON-NLS-1$
if (uri != null) {
- content.append("<tr><td class=\"top_key\">URI</td><td class=\"top_value\"><span id=\"uri\">").append(uri).append("</span></td></tr>\n");
+ content.append("<tr><td class=\"top_key\">URI</td><td class=\"top_value\"><span id=\"uri\">").append(uri).append("</span></td></tr>\n"); //$NON-NLS-1$ //$NON-NLS-2$
}
XSupport xs = graph.getService(XSupport.class);
obj = statement.getObject();
map.add(predicate, new Resource[] {subject, obj});
} catch (Throwable e) {
- ErrorLogger.defaultLogError("Cannot find statement " + subject + " " + predicate + " " + obj, e);
+ ErrorLogger.defaultLogError("Cannot find statement " + subject + " " + predicate + " " + obj, e); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
SerialisationSupport ss = graph.getSession().getService(SerialisationSupport.class);
ClusteringSupport support = graph.getSession().getService(ClusteringSupport.class);
- content.append("<tr><td class=\"top_key\">Identifiers</td><td class=\"top_value\">");
- content.append("<span id=\"resource_id\">")
- .append(" RID = $").append(r.getResourceId())
- .append(" Resource Key = ").append(ss.getTransientId(r))
- .append(" CID = ").append(support.getCluster(r));
- content.append("</span></td>");
+ content.append("<tr><td class=\"top_key\">Identifiers</td><td class=\"top_value\">"); //$NON-NLS-1$
+ content.append("<span id=\"resource_id\">") //$NON-NLS-1$
+ .append(" RID = $").append(r.getResourceId()) //$NON-NLS-1$
+ .append(" Resource Key = ").append(ss.getTransientId(r)) //$NON-NLS-1$
+ .append(" CID = ").append(support.getCluster(r)); //$NON-NLS-1$
+ content.append("</span></td>"); //$NON-NLS-1$
if (immutable)
- content.append("<td class=\"remove\">[IMMUTABLE]</td>");
- content.append("</tr>\n");
+ content.append("<td class=\"remove\">[IMMUTABLE]</td>"); //$NON-NLS-1$
+ content.append("</tr>\n"); //$NON-NLS-1$
boolean isClusterSet = support.isClusterSet(r);
Resource parentSet = support.getClusterSetOfCluster(r);
String parentSetURI = parentSet != null ? graph.getPossibleURI(parentSet) : null;
- content.append("<tr><td class=\"top_key\">Clustering</td><td class=\"top_value\">");
- content.append("<span id=\"resource_id\">");
+ content.append("<tr><td class=\"top_key\">Clustering</td><td class=\"top_value\">"); //$NON-NLS-1$
+ content.append("<span id=\"resource_id\">"); //$NON-NLS-1$
if(parentSetURI != null)
- content.append(" Containing cluster set = ").append(parentSetURI);
+ content.append(" Containing cluster set = ").append(parentSetURI); //$NON-NLS-1$
else if (parentSet != null)
- content.append(" Containing cluster set = ").append(parentSet.toString());
+ content.append(" Containing cluster set = ").append(parentSet.toString()); //$NON-NLS-1$
else
- content.append(" Not in any cluster set ");
+ content.append(" Not in any cluster set "); //$NON-NLS-1$
- content.append("</span></td>");
+ content.append("</span></td>"); //$NON-NLS-1$
if (isClusterSet)
- content.append("<td class=\"remove\">[CLUSTER SET]</td>");
- content.append("</tr>\n");
+ content.append("<td class=\"remove\">[CLUSTER SET]</td>"); //$NON-NLS-1$
+ content.append("</tr>\n"); //$NON-NLS-1$
// If the resource has a value, show it.
String resourceValue = getResourceValue(graph, r);
if (resourceValue != null) {
content
- .append("<tr><td class=\"top_key\">Attached value</td><td class=\"top_value\">")
+ .append("<tr><td class=\"top_key\">Attached value</td><td class=\"top_value\">") //$NON-NLS-1$
.append(htmlEscape(resourceValue))
- .append("</td></tr>\n");
+ .append("</td></tr>\n"); //$NON-NLS-1$
}
// Close #top
- content.append("</table>\n");
- content.append("</div>\n");
+ content.append("</table>\n"); //$NON-NLS-1$
+ content.append("</div>\n"); //$NON-NLS-1$
- content.append("\n<div id=\"data\">\n");
- content.append("<table>\n")
- .append("<tr><th>Predicate</th><th>Object</th><th>Graph</th></tr>")
- .append("<tr><td class=\"subtitle\" colspan=\"3\">Basic information</td></tr>");
+ content.append("\n<div id=\"data\">\n"); //$NON-NLS-1$
+ content.append("<table>\n") //$NON-NLS-1$
+ .append("<tr><th>Predicate</th><th>Object</th><th>Graph</th></tr>") //$NON-NLS-1$
+ .append("<tr><td class=\"subtitle\" colspan=\"3\">Basic information</td></tr>"); //$NON-NLS-1$
boolean isOrderedSet = graph.isInstanceOf(r, L0.OrderedSet);
boolean isLinkedList = graph.isInstanceOf(r, L0.List);
updatePred(content, graph, r, pred, map.remove(pred));
// TAGS
- content.append("<tr><td class=\"subtitle\" colspan=\"3\">Tags</td></tr>");
+ content.append("<tr><td class=\"subtitle\" colspan=\"3\">Tags</td></tr>"); //$NON-NLS-1$
for(Statement stm : statements) {
if(stm.getSubject().equals(stm.getObject())) {
updateTag(content, graph, r, stm.getPredicate());
}
// ORDERED SETS
- content.append("<tr><td class=\"subtitle\" colspan=\"3\">Ordered Sets</td></tr>");
+ content.append("<tr><td class=\"subtitle\" colspan=\"3\">Ordered Sets</td></tr>"); //$NON-NLS-1$
for(Statement stm : statements) {
Resource predicate = stm.getPredicate();
if(graph.isInstanceOf(stm.getPredicate(), L0.OrderedSet)) {
}
// IS RELATED TO
- content.append("<tr><td class=\"subtitle\" colspan=\"3\">Is Related To</td></tr>");
+ content.append("<tr><td class=\"subtitle\" colspan=\"3\">Is Related To</td></tr>"); //$NON-NLS-1$
// ELEMENTS OF ORDERED SET
if(isOrderedSet) {
try {
updateOrderedSet(content, graph, r);
} catch (ValidationException e) {
- content.append("<td colspan=\"3\"><span style=\"color:red;font-weight:bold\">BROKEN ORDERED SET:<br/></span><span style=\"color:red\">").append(e.getMessage()).append("</span></td>");
+ content.append("<td colspan=\"3\"><span style=\"color:red;font-weight:bold\">BROKEN ORDERED SET:<br/></span><span style=\"color:red\">").append(e.getMessage()).append("</span></td>"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
try {
updateLinkedList(content, graph, r);
} catch (ValidationException e) {
- content.append("<td colspan=\"3\"><span style=\"color:red;font-weight:bold\">BROKEN LINKED LIST:<br/></span><span style=\"color:red\">").append(e.getMessage()).append("</span></td>");
+ content.append("<td colspan=\"3\"><span style=\"color:red;font-weight:bold\">BROKEN LINKED LIST:<br/></span><span style=\"color:red\">").append(e.getMessage()).append("</span></td>"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
for(Resource pred : preds) {
String str = htmlEscape( getResourceName(graph, pred) );
if(str == null)
- str = "<null>";
+ str = "<null>"; //$NON-NLS-1$
strmap.put(pred, str);
}
Arrays.sort(preds, new Comparator<Resource>() {
updatePred(content, graph, r, pred, map.get(pred));
// OTHER STATEMENTS
- content.append("<tr><td class=\"subtitle\" colspan=\"3\">Other statements</td></tr>");
+ content.append("<tr><td class=\"subtitle\" colspan=\"3\">Other statements</td></tr>"); //$NON-NLS-1$
for(Resource pred : preds)
if(!graph.isSubrelationOf(pred, L0.IsRelatedTo))
updatePred(content, graph, r, pred, map.get(pred));
- content.append("</table>\n");
+ content.append("</table>\n"); //$NON-NLS-1$
}
// Close #data
- content.append("</div>\n\n");
+ content.append("</div>\n\n"); //$NON-NLS-1$
// Close #mainContent
- content.append("</div>\n");
- content.append("</body>\n</html>\n");
+ content.append("</div>\n"); //$NON-NLS-1$
+ content.append("</body>\n</html>\n"); //$NON-NLS-1$
// Update content
final String finalContent = content.toString();
Serializer s = Bindings.getSerializerUnchecked(b);
int size = s.getSize(v);
if (size > RESOURCE_VALUE_MAX_SIZE) {
- return "Approx. " + size + " byte literal of type " + type.toSingleLineString();
+ return "Approx. " + size + " byte literal of type " + type.toSingleLineString(); //$NON-NLS-1$ //$NON-NLS-2$
} else {
return b.toString(v, false);
}
return NameUtils.getSafeName(g, r);
} catch(Throwable throwable) {
ErrorLogger.defaultLogError(throwable);
- return "<font color=\"red\"><i>"+throwable.getClass().getName()+"</i> "+throwable.getMessage()+"</font>";
+ return "<font color=\"red\"><i>"+throwable.getClass().getName()+"</i> "+throwable.getMessage()+"</font>"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
// }
private String getHead() {
- String result = "";
+ String result = ""; //$NON-NLS-1$
if (cssPath != null) {
- result = "<link href=\"" + cssPath + "\" rel=\"stylesheet\" type=\"text/css\">";
+ result = "<link href=\"" + cssPath + "\" rel=\"stylesheet\" type=\"text/css\">"; //$NON-NLS-1$ //$NON-NLS-2$
}
return result;
}
public class GraphDebuggerEditor extends ResourceEditorPart {
- public static final String EDITOR_ID = "org.simantics.debug.graphDebuggerEditor";
+ public static final String EDITOR_ID = "org.simantics.debug.graphDebuggerEditor"; //$NON-NLS-1$
private GraphDebugger debugger;
private IAction backAction;
class RefreshAction extends Action {
public RefreshAction() {
- super("Refresh", BundleUtils.getImageDescriptorFromPlugin(SimanticsUI.PLUGIN_ID, "icons/refresh.gif"));
- setToolTipText("Refresh");
+ super(Messages.GraphDebuggerEditor_Refresh, BundleUtils.getImageDescriptorFromPlugin(SimanticsUI.PLUGIN_ID, "icons/refresh.gif")); //$NON-NLS-2$
+ setToolTipText(Messages.GraphDebuggerEditor_RefreshTT);
}
@Override
public void run() {
class FindAction extends Action {
public FindAction() {
- super("Find", BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_blue.png"));
- setToolTipText("Find Resource");
+ super(Messages.GraphDebuggerEditor_Find, BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_blue.png")); //$NON-NLS-2$
+ setToolTipText(Messages.GraphDebuggerEditor_FindTT);
}
@Override
public void run() {
class AddStatementAction extends Action {
public AddStatementAction() {
- super("AddStatement", BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png"));
- setToolTipText("Add Statement Between Existing Resources");
+ super(Messages.GraphDebuggerEditor_AddStatement, BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png")); //$NON-NLS-2$
+ setToolTipText(Messages.GraphDebuggerEditor_AddStatementTT);
}
@Override
public void run() {
class AddResourceAction extends Action {
public AddResourceAction() {
- super("AddResource", BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png"));
- setToolTipText("Add New Related Resource");
+ super(Messages.GraphDebuggerEditor_AddResource, BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png")); //$NON-NLS-2$
+ setToolTipText(Messages.GraphDebuggerEditor_AddResourceTT);
}
@Override
public void run() {
class BackAction extends Action {
public BackAction() {
- super("Back", Action.AS_PUSH_BUTTON);
- setToolTipText("Back");
+ super(Messages.GraphDebuggerEditor_Back, Action.AS_PUSH_BUTTON);
+ setToolTipText(Messages.GraphDebuggerEditor_BackTT);
setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK));
setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK_DISABLED));
}
class ForwardAction extends Action {
public ForwardAction() {
- super("Forward", Action.AS_PUSH_BUTTON);
- setToolTipText("Forward");
+ super(Messages.GraphDebuggerEditor_Forward, Action.AS_PUSH_BUTTON);
+ setToolTipText(Messages.GraphDebuggerEditor_ForwardTT);
setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD));
setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD_DISABLED));
}
public class GraphDebuggerView extends ViewPart {
- public static final String VIEW_ID = "org.simantics.debug.graphDebugger";
+ public static final String VIEW_ID = "org.simantics.debug.graphDebugger"; //$NON-NLS-1$
// private final boolean DEFAULT_RECYCLE_VIEW = true;
//
class RefreshAction extends Action {
public RefreshAction() {
- super("Refresh", BundleUtils.getImageDescriptorFromPlugin(SimanticsUI.PLUGIN_ID, "icons/refresh.gif"));
- setToolTipText("Refresh");
+ super(Messages.GraphDebuggerView_Refresh, BundleUtils.getImageDescriptorFromPlugin(SimanticsUI.PLUGIN_ID, "icons/refresh.gif")); //$NON-NLS-2$
+ setToolTipText(Messages.GraphDebuggerView_Refresh);
}
@Override
public void run() {
class BackAction extends Action {
public BackAction() {
- super("Back", Action.AS_PUSH_BUTTON);
- setToolTipText("Back");
+ super(Messages.GraphDebuggerView_Back, Action.AS_PUSH_BUTTON);
+ setToolTipText(Messages.GraphDebuggerView_BackTT);
setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK));
setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK_DISABLED));
}
class ForwardAction extends Action {
public ForwardAction() {
- super("Forward", Action.AS_PUSH_BUTTON);
- setToolTipText("Forward");
+ super(Messages.GraphDebuggerView_Forward, Action.AS_PUSH_BUTTON);
+ setToolTipText(Messages.GraphDebuggerView_ForwardTT);
setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD));
setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD_DISABLED));
}
class HomeAction extends Action {
public HomeAction() {
- super("Home", Action.AS_PUSH_BUTTON);
- setToolTipText("Navigate to root library");
+ super(Messages.GraphDebuggerView_Home, Action.AS_PUSH_BUTTON);
+ setToolTipText(Messages.GraphDebuggerView_HomeTT);
setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_ETOOL_HOME_NAV));
setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_ETOOL_HOME_NAV_DISABLED));
}
class FindAction extends Action {
public FindAction() {
- super("Find", BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_blue.png"));
- setToolTipText("Find Resource");
+ super(Messages.GraphDebuggerView_Find, BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_blue.png")); //$NON-NLS-2$
+ setToolTipText(Messages.GraphDebuggerView_FindTT);
}
@Override
public void run() {
class AddStatementAction extends Action {
public AddStatementAction() {
- super("AddStatement", BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png"));
- setToolTipText("Add Statement Between Existing Resources");
+ super(Messages.GraphDebuggerView_AddStatement, BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png")); //$NON-NLS-2$
+ setToolTipText(Messages.GraphDebuggerView_AddStatementTT);
}
@Override
public void run() {
class AddResourceAction extends Action {
public AddResourceAction() {
- super("AddResource", BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png"));
- setToolTipText("Add New Related Resource");
+ super(Messages.GraphDebuggerView_AddResource, BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png")); //$NON-NLS-2$
+ setToolTipText(Messages.GraphDebuggerView_AddResourceTT);
}
@Override
public void run() {
public class Messages extends NLS {
- public static String Name_adaption_problem;
- public static String Name_formulation_problem;
+ public static String GraphDebugger_Cancel;
+ public static String GraphDebugger_ConfirmActionsDots;
+ public static String GraphDebugger_ConfirmActionsDotsMsg;
+ public static String GraphDebugger_Continue;
+ public static String GraphDebugger_EditValue;
+ public static String GraphDebugger_EnterResourceIDorURI;
+ public static String GraphDebugger_InputNewPropertyValue;
+ public static String GraphDebugger_LabelDragResource;
+ public static String GraphDebugger_Lookup;
+ public static String GraphDebugger_StatusIndexLookpuFailed;
+ public static String GraphDebugger_StatusInvalidInput;
+ public static String GraphDebugger_StatusInvalidInputExpectIdxClusterIds;
+ public static String GraphDebugger_StatusInvalidInputResIdORURIExpected;
+ public static String GraphDebugger_StatusInvalidPrefixedInput;
+ public static String GraphDebugger_StatusResourceforURI;
+ public static String GraphDebugger_StatusResourceIDFailed;
+ public static String GraphDebugger_StatusTransientResourceID;
+ public static String GraphDebugger_StatusURIlookupFailed;
+ public static String GraphDebuggerEditor_AddResource;
+ public static String GraphDebuggerEditor_AddResourceTT;
+ public static String GraphDebuggerEditor_AddStatement;
+ public static String GraphDebuggerEditor_AddStatementTT;
+ public static String GraphDebuggerEditor_Back;
+ public static String GraphDebuggerEditor_BackTT;
+ public static String GraphDebuggerEditor_Find;
+ public static String GraphDebuggerEditor_FindTT;
+ public static String GraphDebuggerEditor_Forward;
+ public static String GraphDebuggerEditor_ForwardTT;
+ public static String GraphDebuggerEditor_Refresh;
+ public static String GraphDebuggerEditor_RefreshTT;
+ public static String GraphDebuggerView_AddResource;
+ public static String GraphDebuggerView_AddResourceTT;
+ public static String GraphDebuggerView_AddStatement;
+ public static String GraphDebuggerView_AddStatementTT;
+ public static String GraphDebuggerView_Back;
+ public static String GraphDebuggerView_BackTT;
+ public static String GraphDebuggerView_Find;
+ public static String GraphDebuggerView_FindTT;
+ public static String GraphDebuggerView_Forward;
+ public static String GraphDebuggerView_ForwardTT;
+ public static String GraphDebuggerView_Home;
+ public static String GraphDebuggerView_HomeTT;
+ public static String GraphDebuggerView_Refresh;
+ public static String SearchResourceDialog_ActivatorResourceLabelProviderFailed;
+ public static String SearchResourceDialog_EnterNameResURIOrId;
+ public static String SearchResourceDialog_SeperatorLblPreviouslySelected;
+ public static String SearchResourceDialog_ShowInBrowser;
+ public static String SessionDebuggerView_ActivatorUnexpectedException;
+ public static String SessionDebuggerView_ActivatorUnexpectedIOException;
+ public static String SessionDebuggerView_Shell;
+ public static String SessionDebuggerView_WroteCommand;
+ public static String VariableDebugger_DragResourceToDebugger;
+ public static String VariableDebugger_Lookup;
+ public static String VariableDebugger_TextToolTip;
+ public static String VariableDebuggerView_Back;
+ public static String VariableDebuggerView_Forward;
+ public static String VariableDebuggerView_Home;
+ public static String VariableDebuggerView_HomeTT;
+ public static String VariableDebuggerView_Refresh;
private static final String BUNDLE_NAME = "org.simantics.debug.ui.messages"; //$NON-NLS-1$
static {
public void run(ReadGraph g) {
try {
if (!asyncListening && resFoundQueue!=null) resFoundQueue.g = g;
- Resource root = g.getResource("http:/");
+ Resource root = g.getResource("http:/"); //$NON-NLS-1$
Layer0 L0 = Layer0.getInstance(g);
LinkedList<Resource> queue = new LinkedList<Resource>();
queue.add(root);
*/
private static final int DEFAULT_MAX_INDEX_HITS = 1000;
- private static final Pattern ID_PATTERN = Pattern.compile("\\$([0-9]+)");
+ private static final Pattern ID_PATTERN = Pattern.compile("\\$([0-9]+)"); //$NON-NLS-1$
private static final String SEARCH_RESOURCE_DIALOG = "SearchResourceDialog"; //$NON-NLS-1$
private static final int SHOW_IN_BROWSER_ID = IDialogConstants.CLIENT_ID + 1;
- private static final String SHOW_IN_BROWSER_LABEL = "Show In Browser";
+ private static final String SHOW_IN_BROWSER_LABEL = Messages.SearchResourceDialog_ShowInBrowser;
private Session session;
@SuppressWarnings("unused")
@Override
public String getText(Object element) {
if (element == null)
- return "null";
+ return "null"; //$NON-NLS-1$
// This may happen if multiple choice is enabled
if (element instanceof String)
return (String) element;
String name = NameUtils.getSafeName(g, r);
String uri = DebugUtils.getPossibleRootRelativePath(g, r);
return
- "[" + r.getResourceId() + "] - "
+ "[" + r.getResourceId() + "] - " //$NON-NLS-1$ //$NON-NLS-2$
+ name
- + (uri != null ? " - " : "")
- + (uri != null ? uri : "");
+ + (uri != null ? " - " : "") //$NON-NLS-1$ //$NON-NLS-2$
+ + (uri != null ? uri : ""); //$NON-NLS-1$
}
});
} catch (DatabaseException e) {
- Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Resource label provider failed unexpectedly.", e));
- return "";
+ Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.SearchResourceDialog_ActivatorResourceLabelProviderFailed, e));
+ return ""; //$NON-NLS-1$
}
}
};
@Override
public String getText(Object element) {
if (element==null)
- return "null";
+ return "null"; //$NON-NLS-1$
return element.toString();
}
@Override
this.session = s;
this.selection = selection;
this.labelProvider = new ElementLabelProvider(shell.getDisplay());
- setMessage("Enter name, resource URI or ID");
+ setMessage(Messages.SearchResourceDialog_EnterNameResURIOrId);
setListLabelProvider(labelProvider);
setDetailsLabelProvider(detailsLabelProvider);
setTitle(title);
//setInitialPattern("*", FilteredItemsSelectionDialog.FULL_SELECTION);
setSelectionHistory(new ResourceSelectionHistory());
- setSeparatorLabel("Previously selected above, others below");
+ setSeparatorLabel(Messages.SearchResourceDialog_SeperatorLblPreviouslySelected);
}
@Override
protected void configureShell(Shell shell) {
this.resourceManager = new LocalResourceManager(JFaceResources.getResources(), shell);
- setImage((Image) resourceManager.get(BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_blue.png")));
+ setImage((Image) resourceManager.get(BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_blue.png"))); //$NON-NLS-1$
super.configureShell(shell);
}
try {
return DebugUtils.getSafeLabel(g, r);
} catch (Exception ex) {
- System.out.println("Exception thrown from restoreItemFromMemento");
+ System.out.println("Exception thrown from restoreItemFromMemento"); //$NON-NLS-1$
}
} catch (Throwable t) {}
- return "" + r.getResourceId();
+ return "" + r.getResourceId(); //$NON-NLS-1$
}
});
if (name==null) return null;
return new LabeledResource(name, r);
} catch (NumberFormatException | DatabaseException e) {
- LOGGER.info("Search memento restoration failed.", e);
+ LOGGER.info("Search memento restoration failed.", e); //$NON-NLS-1$
return null;
}
}
public ItemsFilterWithSearchResults() {
final String pattern = getPattern();
- final boolean findUris = pattern.trim().startsWith("http:/");
+ final boolean findUris = pattern.trim().startsWith("http:/"); //$NON-NLS-1$
final long referencedResourceId = referencedResourceId(pattern);
final boolean findIds = referencedResourceId != 0;
IResourceFilter rf = resourceFilter;
String filter = getFilterForResourceFilter(rf);
if (!filter.isEmpty())
- filter += " AND ";
- filter += "Name:" + pattern + "*";
+ filter += " AND "; //$NON-NLS-1$
+ filter += "Name:" + pattern + "*"; //$NON-NLS-1$ //$NON-NLS-2$
Layer0 L0 = Layer0.getInstance(graph);
@SuppressWarnings("unchecked")
@Override
public String getElementName(Object item) {
- return ((Container<Resource>)item).get().getResourceId()+"";
+ return ((Container<Resource>)item).get().getResourceId()+""; //$NON-NLS-1$
//return item.toString();
}
private String getFilterForResourceFilter(IResourceFilter filter) {
if (filter == null || filter == ResourceSearch.FILTER_ALL)
- return "";
+ return ""; //$NON-NLS-1$
if (filter == ResourceSearch.FILTER_RELATIONS)
- return "Types:Relation";
+ return "Types:Relation"; //$NON-NLS-1$
if (filter == ResourceSearch.FILTER_TYPES)
- return "Types:Type";
- return "";
+ return "Types:Type"; //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
}
}
*/
public SessionDebugger(Composite parent, int style, final Session session) {
super(parent, style);
- Assert.isNotNull(session, "session is null");
+ Assert.isNotNull(session, "session is null"); //$NON-NLS-1$
this.session = session;
updater = new MergingGraphRequestProcessor(session, 100);
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.custom.CTabFolder;
@SuppressWarnings("deprecation")
public class SessionDebuggerView extends SimanticsView {
- public static final String VIEW_ID = "org.simantics.debug.sessionDebugger";
+ public static final String VIEW_ID = "org.simantics.debug.sessionDebugger"; //$NON-NLS-1$
private CTabFolder folder;
private Text commandLine;
@Override
protected Set<String> getBrowseContexts() {
- return Collections.singleton("");
+ return Collections.singleton(""); //$NON-NLS-1$
}
private CTabItem createItem(int index, CTabFolder folder, Control control) {
if (historyPosition < 0) {
return;
} else if (historyPosition == 0) {
- commandLine.setText("");
+ commandLine.setText(""); //$NON-NLS-1$
historyPosition = -1;
} else {
commandLine.setText(history.get(--historyPosition));
}
} else if (e.keyCode == SWT.ESC) {
historyPosition = -1;
- commandLine.setText("");
+ commandLine.setText(""); //$NON-NLS-1$
} else if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
applyCommand(commandLine.getText());
}
});
CTabItem shellItem = createItem(0, folder, shell);
- shellItem.setText("Shell");
+ shellItem.setText(Messages.SessionDebuggerView_Shell);
// SessionDebugger deprecated = new SessionDebugger(folder, SWT.NONE, Simantics.getSession());
// deprecated.initializeUI();
} catch (DatabaseException e) {
Activator.getDefault().getLog().log(
new Status(IStatus.ERROR, Activator.PLUGIN_ID,
- "Unexpected exception while applying command " + command, e));
+ Messages.SessionDebuggerView_ActivatorUnexpectedException + command, e));
}
}
Path p = (Path) output;
long size = Files.size(p);
if (size < (1L << 16)) {
- terminal.addFirst(new String(Files.readAllBytes(p), "UTF-8"));
+ terminal.addFirst(new String(Files.readAllBytes(p), "UTF-8")); //$NON-NLS-1$
}
- terminal.addFirst("Wrote command '" + command + "' output to file " + p);
+ terminal.addFirst(NLS.bind(Messages.SessionDebuggerView_WroteCommand ,new Object[] { command , p}));
} catch (IOException e) {
Activator.getDefault().getLog().log(
new Status(IStatus.ERROR, Activator.PLUGIN_ID,
- "Unexpected I/O exception while applying command " + command, e));
+ NLS.bind(Messages.SessionDebuggerView_ActivatorUnexpectedIOException , new Object[]{ command, e})));
}
} else {
- throw new IllegalArgumentException("Unsupported output argument type " + output);
+ throw new IllegalArgumentException("Unsupported output argument type " + output); //$NON-NLS-1$
}
if (terminal.size() > 10)
terminal.removeLast();
private void apply(String command, Object data) {
if (data instanceof String) {
SWTUtils.asyncExec(commandLine, () -> {
- commandLine.setText("");
+ commandLine.setText(""); //$NON-NLS-1$
addHistory(command, data);
console.setText(formatTerminal());
});
SWTUtils.asyncExec(commandLine, () -> {
try {
addHistory(command, dumpListenerReport((ListenerReport) data));
- commandLine.setText("");
+ commandLine.setText(""); //$NON-NLS-1$
console.setText(formatTerminal());
} catch (IOException e) {
Activator.getDefault().getLog().log(
new Status(IStatus.ERROR, Activator.PLUGIN_ID,
- "Unexpected I/O exception while applying command " + command, e));
+ Messages.SessionDebuggerView_ActivatorUnexpectedIOException + command, e));
}
});
}
}
private Path dumpListenerReport(ListenerReport data) throws IOException {
- File f = Simantics.getTempfile("debug", "listenerReport");
- try (PrintStream out = new PrintStream(f, "UTF-8")) {
- out.print("<pre>");
+ File f = Simantics.getTempfile("debug", "listenerReport"); //$NON-NLS-1$ //$NON-NLS-2$
+ try (PrintStream out = new PrintStream(f, "UTF-8")) { //$NON-NLS-1$
+ out.print("<pre>"); //$NON-NLS-1$
data.print(out);
- out.print("</pre>");
+ out.print("</pre>"); //$NON-NLS-1$
}
return f.toPath();
}
private String formatTerminal() {
StringBuilder b = new StringBuilder();
- b.append("<html><head/><body>\n");
+ b.append("<html><head/><body>\n"); //$NON-NLS-1$
for (String s : terminal)
- b.append(s).append("<br/>\n");
- b.append("</body></html>");
+ b.append(s).append("<br/>\n"); //$NON-NLS-1$
+ b.append("</body></html>"); //$NON-NLS-1$
return b.toString();
}
void historyChanged();
}
- private final static String DEFAULT_DEBUGGER_CSS_FILE = "debugger.css";
- private final static String DEFAULT_DEBUGGER_CSS_PATH = "css/" + DEFAULT_DEBUGGER_CSS_FILE;
+ private final static String DEFAULT_DEBUGGER_CSS_FILE = "debugger.css"; //$NON-NLS-1$
+ private final static String DEFAULT_DEBUGGER_CSS_PATH = "css/" + DEFAULT_DEBUGGER_CSS_FILE; //$NON-NLS-1$
private static int RESOURCE_NAME_MAX_LENGTH = 1000;
- private final Charset utf8 = Charset.forName("UTF-8");
+ private final Charset utf8 = Charset.forName("UTF-8"); //$NON-NLS-1$
private final LocalResourceManager resourceManager;
if (!browser.isDisposed())
browser.setText(content);
if (!updateTriggerCounter.isDisposed())
- updateTriggerCounter.setText(updateCount + "/" + triggerCounter);
+ updateTriggerCounter.setText(updateCount + "/" + triggerCounter); //$NON-NLS-1$
}
});
}
*/
public VariableDebugger(Composite parent, int style, final Session session, String initialURI) {
super(parent, style);
- Assert.isNotNull(session, "session is null");
+ Assert.isNotNull(session, "session is null"); //$NON-NLS-1$
this.session = session;
this.currentElement = initialURI;
this.resourceManager = new LocalResourceManager(JFaceResources.getResources(), parent);
if (!css.exists()) {
URL url = FileLocator.find(Activator.getDefault().getBundle(), new Path(DEFAULT_DEBUGGER_CSS_PATH), null);
if (url == null)
- throw new FileNotFoundException("Could not find '" + DEFAULT_DEBUGGER_CSS_PATH + "' in bundle '" + Activator.PLUGIN_ID + "'");
+ throw new FileNotFoundException("Could not find '" + DEFAULT_DEBUGGER_CSS_PATH + "' in bundle '" + Activator.PLUGIN_ID + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
cssPath = FileUtils.copyResource(url, css, true).toURI().toString();
} else {
cssPath = css.toURI().toString();
public Label createDropLabel(Composite parent) {
final Label label = new Label(parent, SWT.BORDER | SWT.FLAT);
label.setAlignment(SWT.CENTER);
- label.setText(" Drag a resource or a variable here to examine it in this debugger! ");
+ label.setText(Messages.VariableDebugger_DragResourceToDebugger);
label.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
GridData data = new GridData(SWT.LEFT, SWT.FILL, false, false);
label.setLayoutData(data);
text.setLayoutData(data);
Button button = new Button(parent, SWT.NONE);
- button.setText("Lookup");
+ button.setText(Messages.VariableDebugger_Lookup);
GridData data2 = new GridData(SWT.FILL, SWT.FILL, false, false);
button.setLayoutData(data2);
protected Text createUpdateTriggerCounter(Composite parent) {
Text label = new Text(parent, SWT.BORDER | SWT.FLAT);
label.setEditable(false);
- label.setToolTipText("Amount of Screen/Listener Updates Received for Shown Variable");
+ label.setToolTipText(Messages.VariableDebugger_TextToolTip);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL)
.grab(false, false).hint(32, SWT.DEFAULT).applyTo(label);
updateTriggerCounter = label;
@Override
public void changing(LocationEvent event) {
String location = event.location;
- if (location.startsWith("simantics:browser"))
- location = "about:" + location.substring(17);
+ if (location.startsWith("simantics:browser")) //$NON-NLS-1$
+ location = "about:" + location.substring(17); //$NON-NLS-1$
//System.out.println("changing: location=" + location);
// Do not follow links that are meant as actions that are
// handled below.
event.doit = false;
- if ("about:blank".equals(location)) {
+ if ("about:blank".equals(location)) { //$NON-NLS-1$
// Just changing to the same old blank url is ok since it
// allows the browser to refresh itself.
event.doit = true;
}
- if (location.startsWith("about:-link")) {
- String target = location.replace("about:-link", "");
+ if (location.startsWith("about:-link")) { //$NON-NLS-1$
+ String target = location.replace("about:-link", ""); //$NON-NLS-1$ //$NON-NLS-2$
try {
byte[] bytes = Base64.decode(target);
String url = new String(bytes, utf8);
} catch (IOException e) {
ErrorLogger.defaultLogError(e);
}
- } else if (location.startsWith("about:-remove")) {
- } else if (location.startsWith("about:-edit-value")) {
+ } else if (location.startsWith("about:-remove")) { //$NON-NLS-1$
+ } else if (location.startsWith("about:-edit-value")) { //$NON-NLS-1$
}
}
});
if (o instanceof byte[]) {
byte[] arr = (byte[]) o;
byte[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
- return truncated("byte", Arrays.toString(arr2), arr.length);
+ return truncated("byte", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
} else if (o instanceof int[]) {
int[] arr = (int[]) o;
int[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
- return truncated("int", Arrays.toString(arr2), arr.length);
+ return truncated("int", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
} else if (o instanceof long[]) {
long[] arr = (long[]) o;
long[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
- return truncated("long", Arrays.toString(arr2), arr.length);
+ return truncated("long", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
} else if (o instanceof float[]) {
float[] arr = (float[]) o;
float[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
- return truncated("float", Arrays.toString(arr2), arr.length);
+ return truncated("float", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
} else if (o instanceof double[]) {
double[] arr = (double[]) o;
double[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
- return truncated("double", Arrays.toString(arr2), arr.length);
+ return truncated("double", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
} else if (o instanceof boolean[]) {
boolean[] arr = (boolean[]) o;
boolean[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
- return truncated("boolean", Arrays.toString(arr2), arr.length);
+ return truncated("boolean", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
} else if (o instanceof Object[]) {
Object[] arr = (Object[]) o;
Object[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
- return truncated("Object", Arrays.toString(arr2), arr.length);
+ return truncated("Object", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
} else {
- return "Unknown big array " + o.getClass();
+ return "Unknown big array " + o.getClass(); //$NON-NLS-1$
}
} else {
- return o.getClass().getComponentType() + "[" + length + "] = " + ObjectUtils.toString(o);
+ return o.getClass().getComponentType() + "[" + length + "] = " + ObjectUtils.toString(o); //$NON-NLS-1$ //$NON-NLS-2$
}
}
return null;
}
protected String truncated(String type, String string, int originalLength) {
- return type + "[" + RESOURCE_NAME_MAX_LENGTH + "/" + originalLength + "] = " + string;
+ return type + "[" + RESOURCE_NAME_MAX_LENGTH + "/" + originalLength + "] = " + string; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
protected String getVariableName(ReadGraph graph, Variable r) {
for(VariableConnectionPointDescriptor v : c.getConnectionPointDescriptors(graph, null)) {
result.add(v.getRelativeRVI(graph, base));
}
- return "c " + result.toString();
+ return "c " + result.toString(); //$NON-NLS-1$
} else if (clazz.isArray()) {
if(int[].class == clazz) {
return Arrays.toString((int[])o);
Object value = r.getValue(graph);
if(value instanceof Resource) return getResourceRef(graph, (Resource)value);
else if (value instanceof Variable) return getVariableRef(graph, (Variable)value);
- else return value != null ? getValue(graph, r, value) : "null";
+ else return value != null ? getValue(graph, r, value) : "null"; //$NON-NLS-1$
} catch (Throwable e) {
try {
- Logger.defaultLogError("getValue " + r.getURI(graph), e);
+ Logger.defaultLogError("getValue " + r.getURI(graph), e); //$NON-NLS-1$
} catch (DatabaseException e1) {
Logger.defaultLogError(e1);
}
protected String getDatatype(ReadGraph graph, Variable r) {
try {
Datatype dt = r.getPossibleDatatype(graph);
- return dt != null ? dt.toSingleLineString() : "undefined";
+ return dt != null ? dt.toSingleLineString() : "undefined"; //$NON-NLS-1$
} catch (Exception e) {
return e.getMessage();
}
}
private String getVariableRef(ReadGraph graph, Variable r) throws DatabaseException {
- String ret = "<a href=\"simantics:browser-link" + getLinkString(graph, r) + "\">"
+ String ret = "<a href=\"simantics:browser-link" + getLinkString(graph, r) + "\">" //$NON-NLS-1$ //$NON-NLS-2$
+ getVariableName(graph, r)
- + "</a>";
+ + "</a>"; //$NON-NLS-1$
// if (graph.isInstanceOf(r, L0.Literal)) {
// ret += " <a class=\"edit-link\" href=\"simantics:browser-edit-value" + getLinkString(r) + "\">"
// + "(edit value)"
// } catch (Exception e) {
// e.printStackTrace();
// }
- content.append("<tr>");
- content.append("<td>").append(getVariableRef(graph, property)).append("</td>");
- content.append("<td>").append(getValue(graph, property)).append("</td>");
- content.append("<td>").append(getDatatype(graph, property)).append("</td>");
- content.append("</tr>");
+ content.append("<tr>"); //$NON-NLS-1$
+ content.append("<td>").append(getVariableRef(graph, property)).append("</td>"); //$NON-NLS-1$ //$NON-NLS-2$
+ content.append("<td>").append(getValue(graph, property)).append("</td>"); //$NON-NLS-1$ //$NON-NLS-2$
+ content.append("<td>").append(getDatatype(graph, property)).append("</td>"); //$NON-NLS-1$ //$NON-NLS-2$
+ content.append("</tr>"); //$NON-NLS-1$
}
protected String getRVIString(ReadGraph graph, Variable var) throws DatabaseException {
try {
return var.getRVI(graph).toString(graph);
} catch (Throwable e) {
- return "No RVI";
+ return "No RVI"; //$NON-NLS-1$
}
}
StringBuilder content = new StringBuilder();
// Generate HTML -page
- content.append("<html><head>").append(getHead()).append("</head>\n");
- content.append("<body>\n");
- content.append("<div id=\"mainContent\">\n");
+ content.append("<html><head>").append(getHead()).append("</head>\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ content.append("<body>\n"); //$NON-NLS-1$
+ content.append("<div id=\"mainContent\">\n"); //$NON-NLS-1$
for (String uri : uris) {
//System.out.println("URI: " + uri);
Variable var = Variables.getPossibleVariable(graph, uri);
}
// Begin #top DIV
- content.append("<div id=\"top\">\n");
- content.append("<table class=\"top\">\n");
- content.append("<tr><td class=\"top_key\">URI</td><td class=\"top_value\"><span id=\"uri\">").append(uri).append("</span></td></tr>\n");
- content.append("<tr><td class=\"top_key\">RVI</td><td class=\"top_value\"><span id=\"uri\">").append(rviString).append("</span></td></tr>\n");
- content.append("<tr><td class=\"top_key\">Class</td><td class=\"top_value\"><span id=\"class\">").append(var.getClass().getCanonicalName()).append("</span></td></tr>\n");
- content.append("<tr><td class=\"top_key\">Solver node</td><td class=\"top_value\"><span id=\"class\">").append(node).append("</span></td></tr>\n");
- content.append("</table>\n");
- content.append("</div>\n");
+ content.append("<div id=\"top\">\n"); //$NON-NLS-1$
+ content.append("<table class=\"top\">\n"); //$NON-NLS-1$
+ content.append("<tr><td class=\"top_key\">URI</td><td class=\"top_value\"><span id=\"uri\">").append(uri).append("</span></td></tr>\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ content.append("<tr><td class=\"top_key\">RVI</td><td class=\"top_value\"><span id=\"uri\">").append(rviString).append("</span></td></tr>\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ content.append("<tr><td class=\"top_key\">Class</td><td class=\"top_value\"><span id=\"class\">").append(var.getClass().getCanonicalName()).append("</span></td></tr>\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ content.append("<tr><td class=\"top_key\">Solver node</td><td class=\"top_value\"><span id=\"class\">").append(node).append("</span></td></tr>\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ content.append("</table>\n"); //$NON-NLS-1$
+ content.append("</div>\n"); //$NON-NLS-1$
// Close #top DIV
// Content
}
} catch (DatabaseException e) {
// This may happen if the Variable implementation is broken
- ErrorLogger.defaultLogError("Broken variable child retrieval implementation or serious modelling error encountered. See exception for details.", e);
+ ErrorLogger.defaultLogError("Broken variable child retrieval implementation or serious modelling error encountered. See exception for details.", e); //$NON-NLS-1$
}
TreeMap<String, Variable> map2 = new TreeMap<String, Variable>();
}
} catch (DatabaseException e) {
// This may happen if the Variable implementation is broken
- ErrorLogger.defaultLogError("Broken variable property retrieval implementation or serious modelling error encountered. See exception for details.", e);
+ ErrorLogger.defaultLogError("Broken variable property retrieval implementation or serious modelling error encountered. See exception for details.", e); //$NON-NLS-1$
}
- content.append("\n<div id=\"data\">\n");
- content.append("<table>\n");
+ content.append("\n<div id=\"data\">\n"); //$NON-NLS-1$
+ content.append("<table>\n"); //$NON-NLS-1$
- content.append("<tr><th>Child</th></tr>");
+ content.append("<tr><th>Child</th></tr>"); //$NON-NLS-1$
for (Variable child : map.values()) {
- content.append("<tr><td>").append(getVariableRef(graph, child)).append("</td></tr>");
+ content.append("<tr><td>").append(getVariableRef(graph, child)).append("</td></tr>"); //$NON-NLS-1$ //$NON-NLS-2$
}
- content.append("<tr><th>Property</th><th>Value</th><th>Datatype</th></tr>");
+ content.append("<tr><th>Property</th><th>Value</th><th>Datatype</th></tr>"); //$NON-NLS-1$
for (Variable property : map2.values()) {
updateProperty(content, graph, property);
}
// Close #data
- content.append("</div>\n\n");
+ content.append("</div>\n\n"); //$NON-NLS-1$
}
// Close #mainContent
- content.append("</div>\n");
- content.append("</body></html>\n");
+ content.append("</div>\n"); //$NON-NLS-1$
+ content.append("</body></html>\n"); //$NON-NLS-1$
// Update content
return content.toString();
}
private String getHead() {
- String result = "";
+ String result = ""; //$NON-NLS-1$
if (cssPath != null) {
- result = "<link href=\"" + cssPath + "\" rel=\"stylesheet\" type=\"text/css\">";
+ result = "<link href=\"" + cssPath + "\" rel=\"stylesheet\" type=\"text/css\">"; //$NON-NLS-1$ //$NON-NLS-2$
}
return result;
}
public class VariableDebuggerView extends ViewPart {
- public static final String VIEW_ID = "org.simantics.debug.variableDebugger";
+ public static final String VIEW_ID = "org.simantics.debug.variableDebugger"; //$NON-NLS-1$
private ResourceInput input;
//
class RefreshAction extends Action {
public RefreshAction() {
- super("Refresh", BundleUtils.getImageDescriptorFromPlugin(SimanticsUI.PLUGIN_ID, "icons/refresh.gif"));
+ super(Messages.VariableDebuggerView_Refresh, BundleUtils.getImageDescriptorFromPlugin(SimanticsUI.PLUGIN_ID, "icons/refresh.gif")); //$NON-NLS-2$
}
@Override
public void run() {
class BackAction extends Action {
public BackAction() {
- super("Back", Action.AS_PUSH_BUTTON);
+ super(Messages.VariableDebuggerView_Back, Action.AS_PUSH_BUTTON);
setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK));
setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK_DISABLED));
}
class ForwardAction extends Action {
public ForwardAction() {
- super("Forward", Action.AS_PUSH_BUTTON);
+ super(Messages.VariableDebuggerView_Forward, Action.AS_PUSH_BUTTON);
setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD));
setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD_DISABLED));
}
class HomeAction extends Action {
public HomeAction() {
- super("Home", Action.AS_PUSH_BUTTON);
- setToolTipText("Navigate to root library");
+ super(Messages.VariableDebuggerView_Home, Action.AS_PUSH_BUTTON);
+ setToolTipText(Messages.VariableDebuggerView_HomeTT);
setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_ETOOL_HOME_NAV));
setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_ETOOL_HOME_NAV_DISABLED));
}
import javax.swing.SwingUtilities;
import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.layout.GridData;
public GraphvizComponent2 createGraph(Composite parent) {
graph = new Graph();
- graph.setRankdir("LR");
+ graph.setRankdir("LR"); //$NON-NLS-1$
graphVizComponent = new GraphvizComponent2(parent, SWT.NONE);
SwingUtilities.invokeLater(new Runnable() {
if (n == null) {
n = new Node(graph);
if (!r.isPersistent()) {
- n.setShape("box");
- n.setFontColor("blue");
+ n.setShape("box"); //$NON-NLS-1$
+ n.setFontColor("blue"); //$NON-NLS-1$
}
nodeMap.map(r, n);
}
@SuppressWarnings("unused")
protected void appendLabel(Node node, String text) {
- String label = node.get("label");
+ String label = node.get("label"); //$NON-NLS-1$
if (true) {
if (label == null || label.length() == 0)
label = text;//escape(text);
else {
label = label.substring(1,label.length()-1);
- label += "<br/>"+text;
+ label += "<br/>"+text; //$NON-NLS-1$
}
- label = "<" + label + ">";
+ label = "<" + label + ">"; //$NON-NLS-1$ //$NON-NLS-2$
} else {
if (label == null || label.length() == 0)
label = text;
else {
- label += " "+text;
+ label += " "+text; //$NON-NLS-1$
}
}
L0 = Layer0.getInstance(g);
graph = new Graph();
- graph.setRankdir("LR");
+ graph.setRankdir("LR"); //$NON-NLS-1$
nodeMap.clear();
edgeMap.clear();
continue;
Node node = getResourceRef(g, r);
if (r.equals(getDebuggerLocation())) {
- node.setFillColor("#aaffaa");
- node.setStyle("filled");
+ node.setFillColor("#aaffaa"); //$NON-NLS-1$
+ node.setStyle("filled"); //$NON-NLS-1$
}
//Node node = getOrCreate(r);
processed.add(r);
uri = g.syncRequest(new ResourceToPossibleURI(r));
} catch (Exception e) {
e.printStackTrace();
- uri = "Cannot get URI: " + e.getMessage();
+ uri = "Cannot get URI: " + e.getMessage(); //$NON-NLS-1$
}
if (uri != null)
- appendLabel(node, "URI: " + uri);
+ appendLabel(node, "URI: " + uri); //$NON-NLS-1$
//content.append("\t\t<div class=\"monospaced\">" + uri + "</div><br/>");
Collection<Statement> statements = g.getStatements(r, L0.IsWeaklyRelatedTo);
map.add(predicate, new Resource[] {subject, obj});
} catch (Throwable e) {
e.printStackTrace();
- ErrorLogger.defaultLogError("Cannot find statement " + subject + " " + predicate + " " + obj, e);
+ ErrorLogger.defaultLogError("Cannot find statement " + subject + " " + predicate + " " + obj, e); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
ClusteringSupport support = g.getSession().getService(ClusteringSupport.class);
//content.append("<h3>" + " ["+ r.getResourceId() + "-" + support.getCluster(r) + "] " + "</h3>\n");
- appendLabel(node, " ["+ r.getResourceId() + "-" + support.getCluster(r) + "]");
+ appendLabel(node, " ["+ r.getResourceId() + "-" + support.getCluster(r) + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
//content.append("<table>\n");
//content.append("<tr><th>Predicate</th><th>Object</th></tr>");
//content.append("<tr><td class=\"subtitle\" colspan=\"2\">Tags</td></tr>");
for(Statement stm : statements) {
if(stm.getSubject().equals(stm.getObject())) {
- updateTag(node, g, r, stm.getPredicate(), "Tag");
+ updateTag(node, g, r, stm.getPredicate(), "Tag"); //$NON-NLS-1$
map.remove(stm.getPredicate());
}
}
for(Statement stm : statements) {
Resource predicate = stm.getPredicate();
if(g.isInstanceOf(stm.getPredicate(), L0.OrderedSet)) {
- updateTag(node, g, r, stm.getPredicate(), "Ordered Set");
+ updateTag(node, g, r, stm.getPredicate(), "Ordered Set"); //$NON-NLS-1$
map.remove(stm.getPredicate());
}
Resource inverse = g.getPossibleInverse(predicate);
for(Resource pred : preds) {
String str = htmlEscape(getResourceName(g, pred));
if(str == null)
- str = "<null>";
+ str = "<null>"; //$NON-NLS-1$
strmap.put(pred, str);
}
Arrays.sort(preds, new Comparator<Resource>() {
if(!stmSubject.equals(subj)) {
Node asserted = getResourceRef(graph, stmSubject);
Edge e = new Edge(this.graph, objects[i].node, asserted);
- e.setLabel("Asserted in");
+ e.setLabel(Messages.GraphicalDebugger_AssertedIn);
- objects[i].node.setFillColor("#ffaaaa");
- objects[i].node.setStyle("filled");
+ objects[i].node.setFillColor("#ffaaaa"); //$NON-NLS-1$
+ objects[i].node.setStyle("filled"); //$NON-NLS-1$
}
}
cur = OrderedSetUtils.next(graph, subj, cur);
} catch(DatabaseException e) {
Edge edge = new Edge(this.graph, node, node);
- edge.setLabel("Broken Ordered Set");
+ edge.setLabel(Messages.GraphicalDebugger_BrockenOrderedSet);
//list.add("<span style=\"color:red;font-weight:bold\">BROKEN ORDERED SET:<br/></span><span style=\"color:red\">" + e.getMessage() + "</span>");
// Resource inv = graph.getPossibleInverse(subj);
// for(Statement stat : graph.getStatements(cur, L0.IsRelatedTo)) {
}
for (int i = 0; i < list.size() ; ++i) {
Edge e = new Edge(this.graph, node, list.get(i));
- e.setLabel("Oredered set item " + i);
+ e.setLabel(NLS.bind(Messages.GraphicalDebugger_OrderedSetItem , i));
}
// Output table rows
public class GraphicalDebuggerEditor extends ResourceEditorPart {
- public static final String EDITOR_ID = "org.simantics.debug.graphicalDebuggerEditor";
+ public static final String EDITOR_ID = "org.simantics.debug.graphicalDebuggerEditor"; //$NON-NLS-1$
private GraphicalDebugger debugger;
private IAction backAction;
class RefreshAction extends Action {
public RefreshAction() {
- super("Refresh", BundleUtils.getImageDescriptorFromPlugin(SimanticsUI.PLUGIN_ID, "icons/refresh.gif"));
+ super(Messages.GraphicalDebuggerEditor_Refresh, BundleUtils.getImageDescriptorFromPlugin(SimanticsUI.PLUGIN_ID, "icons/refresh.gif")); //$NON-NLS-2$
}
@Override
public void run() {
class FindAction extends Action {
public FindAction() {
- super("Find", BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_blue.png"));
- setToolTipText("Find Resource");
+ super(Messages.GraphicalDebuggerEditor_Find, BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_blue.png")); //$NON-NLS-2$
+ setToolTipText(Messages.GraphicalDebuggerEditor_FindTT);
}
@Override
public void run() {
class AddStatementAction extends Action {
public AddStatementAction() {
- super("AddStatement", BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png"));
- setToolTipText("Add Statement Between Existing Resources");
+ super(Messages.GraphicalDebuggerEditor_AddStatement, BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png")); //$NON-NLS-2$
+ setToolTipText(Messages.GraphicalDebuggerEditor_AddStatementTT);
}
@Override
public void run() {
}
class AddResourceAction extends Action {
public AddResourceAction() {
- super("AddResource", BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png"));
- setToolTipText("Add New Related Resource");
+ super(Messages.GraphicalDebuggerEditor_AddResource, BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png")); //$NON-NLS-2$
+ setToolTipText(Messages.GraphicalDebuggerEditor_AddResourceTT);
}
@Override
public void run() {
}
class BackAction extends Action {
public BackAction() {
- super("Back", Action.AS_PUSH_BUTTON);
- setToolTipText("Back");
+ super(Messages.GraphicalDebuggerEditor_Back, Action.AS_PUSH_BUTTON);
+ setToolTipText(Messages.GraphicalDebuggerEditor_BackTT);
setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK));
setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK_DISABLED));
}
class ForwardAction extends Action {
public ForwardAction() {
- super("Forward", Action.AS_PUSH_BUTTON);
- setToolTipText("Forward");
+ super(Messages.GraphicalDebuggerEditor_Forward, Action.AS_PUSH_BUTTON);
+ setToolTipText(Messages.GraphicalDebuggerEditor_ForwardTT);
setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD));
setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD_DISABLED));
}
class DecreaseDepthAction extends Action {
public DecreaseDepthAction() {
- super("Decrease", Action.AS_PUSH_BUTTON);
+ super(Messages.GraphicalDebuggerEditor_Decrease, Action.AS_PUSH_BUTTON);
setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK));
setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK_DISABLED));
}
class IncreaseDepthAction extends Action {
public IncreaseDepthAction() {
- super("Increase", Action.AS_PUSH_BUTTON);
+ super(Messages.GraphicalDebuggerEditor_Increase, Action.AS_PUSH_BUTTON);
setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD));
setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD_DISABLED));
}
public class GraphicalDebuggerView extends ViewPart {
- public static final String VIEW_ID = "org.simantics.debug.graphicalDebugger";
+ public static final String VIEW_ID = "org.simantics.debug.graphicalDebugger"; //$NON-NLS-1$
// private final boolean DEFAULT_RECYCLE_VIEW = true;
//
class RefreshAction extends Action {
public RefreshAction() {
- super("Refresh", BundleUtils.getImageDescriptorFromPlugin(SimanticsUI.PLUGIN_ID, "icons/refresh.gif"));
+ super(Messages.GraphicalDebuggerView_Refresh, BundleUtils.getImageDescriptorFromPlugin(SimanticsUI.PLUGIN_ID, "icons/refresh.gif")); //$NON-NLS-2$
}
@Override
public void run() {
class BackAction extends Action {
public BackAction() {
- super("Back", Action.AS_PUSH_BUTTON);
+ super(Messages.GraphicalDebuggerView_Back, Action.AS_PUSH_BUTTON);
setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK));
setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK_DISABLED));
}
class ForwardAction extends Action {
public ForwardAction() {
- super("Forward", Action.AS_PUSH_BUTTON);
+ super(Messages.GraphicalDebuggerView_Forward, Action.AS_PUSH_BUTTON);
setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD));
setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD_DISABLED));
}
class HomeAction extends Action {
public HomeAction() {
- super("Home", Action.AS_PUSH_BUTTON);
- setToolTipText("Navigate to root library");
+ super(Messages.GraphicalDebuggerView_Home, Action.AS_PUSH_BUTTON);
+ setToolTipText(Messages.GraphicalDebuggerView_HomeTT);
setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_ETOOL_HOME_NAV));
setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_ETOOL_HOME_NAV_DISABLED));
}
class DecreaseDepthAction extends Action {
public DecreaseDepthAction() {
- super("Decrease", Action.AS_PUSH_BUTTON);
- setToolTipText("Decrease Depth");
+ super(Messages.GraphicalDebuggerView_Decrease, Action.AS_PUSH_BUTTON);
+ setToolTipText(Messages.GraphicalDebuggerView_DecreaseTT);
setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK));
setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK_DISABLED));
}
class IncreaseDepthAction extends Action {
public IncreaseDepthAction() {
- super("Increase", Action.AS_PUSH_BUTTON);
- setToolTipText("Increase Depth");
+ super(Messages.GraphicalDebuggerView_Increase, Action.AS_PUSH_BUTTON);
+ setToolTipText(Messages.GraphicalDebuggerView_IncreaseTT);
setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD));
setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD_DISABLED));
}
--- /dev/null
+package org.simantics.debug.ui.graph;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.simantics.debug.ui.graph.messages"; //$NON-NLS-1$
+ public static String GraphicalDebugger_AssertedIn;
+ public static String GraphicalDebugger_BrockenOrderedSet;
+ public static String GraphicalDebugger_OrderedSetItem;
+ public static String GraphicalDebuggerEditor_AddResource;
+ public static String GraphicalDebuggerEditor_AddResourceTT;
+ public static String GraphicalDebuggerEditor_AddStatement;
+ public static String GraphicalDebuggerEditor_AddStatementTT;
+ public static String GraphicalDebuggerEditor_Back;
+ public static String GraphicalDebuggerEditor_BackTT;
+ public static String GraphicalDebuggerEditor_Decrease;
+ public static String GraphicalDebuggerEditor_Find;
+ public static String GraphicalDebuggerEditor_FindTT;
+ public static String GraphicalDebuggerEditor_Forward;
+ public static String GraphicalDebuggerEditor_ForwardTT;
+ public static String GraphicalDebuggerEditor_Increase;
+ public static String GraphicalDebuggerEditor_Refresh;
+ public static String GraphicalDebuggerView_Back;
+ public static String GraphicalDebuggerView_Decrease;
+ public static String GraphicalDebuggerView_DecreaseTT;
+ public static String GraphicalDebuggerView_Forward;
+ public static String GraphicalDebuggerView_Home;
+ public static String GraphicalDebuggerView_HomeTT;
+ public static String GraphicalDebuggerView_Increase;
+ public static String GraphicalDebuggerView_IncreaseTT;
+ public static String GraphicalDebuggerView_Refresh;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
--- /dev/null
+GraphicalDebugger_AssertedIn=Asserted in\r
+GraphicalDebugger_BrockenOrderedSet=Broken Ordered Set\r
+GraphicalDebugger_OrderedSetItem=Ordered set item {0}\r
+GraphicalDebuggerEditor_AddResource=AddResource\r
+GraphicalDebuggerEditor_AddResourceTT=Add New Related Resource\r
+GraphicalDebuggerEditor_AddStatement=AddStatement\r
+GraphicalDebuggerEditor_AddStatementTT=Add Statement Between Existing Resources\r
+GraphicalDebuggerEditor_Back=Back\r
+GraphicalDebuggerEditor_BackTT=Back\r
+GraphicalDebuggerEditor_Decrease=Decrease\r
+GraphicalDebuggerEditor_Find=Find\r
+GraphicalDebuggerEditor_FindTT=Find Resource\r
+GraphicalDebuggerEditor_Forward=Forward\r
+GraphicalDebuggerEditor_ForwardTT=Forward\r
+GraphicalDebuggerEditor_Increase=Increase\r
+GraphicalDebuggerEditor_Refresh=Refresh\r
+GraphicalDebuggerView_Back=Back\r
+GraphicalDebuggerView_Decrease=Decrease\r
+GraphicalDebuggerView_DecreaseTT=Decrease Depth\r
+GraphicalDebuggerView_Forward=Forward\r
+GraphicalDebuggerView_Home=Home\r
+GraphicalDebuggerView_HomeTT=Navigate to root library\r
+GraphicalDebuggerView_Increase=Increase\r
+GraphicalDebuggerView_IncreaseTT=Increase Depth\r
+GraphicalDebuggerView_Refresh=Refresh\r
public class Activator extends AbstractUIPlugin {
// The plug-in ID
- public static final String PLUGIN_ID = "org.simantics.debug.ui";
+ public static final String PLUGIN_ID = "org.simantics.debug.ui"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
if (stm != null) {
String label = NameUtils.getSafeLabel(graph, r);
if (!label.isEmpty() && !stm.isAsserted(r))
- name += " (" + label + ")";
+ name += " (" + label + ")"; //$NON-NLS-1$ //$NON-NLS-2$
}
return name;
}
public static void addResource(Session s, GraphDebugger debugger) throws DatabaseException {
Shell shell = debugger.getShell();
- SearchResourceDialog rld = new SearchResourceDialog(s, false, shell, "Create New Resource");
+ SearchResourceDialog rld = new SearchResourceDialog(s, false, shell, Messages.DebugUtils_CreateNewResource);
rld.setBlockOnOpen(true);
rld.setResourceFilter(ResourceSearch.FILTER_TYPES);
Resource subject_ = debugger.getDebuggerLocation();
if (subject_ == null) {
rld.setBlockOnOpen(true);
- rld.setMessage("Select Subject");
+ rld.setMessage(Messages.DebugUtils_SelectSubject);
rld.setInitialSelections(new Object[] {});
if (rld.open()!=org.eclipse.jface.window.Window.OK) return;
if (rld.getResult()==null) return;
rld.setBlockOnOpen(true);
rld.setResourceFilter(ResourceSearch.FILTER_RELATIONS);
- rld.setMessage("Select Predicate");
+ rld.setMessage(Messages.DebugUtils_SelectPredicate);
rld.setInitialSelections(new Object[] {});
if (rld.open()!=org.eclipse.jface.window.Window.OK) return;
if (rld.getResult()==null) return;
final Resource predicate = ((Container<Resource>)rld.getResult()[0]).get();
- rld.setMessage("Select Type of New Object Instance");
+ rld.setMessage(Messages.DebugUtils_SelectTypeOfNewObjectInstance);
rld.setResourceFilter(ResourceSearch.FILTER_TYPES);
rld.setInitialSelections(new Object[] {});
if (rld.open()!=org.eclipse.jface.window.Window.OK) return;
@SuppressWarnings("unchecked")
public static void addStatement(Session s, GraphDebugger debugger) throws DatabaseException {
Shell shell = debugger.getShell();
- SearchResourceDialog rld = new SearchResourceDialog(s, false, shell, "Create New Statement");
+ SearchResourceDialog rld = new SearchResourceDialog(s, false, shell, Messages.DebugUtils_CreateNewStatement);
Resource subject_ = debugger.getDebuggerLocation();
if (subject_ == null) {
rld.setBlockOnOpen(true);
- rld.setMessage("Select Subject");
+ rld.setMessage(Messages.DebugUtils_SelectSubject);
rld.setInitialSelections(new Object[] {});
if (rld.open()!=org.eclipse.jface.window.Window.OK) return;
if (rld.getResult()==null) return;
rld.setBlockOnOpen(true);
rld.setResourceFilter(ResourceSearch.FILTER_RELATIONS);
- rld.setMessage("Select Predicate");
+ rld.setMessage(Messages.DebugUtils_SelectPredicate);
rld.setInitialSelections(new Object[] {});
if (rld.open()!=org.eclipse.jface.window.Window.OK) return;
if (rld.getResult()==null) return;
final Resource predicate = ((Container<Resource>)rld.getResult()[0]).get();
rld.setResourceFilter(ResourceSearch.FILTER_ALL);
- rld.setMessage("Select Object");
+ rld.setMessage(Messages.DebugUtils_SelectObject);
rld.setInitialSelections(new Object[] {});
if (rld.open()!=org.eclipse.jface.window.Window.OK) return;
if (rld.getResult()==null) return;
public static void find(Session s, GraphDebugger debugger) {
Shell shell = debugger.getShell();
- SearchResourceDialog rld = new SearchResourceDialog(s, false, shell, "Select Resource to View");
+ SearchResourceDialog rld = new SearchResourceDialog(s, false, shell, Messages.DebugUtils_SelectResourceToView);
rld.setBlockOnOpen(true);
if (rld.open()!=org.eclipse.jface.window.Window.OK) return;
if (rld.getResult()==null) return;
public class GraphDebuggerAdapter extends AbstractResourceEditorAdapter {
public GraphDebuggerAdapter() {
- super("Graph Debugger View", SimanticsUI.getImageDescriptor("icons/etool16/bug.png"));
+ super(Messages.GraphDebuggerAdapter_GraphDebuggerView, SimanticsUI.getImageDescriptor("icons/etool16/bug.png")); //$NON-NLS-1$
}
@Override
public class GraphDebuggerEditorAdapter extends AbstractResourceEditorAdapter {
public GraphDebuggerEditorAdapter() {
- super("Graph Debugger", SimanticsUI.getImageDescriptor("icons/etool16/bug.png"));
+ super(Messages.GraphDebuggerEditorAdapter_GraphDebugger, SimanticsUI.getImageDescriptor("icons/etool16/bug.png")); //$NON-NLS-2$
}
@Override
public class GraphicalDebuggerEditorAdapter extends AbstractResourceEditorAdapter {
public GraphicalDebuggerEditorAdapter() {
- super("Graphical Debugger", SimanticsUI.getImageDescriptor("icons/etool16/bug.png"));
+ super(Messages.GraphicalDebuggerEditorAdapter_GraphicalDebugger, SimanticsUI.getImageDescriptor("icons/etool16/bug.png")); //$NON-NLS-1$
}
@Override
--- /dev/null
+package org.simantics.debug.ui.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.simantics.debug.ui.internal.messages"; //$NON-NLS-1$
+ public static String DebugUtils_CreateNewResource;
+ public static String DebugUtils_CreateNewStatement;
+ public static String DebugUtils_SelectObject;
+ public static String DebugUtils_SelectPredicate;
+ public static String DebugUtils_SelectResourceToView;
+ public static String DebugUtils_SelectSubject;
+ public static String DebugUtils_SelectTypeOfNewObjectInstance;
+ public static String GraphDebuggerAdapter_GraphDebuggerView;
+ public static String GraphDebuggerEditorAdapter_GraphDebugger;
+ public static String GraphicalDebuggerEditorAdapter_GraphicalDebugger;
+ public static String SearchResourceHandler_OpenResource;
+ public static String TGEditorAdapter_OntologyViewer;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
public Object execute(ExecutionEvent event) throws ExecutionException {
Shell shell = HandlerUtil.getActiveShellChecked(event);
Session session = Simantics.getSession();
- SearchResourceDialog rld = new SearchResourceDialog(session, false, shell, "Open Resource");
+ SearchResourceDialog rld = new SearchResourceDialog(session, false, shell, Messages.SearchResourceHandler_OpenResource);
rld.setResourceFilter(ResourceSearch.FILTER_ALL);
rld.setBlockOnOpen(true);
rld.open();
*/
public class TGEditorAdapter extends AbstractResourceEditorAdapter {
- public static final String EDITOR_ID = "org.simantics.modeling.ui.pgraphEditor";
+ public static final String EDITOR_ID = "org.simantics.modeling.ui.pgraphEditor"; //$NON-NLS-1$
public TGEditorAdapter() {
- super("Ontology Viewer", SimanticsUI.getImageDescriptor("icons/etool16/bug.png"));
+ super(Messages.TGEditorAdapter_OntologyViewer, SimanticsUI.getImageDescriptor("icons/etool16/bug.png")); //$NON-NLS-1$
}
@Override
--- /dev/null
+DebugUtils_CreateNewResource=Create New Resource\r
+DebugUtils_CreateNewStatement=Create New Statement\r
+DebugUtils_SelectObject=Select Object\r
+DebugUtils_SelectPredicate=Select Predicate\r
+DebugUtils_SelectResourceToView=Select Resource to View\r
+DebugUtils_SelectSubject=Select Subject\r
+DebugUtils_SelectTypeOfNewObjectInstance=Select Type of New Object Instance\r
+GraphDebuggerAdapter_GraphDebuggerView=Graph Debugger View\r
+GraphDebuggerEditorAdapter_GraphDebugger=Graph Debugger\r
+GraphicalDebuggerEditorAdapter_GraphicalDebugger=Graphical Debugger\r
+SearchResourceHandler_OpenResource=Open Resource\r
+TGEditorAdapter_OntologyViewer=Ontology Viewer\r
# Contributors:
# VTT Technical Research Centre of Finland - initial API and implementation
###############################################################################
+GraphDebugger_Cancel=Cancel
+GraphDebugger_ConfirmActionsDots=Confirm action...
+GraphDebugger_ConfirmActionsDotsMsg=This action will remove the selected statement.\nAre you sure you want to proceed with this action?
+GraphDebugger_Continue=Continue
+GraphDebugger_EditValue=Edit Value
+GraphDebugger_EnterResourceIDorURI=Enter resource ID (RID) or URI
+GraphDebugger_InputNewPropertyValue=Input new property value. For numeric vector values, separate numbers with comma (',').
+GraphDebugger_LabelDragResource=Drag a resource here to examine it in this debugger\!
+GraphDebugger_Lookup=&Lookup
+GraphDebugger_StatusIndexLookpuFailed=Index & cluster -based lookup failed. See Error Log.
+GraphDebugger_StatusInvalidInput=Invalid input, expected transient resource ID
+GraphDebugger_StatusInvalidInputExpectIdxClusterIds=Invalid input, expected index & cluster IDs
+GraphDebugger_StatusInvalidInputResIdORURIExpected=Invalid input, resource ID or URI expected
+GraphDebugger_StatusInvalidPrefixedInput=Invalid '$'-prefixed input, expected resource ID
+GraphDebugger_StatusResourceforURI=Resource for URI ''{0}'' not found
+GraphDebugger_StatusResourceIDFailed=Resource ID lookup failed. See Error Log.
+GraphDebugger_StatusTransientResourceID=Transient resource ID lookup failed. See Error Log.
+GraphDebugger_StatusURIlookupFailed=URI lookup failed. See Error Log.
+GraphDebuggerEditor_AddResourceTT=Add New Related Resource
+GraphDebuggerEditor_AddStatement=AddStatement
+GraphDebuggerEditor_AddStatementTT=Add Statement Between Existing Resources
+GraphDebuggerEditor_Back=Back
+GraphDebuggerEditor_BackTT=Back
+GraphDebuggerEditor_Find=Find
+GraphDebuggerEditor_FindTT=Find Resource
+GraphDebuggerEditor_Forward=Forward
+GraphDebuggerEditor_ForwardTT=Forward
+GraphDebuggerEditor_Refresh=Refresh
+GraphDebuggerEditor_RefreshTT=Refresh
-Name_adaption_problem = <p>GraphDebugger: name adaption problem in {0}</p>
-Name_formulation_problem = <p>GraphDebugger: unknown name formulation problem in {0}</p>
\ No newline at end of file
+
+GraphDebuggerEditor_AddResource=AddResource
+GraphDebuggerView_AddResource=AddResource
+GraphDebuggerView_AddResourceTT=Add New Related Resource
+GraphDebuggerView_AddStatement=AddStatement
+GraphDebuggerView_AddStatementTT=Add Statement Between Existing Resources
+GraphDebuggerView_Back=Back
+GraphDebuggerView_BackTT=Back
+GraphDebuggerView_Find=Find
+GraphDebuggerView_FindTT=Find Resource
+GraphDebuggerView_Forward=Forward
+GraphDebuggerView_ForwardTT=Forward
+GraphDebuggerView_Home=Home
+GraphDebuggerView_HomeTT=Navigate to root library
+GraphDebuggerView_Refresh=Refresh
+SearchResourceDialog_ActivatorResourceLabelProviderFailed=Resource label provider failed unexpectedly.
+SearchResourceDialog_EnterNameResURIOrId=Enter name, resource URI or ID
+SearchResourceDialog_SeperatorLblPreviouslySelected=Previously selected above, others below
+SearchResourceDialog_ShowInBrowser=Show In Browser
+SessionDebuggerView_ActivatorUnexpectedException=Unexpected exception while applying command
+SessionDebuggerView_ActivatorUnexpectedIOException=Unexpected I/O exception while applying command {0}{1}
+SessionDebuggerView_Shell=Shell
+SessionDebuggerView_WroteCommand=Wrote command ''{0}'' output to file {1}
+VariableDebugger_DragResourceToDebugger=\ \ Drag a resource or a variable here to examine it in this debugger\!
+VariableDebugger_Lookup=Lookup
+VariableDebugger_TextToolTip=Amount of Screen/Listener Updates Received for Shown Variable
+VariableDebuggerView_Back=Back
+VariableDebuggerView_Forward=Forward
+VariableDebuggerView_Home=Home
+VariableDebuggerView_HomeTT=Navigate to root library
+VariableDebuggerView_Refresh=Refresh