use of org.eclipse.jface.preference.IPreferenceNode 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;
}
if (item instanceof MenuManager) {
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.IPreferenceNode in project tdi-studio-se by Talend.
the class ProjectSettingsPreferenceDialog method removeChildrenPreferenceNodes.
@Override
public boolean removeChildrenPreferenceNodes(String parentId, List<String> childrenIds) {
IPreferenceNode findNodeMatching = findNodeMatching(parentId);
if (findNodeMatching != null && childrenIds != null) {
// remove existed nodes.
List<IPreferenceNode> recordRemovedNodes = new ArrayList<IPreferenceNode>();
boolean nonExisted = false;
for (String childId : childrenIds) {
IPreferenceNode removedNode = findNodeMatching.remove(childId);
if (removedNode != null) {
recordRemovedNodes.add(removedNode);
} else {
nonExisted = true;
break;
}
}
// add back the delete nodes
if (nonExisted) {
for (IPreferenceNode node : recordRemovedNodes) {
findNodeMatching.add(node);
}
return false;
} else {
this.getTreeViewer().refresh();
return true;
}
}
return false;
}
use of org.eclipse.jface.preference.IPreferenceNode in project tdi-studio-se by Talend.
the class StandaloneJobRepositoryMavenSetting method createStandaloneJobChildrenNodes.
public static List<IPreferenceNode> createStandaloneJobChildrenNodes(IFolder nodeFolder, RepositoryNode node, String parentId, boolean checkExist) {
List<IPreferenceNode> childrenNodes = new ArrayList<IPreferenceNode>();
// if have existed the pom and assembly
if (!checkExist || DesignerMavenUiHelper.existMavenSetting(nodeFolder, TalendMavenConstants.POM_FILE_NAME, TalendMavenConstants.ASSEMBLY_FILE_NAME)) {
IFile pomTemplateFile = nodeFolder.getFile(TalendMavenConstants.POM_FILE_NAME);
IFile assemblyTemplateFile = nodeFolder.getFile(TalendMavenConstants.ASSEMBLY_FILE_NAME);
String pomId = DesignerMavenUiHelper.buildRepositoryPreferenceNodeId(parentId, pomTemplateFile);
String assemblyId = DesignerMavenUiHelper.buildRepositoryPreferenceNodeId(parentId, assemblyTemplateFile);
StandaloneJobPomRepositorySettingNode pomNode = new StandaloneJobPomRepositorySettingNode(pomId, pomTemplateFile);
StandaloneJobAssemblyRepositorySettingNode assemblyNode = new StandaloneJobAssemblyRepositorySettingNode(assemblyId, assemblyTemplateFile);
childrenNodes.add(pomNode);
childrenNodes.add(assemblyNode);
}
return childrenNodes;
}
Aggregations