use of org.netxms.ui.eclipse.serverconfig.dialogs.CreateMappingTableDialog in project netxms by netxms.
the class MappingTables method createNewTable.
/**
* Create new table
*/
private void createNewTable() {
final CreateMappingTableDialog dlg = new CreateMappingTableDialog(getSite().getShell());
if (dlg.open() != Window.OK)
return;
new ConsoleJob(Messages.get().MappingTables_CreateJobName, this, Activator.PLUGIN_ID, null) {
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
final Integer assignedId = session.createMappingTable(dlg.getName(), dlg.getDescription(), 0);
runInUIThread(new Runnable() {
@Override
public void run() {
// descriptor may already be presented if creation notification
// was already processed
MappingTableDescriptor d = mappingTables.get(assignedId);
if (d == null) {
d = new MappingTableDescriptor(assignedId, dlg.getName(), dlg.getDescription(), 0);
mappingTables.put(assignedId, d);
}
viewer.setInput(mappingTables.values().toArray());
viewer.setSelection(new StructuredSelection(d));
editTable();
}
});
}
@Override
protected String getErrorMessage() {
// TODO Auto-generated method stub
return null;
}
}.start();
}
Aggregations