Search in sources :

Example 1 with MappingTable

use of org.netxms.client.mt.MappingTable in project netxms by netxms.

the class MappingTableEditor method refresh.

/**
 * Refresh content
 */
private void refresh() {
    new ConsoleJob(Messages.get().MappingTableEditor_LoadJobName, this, Activator.PLUGIN_ID, null) {

        @Override
        protected void runInternal(IProgressMonitor monitor) throws Exception {
            final MappingTable t = session.getMappingTable(mappingTableId);
            runInUIThread(new Runnable() {

                @Override
                public void run() {
                    mappingTable = t;
                    setPartName(String.format(Messages.get().MappingTableEditor_PartName, mappingTable.getName()));
                    viewer.setInput(mappingTable.getData().toArray());
                    actionNewRow.setEnabled(true);
                    setModified(false);
                }
            });
        }

        @Override
        protected String getErrorMessage() {
            return Messages.get().MappingTableEditor_LoadJobError;
        }
    }.start();
}
Also used : MappingTable(org.netxms.client.mt.MappingTable) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) ConsoleJob(org.netxms.ui.eclipse.jobs.ConsoleJob) PartInitException(org.eclipse.ui.PartInitException)

Example 2 with MappingTable

use of org.netxms.client.mt.MappingTable in project netxms by netxms.

the class NXCSession method createMappingTable.

/**
 * Create new mapping table.
 *
 * @param name name of new table
 * @param description description for new table
 * @param flags flags for new table
 * @return ID of new table object
 * @throws IOException if socket I/O error occurs
 * @throws NXCException if NetXMS server returns an error or operation was timed out
 */
public int createMappingTable(String name, String description, int flags) throws IOException, NXCException {
    MappingTable mt = new MappingTable(name, description);
    mt.setFlags(flags);
    return updateMappingTable(mt);
}
Also used : MappingTable(org.netxms.client.mt.MappingTable)

Example 3 with MappingTable

use of org.netxms.client.mt.MappingTable in project netxms by netxms.

the class NXCSession method getMappingTable.

/**
 * Get list of specific mapping table
 *
 * @param id The ID of mapping table
 * @return The MappingTable
 * @throws IOException if socket I/O error occurs
 * @throws NXCException if NetXMS server returns an error or operation was timed out
 */
public MappingTable getMappingTable(int id) throws IOException, NXCException {
    final NXCPMessage msg = newMessage(NXCPCodes.CMD_GET_MAPPING_TABLE);
    msg.setFieldInt32(NXCPCodes.VID_MAPPING_TABLE_ID, id);
    sendMessage(msg);
    return new MappingTable(waitForRCC(msg.getMessageId()));
}
Also used : MappingTable(org.netxms.client.mt.MappingTable) NXCPMessage(org.netxms.base.NXCPMessage)

Aggregations

MappingTable (org.netxms.client.mt.MappingTable)3 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 PartInitException (org.eclipse.ui.PartInitException)1 NXCPMessage (org.netxms.base.NXCPMessage)1 ConsoleJob (org.netxms.ui.eclipse.jobs.ConsoleJob)1