Resource documentType = graph.getSingleObject(binding, DOC.DocumentTypeBinding_HasDocumentType);
Resource document = graph.newResource();
graph.claim(document, L0.InstanceOf, null, DOC.ScenegraphDocument);
- graph.claimLiteral(document, L0.HasName, "Documentation");
+ graph.claimLiteral(document, L0.HasName, "Documentation"); //$NON-NLS-1$
graph.claim(resource, DOC.HasDocumentation, document);
graph.claim(document, L0.PartOf, resource);
Resource scenegraph = graph.newResource();
graph.claim(scenegraph, L0.InstanceOf, null, documentType);
- graph.claimLiteral(scenegraph, L0.HasName, "Scenegraph");
+ graph.claimLiteral(scenegraph, L0.HasName, "Scenegraph"); //$NON-NLS-1$
graph.claim(scenegraph, L0.PartOf, document);
graph.claim(document, DOC.ScenegraphDocument_scenegraph, scenegraph);
Variable result = ScenegraphLoaderProcess.getVariable(graph, null, scenegraph, ScenegraphLoaderUtils.getRuntime(graph, context), root);
if(result != null) {
- Variable userDoc = result.getPossibleProperty(graph, "UserDocumentation");
+ Variable userDoc = result.getPossibleProperty(graph, "UserDocumentation"); //$NON-NLS-1$
if(userDoc != null) return userDoc;
}
@SCLValue(type = "ReadGraph -> Resource -> Variable -> a")
public static Object wikitextModifier(ReadGraph graph, final Resource resource, final Variable context) throws DatabaseException {
- final ScenegraphPropertyReference<String> textReference = ScenegraphLoaderUtils.getRelativePropertyReference(SWTThread.getThreadAccess(), graph, context, ".../TextContainer/Text#text");
+ final ScenegraphPropertyReference<String> textReference = ScenegraphLoaderUtils.getRelativePropertyReference(SWTThread.getThreadAccess(), graph, context, ".../TextContainer/Text#text"); //$NON-NLS-1$
return new FunctionImpl1<Object, Object>() {
@Override
public void perform(WriteGraph graph) throws DatabaseException {
- Variable selection = resolveEditSelection(graph, context, "..../Scroll/Browser#edited");
+ Variable selection = resolveEditSelection(graph, context, "..../Scroll/Browser#edited"); //$NON-NLS-1$
if (selection != null) {
selection.setValue(graph, (String)value, Bindings.STRING);
graph.markUndoPoint();
} else {
- LOGGER.error("No selection for resource : " + resource + ", Variable context : " + context + ", value : " + value);
+ LOGGER.error("No selection for resource : " + resource + ", Variable context : " + context + ", value : " + value); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
@SCLValue(type = "ReadGraph -> Resource -> Variable -> String")
public static String selectedDocumentPart(ReadGraph graph, Resource resource, Variable context) throws DatabaseException {
- Variable selection = resolveEditSelection(graph, context, ".../Scroll/Browser#edited");
+ Variable selection = resolveEditSelection(graph, context, ".../Scroll/Browser#edited"); //$NON-NLS-1$
if(selection == null) return null;
return selection.getValue(graph);
final ScenegraphPropertyReference<Point> selectionReference;
public WikiButtonModifier(ReadGraph graph, Variable context) throws DatabaseException {
- textReference = ScenegraphLoaderUtils.getRelativePropertyReference(SWTThread.getThreadAccess(), graph, context, ".../TextContainer/Text#text");
- selectionReference = ScenegraphLoaderUtils.getRelativePropertyReference(SWTThread.getThreadAccess(), graph, context, ".../TextContainer/Text#selection");
+ textReference = ScenegraphLoaderUtils.getRelativePropertyReference(SWTThread.getThreadAccess(), graph, context, ".../TextContainer/Text#text"); //$NON-NLS-1$
+ selectionReference = ScenegraphLoaderUtils.getRelativePropertyReference(SWTThread.getThreadAccess(), graph, context, ".../TextContainer/Text#selection"); //$NON-NLS-1$
}
abstract void perform(String before, String selected, String after, Point selection);
void perform(String before, String selected, String after, Point selection) {
if(selected.isEmpty()) {
- textReference.setValue(before + "'''bold text'''" + after);
+ textReference.setValue(before + "'''bold text'''" + after); //$NON-NLS-1$
} else {
- textReference.setValue(before + "'''" + selected + "'''" + after);
+ textReference.setValue(before + "'''" + selected + "'''" + after); //$NON-NLS-1$ //$NON-NLS-2$
}
}
void perform(String before, String selected, String after, Point selection) {
if(selected.isEmpty()) {
- textReference.setValue(before + "''italic text''" + after);
+ textReference.setValue(before + "''italic text''" + after); //$NON-NLS-1$
} else {
- textReference.setValue(before + "''" + selected + "''" + after);
+ textReference.setValue(before + "''" + selected + "''" + after); //$NON-NLS-1$ //$NON-NLS-2$
}
}
void perform(String before, String selected, String after, Point selection) {
if(selected.isEmpty()) {
- textReference.setValue(before + "<span style=\"text-decoration:line-through;\">strikethrough text</span>" + after);
+ textReference.setValue(before + "<span style=\"text-decoration:line-through;\">strikethrough text</span>" + after); //$NON-NLS-1$
} else {
- textReference.setValue(before + "<span style=\"text-decoration:line-through;\">" + selected + "</span>" + after);
+ textReference.setValue(before + "<span style=\"text-decoration:line-through;\">" + selected + "</span>" + after); //$NON-NLS-1$ //$NON-NLS-2$
}
}
void perform(String before, String selected, String after, Point selection) {
if(selected.isEmpty()) {
- textReference.setValue(before + "<span style=\"text-decoration:underline;\">strikethrough text</span>" + after);
+ textReference.setValue(before + "<span style=\"text-decoration:underline;\">strikethrough text</span>" + after); //$NON-NLS-1$
} else {
- textReference.setValue(before + "<span style=\"text-decoration:underline;\">" + selected + "</span>" + after);
+ textReference.setValue(before + "<span style=\"text-decoration:underline;\">" + selected + "</span>" + after); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@Override
void perform(String before, String selected, String after, Point selection) {
- textReference.setValue(before + "\r\n<hr/>\r\n" + selected + after);
+ textReference.setValue(before + "\r\n<hr/>\r\n" + selected + after); //$NON-NLS-1$
}
@Override
void perform(String before, String selected, String after, Point selection) {
- textReference.setValue(before + ":" + selected + after);
+ textReference.setValue(before + ":" + selected + after); //$NON-NLS-1$
}
private String hex2(int value) {
String result = Integer.toHexString(value);
- if(result.length() == 1) result = "0" + result;
+ if(result.length() == 1) result = "0" + result; //$NON-NLS-1$
return result;
}
String hex = hex2(rgb.red) + hex2(rgb.green) + hex2(rgb.blue);
if(selected.isEmpty()) {
- textReference.setValue(before + "<font style=\"font-size:" + size + ";color: #" + hex + ";font-family:" + family + ";\" >formatted text</font>" + selected + after);
+ textReference.setValue(before + "<font style=\"font-size:" + size + ";color: #" + hex + ";font-family:" + family + ";\" >formatted text</font>" + selected + after); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
} else {
- textReference.setValue(before + "<font style=\"font-size:" + size + ";color: #" + hex + ";font-family:" + family + ";\" >" + selected + "</font>" + after);
+ textReference.setValue(before + "<font style=\"font-size:" + size + ";color: #" + hex + ";font-family:" + family + ";\" >" + selected + "</font>" + after); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
}
}
@Override
void perform(String before, String selected, String after, Point selection) {
- textReference.setValue(before + "[[Image:root://Library/image.png|100px]]" + "\r\n" + selected + after);
+ textReference.setValue(before + "[[Image:root://Library/image.png|100px]]" + "\r\n" + selected + after); //$NON-NLS-1$ //$NON-NLS-2$
}
@Override
void perform(String before, String selected, String after, Point selection) {
- textReference.setValue(before + "\r\n= Header 1 =\r\n" + selected + after);
+ textReference.setValue(before + "\r\n= Header 1 =\r\n" + selected + after); //$NON-NLS-1$
}
@Override
void perform(String before, String selected, String after, Point selection) {
- textReference.setValue(before + "\r\n== Header 2 ==\r\n" + selected + after);
+ textReference.setValue(before + "\r\n== Header 2 ==\r\n" + selected + after); //$NON-NLS-1$
}
@Override
void perform(String before, String selected, String after, Point selection) {
- textReference.setValue(before + "\r\n=== Header 3 ===\r\n" + selected + after);
+ textReference.setValue(before + "\r\n=== Header 3 ===\r\n" + selected + after); //$NON-NLS-1$
}
@Override
void perform(String before, String selected, String after, Point selection) {
- textReference.setValue(before + "\r\n==== Header 4 ====\r\n" + selected + after);
+ textReference.setValue(before + "\r\n==== Header 4 ====\r\n" + selected + after); //$NON-NLS-1$
}
@Override
void perform(String before, String selected, String after, Point selection) {
- textReference.setValue(before + "\r\n" +
- "# Item1\r\n" +
- "# Item2\r\n" +
- "## Item2.1\r\n" +
- "# Item3\r\n" + selected + after);
+ textReference.setValue(before + "\r\n" + //$NON-NLS-1$
+ "# Item1\r\n" + //$NON-NLS-1$
+ "# Item2\r\n" + //$NON-NLS-1$
+ "## Item2.1\r\n" + //$NON-NLS-1$
+ "# Item3\r\n" + selected + after); //$NON-NLS-1$
}
@Override
void perform(String before, String selected, String after, Point selection) {
- textReference.setValue(before + "\r\n" +
- "* Item1\r\n" +
- "* Item2\r\n" +
- "** Item2.1\r\n" +
- "* Item3\r\n" + selected + after);
+ textReference.setValue(before + "\r\n" + //$NON-NLS-1$
+ "* Item1\r\n" + //$NON-NLS-1$
+ "* Item2\r\n" + //$NON-NLS-1$
+ "** Item2.1\r\n" + //$NON-NLS-1$
+ "* Item3\r\n" + selected + after); //$NON-NLS-1$
}
@Override
void perform(String before, String selected, String after, Point selection) {
- textReference.setValue(before + "\r\n" +
- "{| border=\"1\"\r\n" +
- "! header\r\n" +
- "! header2 \r\n" +
- "|-\r\n" +
- "| cell || cell2\r\n" +
- "|-\r\n" +
- "| cell3\r\n" +
- "| cell4\r\n" +
- "|}\r\n" + selected + after);
+ textReference.setValue(before + "\r\n" + //$NON-NLS-1$
+ "{| border=\"1\"\r\n" + //$NON-NLS-1$
+ "! header\r\n" + //$NON-NLS-1$
+ "! header2 \r\n" + //$NON-NLS-1$
+ "|-\r\n" + //$NON-NLS-1$
+ "| cell || cell2\r\n" + //$NON-NLS-1$
+ "|-\r\n" + //$NON-NLS-1$
+ "| cell3\r\n" + //$NON-NLS-1$
+ "| cell4\r\n" + //$NON-NLS-1$
+ "|}\r\n" + selected + after); //$NON-NLS-1$
}
@Override
void perform(String before, String selected, String after, Point selection) {
textReference.setValue(before +
- "[[Media:root://Documents/Document.pdf|Link to a file within the model]]\r\n" + selected + after);
+ "[[Media:root://Documents/Document.pdf|Link to a file within the model]]\r\n" + selected + after); //$NON-NLS-1$
}
};
void perform(String before, String selected, String after, Point selection) {
textReference.setValue(before +
- "[http://www.simantics.org External Website Link]\r\n" + selected + after);
+ "[http://www.simantics.org External Website Link]\r\n" + selected + after); //$NON-NLS-1$
}
try {
WorkbenchUtils.openEditor(editorId, new ResourceEditorInput2(editorId, root, root, rvi));
} catch (PartInitException e) {
- LOGGER.error("Failed to open CSS editor for root " + root, e);
+ LOGGER.error("Failed to open CSS editor for root " + root, e); //$NON-NLS-1$
}
});
public static String noDocumentText(ReadGraph graph, final Resource resource, final Variable context) throws DatabaseException {
Variable selection = ScenegraphLoaderUtils.getPossibleVariableSelection(graph, context);
- if(selection == null) return "<no input>";
+ if(selection == null) return "<no input>"; //$NON-NLS-1$
Resource input = selection.getRepresents(graph);
- if(input == null) return "<no input>";
+ if(input == null) return "<no input>"; //$NON-NLS-1$
String path = DocumentUtils.indexRootPath(graph, selection);
if(!path.isEmpty()) {
- return "for " + path + selection.getName(graph);
+ return "for " + path + selection.getName(graph); //$NON-NLS-1$
}
- return "for " + NameUtils.getSafeLabel(graph, input);
+ return "for " + NameUtils.getSafeLabel(graph, input); //$NON-NLS-1$
}
DefaultActions.asyncPerformDefaultAction(s, input, false, false, false);
}
} catch (DatabaseException | InterruptedException e) {
- Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Failed to resolve URI to a database resource or variable: " + uri, e));
+ Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Failed to resolve URI to a database resource or variable: " + uri, e)); //$NON-NLS-1$
}
}
return true;