DocumentResource doc = DocumentResource.getInstance(graph);
if (!graph.isInstanceOf(resource, doc.Document))
return;
- result.add(new ComparableTabContributor(new DocumentPropertyTabContributor(), 1, resource, "Document"));
+ result.add(new ComparableTabContributor(new DocumentPropertyTabContributor(), 1, resource, Messages.DocumentTabContribution_Document));
}
private class DocumentPropertyTabContributor extends PropertyTabContributorImpl {
GridLayoutFactory.fillDefaults().margins(3,3).spacing(1, 1).numColumns(4).applyTo(composite);
Label label = new Label(composite, SWT.NONE);
- label.setText("Name");
+ label.setText(Messages.DocumentTabContribution_Name);
TrackedText name = new TrackedText(composite, support, SWT.BORDER);
name.setTextFactory(new StringPropertyFactory(Layer0.URIs.HasName));
support.register(validator);
Button showButton = new Button(composite, SWT.PUSH);
- showButton.setText("Show");
+ showButton.setText(Messages.DocumentTabContribution_Show);
showButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
DocumentResource doc;
try {
doc = DocumentResource.getInstance(context.getSession());
- new DocumentRevisionWidget(composite, support, doc.HasOlderVersion, "Old");
- new DocumentRevisionWidget(composite, support, doc.HasNewerVersion, "New");
+ new DocumentRevisionWidget(composite, support, doc.HasOlderVersion, Messages.DocumentTabContribution_Old);
+ new DocumentRevisionWidget(composite, support, doc.HasNewerVersion, Messages.DocumentTabContribution_New);
} catch (DatabaseException e1) {
- ExceptionUtils.logAndShowError("Cannot create documen version UI", e1);
+ ExceptionUtils.logAndShowError(Messages.DocumentTabContribution_CannotCreateDocumentVersionUI, e1);
}
public String perform(ReadGraph graph) throws DatabaseException {
Resource res = AdaptionUtils.adaptToSingle(forSelection, Resource.class);
if (res == null)
- return "N/A";
+ return Messages.DocumentTabContribution_6;
Layer0 l0 = Layer0.getInstance(graph);
return graph.getPossibleRelatedValue(res, l0.HasName);
}
try {
adapter.openEditor(resource);
} catch (Exception e) {
- ExceptionUtils.logAndShowError("Cannot open editor", e);
+ ExceptionUtils.logAndShowError(Messages.DocumentTabContribution_7, e);
}
}
});
label.setText(name);
text = new Text(parent, SWT.SINGLE|SWT.BORDER|SWT.READ_ONLY);
showButton = new Button(parent, SWT.PUSH);
- showButton.setText("Show");
+ showButton.setText(Messages.DocumentTabContribution_8);
showButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
}
});
removeButton = new Button(parent, SWT.PUSH);
- removeButton.setText("Unset");
+ removeButton.setText(Messages.DocumentTabContribution_9);
removeButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
});
revisionDoc = null;
} catch (DatabaseException e1) {
- ExceptionUtils.logAndShowError("Cannot remove document revision", e1);
+ ExceptionUtils.logAndShowError(Messages.DocumentTabContribution_10, e1);
}
updateUI();
}
@Override
public void exception(AsyncReadGraph graph, Throwable t) {
- ExceptionUtils.logAndShowError("Cannot show document revision", t);
+ ExceptionUtils.logAndShowError(Messages.DocumentTabContribution_11, t);
}
@Override
if (revisionDoc != null)
text.setText(revisionDoc.getName());
else
- text.setText("");
+ text.setText(""); //$NON-NLS-1$
}
private void setRevisionDoc(final Resource toSet) {