use of org.eclipse.ui.internal.dialogs.PropertyDialog in project netxms by netxms.
the class ReportExecutionForm method addSchedule.
/**
* Add schedule
*/
protected void addSchedule() {
final Map<String, String> execParameters = new HashMap<String, String>();
if (parameters != null) {
for (int i = 0; i < parameters.size(); i++) execParameters.put(parameters.get(i).getName(), fields.get(i).getValue());
}
final ReportingJob job = new ReportingJob(report);
final PropertyDialog dialog = PropertyDialog.createDialogOn(workbenchPart.getSite().getShell(), General.ID, job);
dialog.getShell().setText("Report Execution Schedule");
if (dialog.open() != Window.OK)
return;
new ConsoleJob("Adding report schedule", workbenchPart, Activator.PLUGIN_ID, null) {
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
session.scheduleReport(job, execParameters);
}
@Override
protected String getErrorMessage() {
return String.format("Cannot schedule report %s", report.getName());
}
}.start();
}
use of org.eclipse.ui.internal.dialogs.PropertyDialog in project eclipse-integration-commons by spring-projects.
the class SpringUIUtils method openPreferenceNode.
private static boolean openPreferenceNode(final String propertyPageId, final IPreferenceNode targetNode, final String title, Object element, Map<String, Object> data) {
PreferenceManager manager = new PreferenceManager();
manager.addToRoot(targetNode);
final PropertyDialog dialog = new PropertyDialog(UiPlugin.getActiveWorkbenchShell(), manager, new StructuredSelection(element));
if (propertyPageId != null) {
dialog.setSelectedNode(propertyPageId);
}
if (data != null) {
dialog.setPageData(data);
}
final boolean[] result = new boolean[] { false };
BusyIndicator.showWhile(getStandardDisplay(), new Runnable() {
public void run() {
dialog.create();
dialog.setMessage(targetNode.getLabelText());
dialog.getShell().setText(title);
result[0] = (dialog.open() == Window.OK);
}
});
return result[0];
}
use of org.eclipse.ui.internal.dialogs.PropertyDialog in project netxms by netxms.
the class DashboardControl method addElement.
/**
* @param element
*/
private void addElement(DashboardElement element) {
DashboardElementConfig config = (DashboardElementConfig) AdapterManager.getDefault().getAdapter(element, DashboardElementConfig.class);
if (config != null) {
try {
config.setLayout(DashboardElementLayout.createFromXml(element.getLayout()));
PropertyDialog dlg = PropertyDialog.createDialogOn(getShell(), null, config);
if (dlg.open() == Window.CANCEL)
// element creation cancelled
return;
element.setData(config.createXml());
element.setLayout(config.getLayout().createXml());
elements.add(element);
createElementWidget(element);
redoLayout();
setModified();
} catch (Exception e) {
MessageDialogHelper.openError(getShell(), Messages.get().DashboardControl_InternalError, Messages.get().DashboardControl_InternalErrorPrefix + e.getMessage());
}
} else {
MessageDialogHelper.openError(getShell(), Messages.get().DashboardControl_InternalError, Messages.get().DashboardControl_InternalErrorText2);
}
}
use of org.eclipse.ui.internal.dialogs.PropertyDialog in project netxms by netxms.
the class DashboardControl method editElement.
/**
* Edit element
*
* @param element
*/
void editElement(DashboardElement element) {
DashboardElementConfig config = (DashboardElementConfig) AdapterManager.getDefault().getAdapter(element, DashboardElementConfig.class);
if (config != null) {
try {
config.setLayout(DashboardElementLayout.createFromXml(element.getLayout()));
PropertyDialog dlg = PropertyDialog.createDialogOn(getShell(), null, config);
if (dlg.open() == Window.CANCEL)
// element creation cancelled
return;
element.setData(config.createXml());
element.setLayout(config.getLayout().createXml());
recreateElement(element);
redoLayout();
setModified();
} catch (Exception e) {
MessageDialogHelper.openError(getShell(), Messages.get().DashboardControl_InternalError, Messages.get().DashboardControl_InternalErrorPrefix + e.getMessage());
}
} else {
MessageDialogHelper.openError(getShell(), Messages.get().DashboardControl_InternalError, Messages.get().DashboardControl_InternalErrorText1);
}
}
use of org.eclipse.ui.internal.dialogs.PropertyDialog in project netxms by netxms.
the class AlarmCategoryList method createCategory.
/**
* Create new category
*/
public void createCategory() {
AlarmCategoryEditor editor = new AlarmCategoryEditor(new AlarmCategory());
PropertyDialog dlg = PropertyDialog.createDialogOn(getShell(), null, editor);
dlg.open();
}
Aggregations