public class DesktopProjectFeature extends AbstractProjectFeature {
- private static final String DEFAULT_PERSPECTIVE = "org.simantics.desktop.modelling.perspective";
+ private static final String DEFAULT_PERSPECTIVE = "org.simantics.desktop.modelling.perspective"; //$NON-NLS-1$
@Override
public void configure() throws ProjectException {
context.setHint(SelectionHints.KEY_MAIN, lib);
IStructuredSelection sel = new StructuredSelection(context);
- ModelingUtils.openWizard(Display.getCurrent(), sel, "org.simantics.modeling.ui.modelExportWizard");
+ ModelingUtils.openWizard(Display.getCurrent(), sel, "org.simantics.modeling.ui.modelExportWizard"); //$NON-NLS-1$
} catch (DatabaseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@Override
public Resource perform(ReadGraph graph) throws DatabaseException {
- List<Resource> ontologies = Simantics.applySCL("Simantics/SharedOntologies", "getSharedOntologies", graph, Tuple0.INSTANCE);
+ List<Resource> ontologies = Simantics.applySCL("Simantics/SharedOntologies", "getSharedOntologies", graph, Tuple0.INSTANCE); //$NON-NLS-1$ //$NON-NLS-2$
if(ontologies.size() == 1) return ontologies.iterator().next();
return null;
}
context.setHint(SelectionHints.KEY_MAIN, lib);
IStructuredSelection sel = new StructuredSelection(context);
- ModelingUtils.openWizard(Display.getCurrent(), sel, "org.simantics.modeling.ui.sharedOntologyExportWizard");
+ ModelingUtils.openWizard(Display.getCurrent(), sel, "org.simantics.modeling.ui.sharedOntologyExportWizard"); //$NON-NLS-1$
} catch (DatabaseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
// Get imported transferable graph file using FileDialog
Shell shell = HandlerUtil.getActiveShellChecked(event);
FileDialog fd = new FileDialog(shell, SWT.OPEN);
- fd.setText("Import Model");
+ fd.setText(Messages.ImportModel_ImportModel);
- String path = Activator.getDefault().getPreferenceStore().getString("IMPORT_MODEL_PATH");
+ String path = Activator.getDefault().getPreferenceStore().getString("IMPORT_MODEL_PATH"); //$NON-NLS-1$
if(path.isEmpty() || !(new File(path).exists())){
- path = System.getProperty("user.dir");
+ path = System.getProperty("user.dir"); //$NON-NLS-1$
}
fd.setFilterPath(path);
- String[] filterExt = {"*.tg", "*.*"};
+ String[] filterExt = {"*.tg", "*.*"}; //$NON-NLS-1$ //$NON-NLS-2$
fd.setFilterExtensions(filterExt);
final String selected = fd.open();
if(selected == null) return null;
- Job job = new DatabaseJob("Import model") {
+ Job job = new DatabaseJob(Messages.ImportModel_DatabaseImportModel) {
@Override
protected IStatus run(IProgressMonitor monitor) {
public Object execute(ExecutionEvent event) throws ExecutionException {
IStructuredSelection sel = new StructuredSelection();
- ModelingUtils.openWizard(Display.getCurrent(), sel, "org.simantics.modeling.ui.sharedOntologyImportWizard");
+ ModelingUtils.openWizard(Display.getCurrent(), sel, "org.simantics.modeling.ui.sharedOntologyImportWizard"); //$NON-NLS-1$
return null;
}
--- /dev/null
+package org.simantics.desktop.ui.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.simantics.desktop.ui.internal.messages"; //$NON-NLS-1$
+ public static String ImportModel_DatabaseImportModel;
+ public static String ImportModel_ImportModel;
+ public static String NewModel_0_Failed;
+ public static String NewModel_Book1;
+ public static String NewModel_Library;
+ public static String NewModel_NewModel;
+ public static String NewModel_Sheet1;
+ public static String NewModel_Sheet2;
+ public static String NewModel_Sheet3;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osgi.util.NLS;
import org.simantics.DatabaseJob;
import org.simantics.Simantics;
import org.simantics.db.Resource;
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
- Job job = new DatabaseJob("Creating Model") {
+ Job job = new DatabaseJob(Messages.NewModel_NewModel) {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
});
return Status.OK_STATUS;
} catch (DatabaseException e) {
- return new Status(IStatus.ERROR, Activator.PLUGIN_ID, getName() + " failed.", e);
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, NLS.bind(Messages.NewModel_0_Failed, getName()), e);
}
}
};
Resource model = ModelingUtils.createModel(graph, type, name);
Resource conf = graph.syncRequest(new Configuration(model));
- ModelingUtils.addSCLMainToModel(graph, model, "SCLMain", "");
- ModelingUtils.createLocalLibrary(graph, model, "Library");
+ ModelingUtils.addSCLMainToModel(graph, model, "SCLMain", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ ModelingUtils.createLocalLibrary(graph, model, Messages.NewModel_Library);
- Resource book = SpreadsheetGraphUtils.createBook(graph, conf, "Book1");
- SpreadsheetUtils.createSheet(graph, book, "Sheet1", new String[] { }, new int[] { 50 });
- SpreadsheetUtils.createSheet(graph, book, "Sheet2", new String[] { }, new int[] { 50 });
- SpreadsheetUtils.createSheet(graph, book, "Sheet3", new String[] { }, new int[] { 50 });
+ Resource book = SpreadsheetGraphUtils.createBook(graph, conf, Messages.NewModel_Book1);
+ SpreadsheetUtils.createSheet(graph, book, Messages.NewModel_Sheet1, new String[] { }, new int[] { 50 });
+ SpreadsheetUtils.createSheet(graph, book, Messages.NewModel_Sheet2, new String[] { }, new int[] { 50 });
+ SpreadsheetUtils.createSheet(graph, book, Messages.NewModel_Sheet3, new String[] { }, new int[] { 50 });
return model;
}
--- /dev/null
+ImportModel_DatabaseImportModel=Import model\r
+ImportModel_ImportModel=Import Model\r
+NewModel_0_Failed={0} failed.\r
+NewModel_Book1=Book1\r
+NewModel_Library=Library\r
+NewModel_NewModel=Creating Model\r
+NewModel_Sheet1=Sheet1\r
+NewModel_Sheet2=Sheet2\r
+NewModel_Sheet3=Sheet3\r
## Strings externalized from bundles ##
* [x] org.simantics.scl.ui
+* [x] org.simantics.db.procore.ui
+* [x] org.simantics.debug.ui
+* [x] org.simantics.desktop.ui
+* ...
+
## TODO ##
* /org.simantics.browsing.ui
* /org.simantics.browsing.ui.common (All can be ignored)
-* /org.simantics.browsing.ui.feature (Nothing to Exeternalize or all can be ignored)
* /org.simantics.browsing.ui.graph (Nothing to Exeternalize or all can be ignored)
* /org.simantics.browsing.ui.graph (Nothing to Exeternalize or all can be ignored)
* /org.simantics.browsing.ui.graph.impl (Nothing to Exeternalize or all can be ignored)
* /org.simantics.browsing.ui.model
* /org.simantics.browsing.ui.nattable
-* /org.simantics.browsing.ui.nattable.feature (Nothing to Exeternalize)
* /org.simantics.browsing.ui.ontology (Nothing to Exeternalize or all can be ignored)
* /org.simantics.browsing.ui.platform (Nothing to Exeternalize or all can be ignored)
* /org.simantics.browsing.ui.swt (Nothing to Exeternalize or all can be ignored)
* /org.simantics.debug.browser.ui (Nothing to Exeternalize or all can be ignored)
-* /org.simantics.db.procore.ui
-* /org.simantics.debug.ui
-* /org.simantics.desktop.ui
* /org.simantics.desktop.ui.ontology
* /org.simantics.document.ui
* /org.simantics.document.ui.ontology
* /org.simantics.help.ui
* /org.simantics.image.ui
* /org.simantics.issues.ui
-* /org.simantics.issues.ui.feature
* /org.simantics.issues.ui.ontology
* /org.simantics.logging.ui
* /org.simantics.message.ui
* /org.simantics.migration.ui
* /org.simantics.modeling.ui
* /org.simantics.modeling.ui.workbench
-* /org.simantics.modeling.ui.workbench.feature
-* /org.simantics.platform.ui.feature
* /org.simantics.platform.ui.ontology
* /org.simantics.scenegraph.ui
* /org.simantics.simulation.ui
* /org.simantics.spreadsheet.ui
-* /org.simantics.spreadsheet.ui.feature
* /org.simantics.structural.ui
* /org.simantics.team.ui
* /org.simantics.tests.modelled.ui
-* /org.simantics.tests.modelled.ui.feature
* /org.simantics.tests.modelled.ui.ontology
* /org.simantics.ui
-* /org.simantics.ui.workbench.feature
* /org.simantics.ui.workspace.tracker
* /org.simantics.utils.ui
-* /org.simantics.utils.ui.feature
* /org.simantics.wiki.ui
-* /org.simantics.wiki.ui.feature
+
*
*
* ...