use of org.eclipse.ui.dialogs.PropertyDialogAction in project erlide_eclipse by erlang.
the class ErlangBreakpointPropertiesRulerAction method run.
/**
* @see Action#run()
*/
@Override
public void run() {
if (getBreakpoint() != null) {
final PropertyDialogAction action = new PropertyDialogAction(getEditor().getEditorSite(), new ISelectionProvider() {
@Override
public void addSelectionChangedListener(final ISelectionChangedListener listener) {
}
@Override
@SuppressWarnings("synthetic-access")
public ISelection getSelection() {
return new StructuredSelection(getBreakpoint());
}
@Override
public void removeSelectionChangedListener(final ISelectionChangedListener listener) {
}
@Override
public void setSelection(final ISelection selection) {
}
});
action.run();
}
}
use of org.eclipse.ui.dialogs.PropertyDialogAction in project webtools.sourceediting by eclipse.
the class EditBreakpointAction method run.
public void run() {
PropertyDialogAction action = new PropertyDialogAction(getTextEditor().getEditorSite(), new ISelectionProvider() {
public void addSelectionChangedListener(ISelectionChangedListener listener) {
// do nothing
}
public ISelection getSelection() {
return new StructuredSelection(breakpoints);
}
public void removeSelectionChangedListener(ISelectionChangedListener listener) {
// do nothing
}
public void setSelection(ISelection selection) {
// do nothing
}
});
action.run();
}
use of org.eclipse.ui.dialogs.PropertyDialogAction in project netxms by netxms.
the class UserManagementView method makeActions.
/**
* Create actions
*/
private void makeActions() {
actionRefresh = new RefreshAction(this) {
@Override
public void run() {
viewer.setInput(session.getUserDatabaseObjects());
}
};
actionAddUser = new // $NON-NLS-1$
Action(// $NON-NLS-1$
Messages.get().UserManagementView_CreateNewUser, // $NON-NLS-1$
Activator.getImageDescriptor("icons/user_add.png")) {
@Override
public void run() {
addUser();
}
};
actionAddGroup = new // $NON-NLS-1$
Action(// $NON-NLS-1$
Messages.get().UserManagementView_CreateNewGroup, // $NON-NLS-1$
Activator.getImageDescriptor("icons/group_add.png")) {
@Override
public void run() {
addGroup();
}
};
actionEditUser = new PropertyDialogAction(getSite(), viewer);
actionEditUser.setText(Messages.get().UserManagementView_Properties);
actionEditUser.setImageDescriptor(SharedIcons.EDIT);
actionEditUser.setEnabled(false);
actionDeleteUser = new Action(Messages.get().UserManagementView_Delete, SharedIcons.DELETE_OBJECT) {
@Override
public void run() {
deleteUser();
}
};
actionDeleteUser.setEnabled(false);
actionChangePassword = new // $NON-NLS-1$
Action(// $NON-NLS-1$
Messages.get().UserManagementView_ChangePassword, // $NON-NLS-1$
Activator.getImageDescriptor("icons/change_password.png")) {
@Override
public void run() {
changePassword();
}
};
actionChangePassword.setEnabled(false);
actionEnable = new Action(Messages.get().UserManagementView_Enable) {
@Override
public void run() {
enableUser();
}
};
actionDisable = new Action(Messages.get().UserManagementView_Disable) {
@Override
public void run() {
disableUser();
}
};
actionDetachUserFromLDAP = new Action(Messages.get().UserManagementView_DetachFromLDAP) {
@Override
public void run() {
detachLDAPUser();
}
};
}
use of org.eclipse.ui.dialogs.PropertyDialogAction in project netxms by netxms.
the class ObjectToolsEditor method createActions.
/**
* Create actions
*/
private void createActions() {
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
actionShowFilter = new Action("Show filter", Action.AS_CHECK_BOX) {
@Override
public void run() {
enableFilter(!initShowFilter);
actionShowFilter.setChecked(initShowFilter);
}
};
actionShowFilter.setChecked(initShowFilter);
// $NON-NLS-1$
actionShowFilter.setActionDefinitionId("org.netxms.ui.eclipse.objecttools.commands.showFilter");
handlerService.activateHandler(actionShowFilter.getActionDefinitionId(), new ActionHandler(actionShowFilter));
actionRefresh = new RefreshAction() {
@Override
public void run() {
refreshToolList();
}
};
actionNew = new Action(Messages.get().ObjectToolsEditor_New) {
@Override
public void run() {
createTool();
}
};
actionNew.setImageDescriptor(SharedIcons.ADD_OBJECT);
actionEdit = new PropertyDialogAction(getSite(), viewer) {
@Override
public void run() {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
if (selection.size() != 1)
return;
final long toolId = ((ObjectTool) selection.getFirstElement()).getId();
// If there will be error, adapter factory will show error message to user
if (Platform.getAdapterManager().getAdapter(selection.getFirstElement(), ObjectToolDetails.class) == null)
return;
super.run();
ObjectToolDetails details = ObjectToolsAdapterFactory.getDetailsFromCache(toolId);
if ((details != null) && details.isModified()) {
saveObjectTool(details);
}
}
};
actionEdit.setImageDescriptor(SharedIcons.EDIT);
actionDelete = new Action(Messages.get().ObjectToolsEditor_Delete) {
@Override
public void run() {
deleteTools();
}
};
actionDelete.setImageDescriptor(SharedIcons.DELETE_OBJECT);
actionDisable = new Action(Messages.get().ObjectToolsEditor_Disable) {
@Override
public void run() {
setSelectedDisabled();
}
};
actionEnable = new Action(Messages.get().ObjectToolsEditor_Enable) {
@Override
public void run() {
setSelectedEnabled();
}
};
actionClone = new Action(Messages.get().ObjectToolsEditor_Clone) {
@Override
public void run() {
cloneTool();
}
};
}
Aggregations