use of org.eclipse.jface.preference.PreferenceManager in project cubrid-manager by CUBRID.
the class PreferenceUtil method createPropertyDialog.
/**
*
* Create property dialog related with CUBRID node
*
* @param parentShell the parent shell
* @param node the ICubridNode object
* @return the Dialog object
*/
public static Dialog createPropertyDialog(Shell parentShell, ICubridNode node) {
PreferenceManager mgr = new PreferenceManager();
String type = node.getType();
if (NodeType.DATABASE.equals(type)) {
CubridServer server = node.getServer();
QueryOptionPreferencePage queryEditorPage = new QueryOptionPreferencePage(server);
PreferenceNode queryEditorNode = new PreferenceNode(com.cubrid.common.ui.query.Messages.queryTitle);
queryEditorNode.setPage(queryEditorPage);
mgr.addToRoot(queryEditorNode);
}
CMPreferenceDialog dlg = new CMPreferenceDialog(parentShell, mgr, Messages.titlePropertiesDialog);
dlg.setPreferenceStore(CubridQueryUIPlugin.getDefault().getPreferenceStore());
return dlg;
}
use of org.eclipse.jface.preference.PreferenceManager in project cubrid-manager by CUBRID.
the class ApplicationWorkbenchWindowAdvisor method removePlatformDependencyActions.
private void removePlatformDependencyActions() {
// remove some menu items
IMenuManager mm = getWindowConfigurer().getActionBarConfigurer().getMenuManager();
for (IContributionItem item : mm.getItems()) {
if (item == null) {
continue;
}
MenuManager sm = (MenuManager) item;
for (IContributionItem sitem : sm.getItems()) {
if (sitem == null || sitem.getId() == null) {
continue;
}
if (sitem.getId().equals("org.eclipse.ui.actions.showKeyAssistHandler") || sitem.getId().equals("com.cubrid.common.update.p2.menu.install") || sitem.getId().equals("converstLineDelimitersTo") || sitem.getId().equals("save.ext") || sitem.getId().equals("org.eclipse.ui.openLocalFile") || sitem.getId().equals("new.ext")) {
sm.remove(sitem.getId());
sm.update(true);
mm.update(true);
}
}
}
// remove some tool bar items
ICoolBarManager cm = getWindowConfigurer().getActionBarConfigurer().getCoolBarManager();
for (IContributionItem item : cm.getItems()) {
if (item == null || item.getId() == null) {
continue;
}
if (item.getId().equals("org.eclipse.ui.edit.text.actionSet.annotationNavigation") || item.getId().equals("org.eclipse.ui.edit.text.actionSet.navigation")) {
cm.remove(item.getId());
cm.update(true);
}
}
// remove some preference items
PreferenceManager pm = getWindowConfigurer().getWindow().getWorkbench().getPreferenceManager();
for (IPreferenceNode item : pm.getRootSubNodes()) {
if (item.getId().equals("org.eclipse.help.ui.browsersPreferencePage") || item.getId().equals("org.eclipse.ui.preferencePages.Workbench")) {
pm.remove(item.getId());
}
}
}
use of org.eclipse.jface.preference.PreferenceManager in project tdi-studio-se by Talend.
the class ProjectSettingDialog method open.
public void open(final String pageId) {
PreferenceManager manager = getNodeManager();
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
final PreferenceDialog dialog = new ProjectSettingsPreferenceDialog(shell, manager);
BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
@Override
public void run() {
if (StringUtils.isNotEmpty(pageId)) {
dialog.setSelectedNode(pageId);
}
dialog.create();
dialog.getShell().setText(TITLE);
dialog.getShell().setSize(DEFAULT_SIZE);
dialog.open();
}
});
}
Aggregations