@Override public IWorkbenchPage openPage(IAdaptable input) throws WorkbenchException { return openPage(workbench.getPerspectiveRegistry().getDefaultPerspective(), input); }
public IPerspectiveDescriptor getPerspectiveDesc(String id) { IPerspectiveRegistry perspectiveRegistry = PlatformUI.getWorkbench().getPerspectiveRegistry(); // registry may be null on shutdown if (perspectiveRegistry == null) { return null; } IPerspectiveDescriptor desc = perspectiveRegistry .findPerspectiveWithId(id); return desc; }
@Override public Object[] getElements(Object inputElement) { return PlatformUI.getWorkbench().getPerspectiveRegistry().getPerspectives(); }
/** * Constructs a new instance of <code>PerspectiveMenu</code>. * * @param window the window containing this menu * @param id the menu id */ public PerspectiveMenu(IWorkbenchWindow window, String id) { super(id); this.window = window; reg = window.getWorkbench().getPerspectiveRegistry(); openOtherAction .setActionDefinitionId(IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE); }
@Override public Map getParameterValues() { final Map values = new HashMap(); final IPerspectiveDescriptor[] perspectives = PlatformUI.getWorkbench() .getPerspectiveRegistry().getPerspectives(); for (final IPerspectiveDescriptor perspective : perspectives) { values.put(perspective.getLabel(), perspective.getId()); } return values; } }
private IPerspectiveDescriptor getDescriptorFor(String id) { IPerspectiveRegistry perspectiveRegistry = PlatformUI.getWorkbench() .getPerspectiveRegistry(); if (perspectiveRegistry instanceof PerspectiveRegistry) { return ((PerspectiveRegistry) perspectiveRegistry).findPerspectiveWithId(id, false); } return perspectiveRegistry.findPerspectiveWithId(id); }
/** * Returns the label of the perspective with the given identifier or * <code>null</code> if no such perspective exists. * * @param perspectiveId the identifier * @return the label of the perspective with the given identifier or * <code>null</code> if no such perspective exists */ protected String getPerspectiveDescription(String perspectiveId) { IPerspectiveDescriptor newPerspective = PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(perspectiveId); if (newPerspective == null) { return null; } return newPerspective.getDescription(); }
/** * Returns the label of the perspective with the given identifier or * <code>null</code> if no such perspective exists. * * @param perspectiveId the identifier * @return the label of the perspective with the given identifier or * <code>null</code> if no such perspective exists */ protected String getPerspectiveLabel(String perspectiveId) { IPerspectiveDescriptor newPerspective = PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(perspectiveId); if (newPerspective == null) { return null; } return newPerspective.getLabel(); }
private String[][] getPerspectiveNamesAndIds() { IPerspectiveRegistry registry= PlatformUI.getWorkbench().getPerspectiveRegistry(); IPerspectiveDescriptor[] perspectiveDescriptors= registry.getPerspectives(); Arrays.sort(perspectiveDescriptors, new PerspectiveDescriptorComparator()); String[][] table = new String[perspectiveDescriptors.length + 1][2]; table[0][0] = SearchMessages.SearchPreferencePage_defaultPerspective_none; table[0][1] = NO_DEFAULT_PERSPECTIVE; for (int i = 0; i < perspectiveDescriptors.length; i++) { table[i + 1][0] = perspectiveDescriptors[i].getLabel(); table[i + 1][1] = perspectiveDescriptors[i].getId(); } return table; }
public static String getDefaultPerspectiveId() { handleDeletedPerspectives(); IPreferenceStore store= SearchPlugin.getDefault().getPreferenceStore(); String id= store.getString(DEFAULT_PERSPECTIVE); if (id == null || id.length() == 0 || id.equals(NO_DEFAULT_PERSPECTIVE)) return null; else if (PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(id) == null) { store.putValue(DEFAULT_PERSPECTIVE, id); return null; } return id; }
public static String getDefaultPerspectiveId() { handleDeletedPerspectives(); IPreferenceStore store= SearchPlugin.getDefault().getPreferenceStore(); String id= store.getString(DEFAULT_PERSPECTIVE); if (id == null || id.length() == 0 || id.equals(NO_DEFAULT_PERSPECTIVE)) return null; else if (PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(id) == null) { store.putValue(DEFAULT_PERSPECTIVE, id); return null; } return id; }
private String[][] getPerspectiveNamesAndIds() { IPerspectiveRegistry registry= PlatformUI.getWorkbench().getPerspectiveRegistry(); IPerspectiveDescriptor[] perspectiveDescriptors= registry.getPerspectives(); Arrays.sort(perspectiveDescriptors, new PerspectiveDescriptorComparator()); String[][] table = new String[perspectiveDescriptors.length + 1][2]; table[0][0] = SearchMessages.SearchPreferencePage_defaultPerspective_none; table[0][1] = NO_DEFAULT_PERSPECTIVE; for (int i = 0; i < perspectiveDescriptors.length; i++) { table[i + 1][0] = perspectiveDescriptors[i].getLabel(); table[i + 1][1] = perspectiveDescriptors[i].getId(); } return table; }
private IPerspectiveDescriptor getDescriptorFor(String id) { IPerspectiveRegistry perspectiveRegistry = getWorkbenchWindow().getWorkbench().getPerspectiveRegistry(); if (perspectiveRegistry instanceof PerspectiveRegistry) { return ((PerspectiveRegistry) perspectiveRegistry).findPerspectiveWithId(id, false); } return perspectiveRegistry.findPerspectiveWithId(id); }
private void checkPerspectives(Set<String> perspectives) { fPerspectiveViewer.setAllChecked(false); IPerspectiveRegistry registry= PlatformUI.getWorkbench().getPerspectiveRegistry(); for (String id : perspectives) { IPerspectiveDescriptor descriptor = registry.findPerspectiveWithId(id); if (descriptor != null) { fPerspectiveViewer.setChecked(descriptor, true); } } }
/** * @see IWorkbenchPreferencePage */ @Override public void init(IWorkbench aWorkbench) { this.workbench = aWorkbench; this.perspectiveRegistry = (PerspectiveRegistry) workbench .getPerspectiveRegistry(); IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); setPreferenceStore(store); openPerspMode = store.getInt(IPreferenceConstants.OPEN_PERSP_MODE); }
private static void handleDeletedPerspectives() { IPreferenceStore store= SearchPlugin.getDefault().getPreferenceStore(); String id= store.getString(DEFAULT_PERSPECTIVE); if (PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(id) == null) { store.putValue(DEFAULT_PERSPECTIVE, NO_DEFAULT_PERSPECTIVE); } }
private static void handleDeletedPerspectives() { IPreferenceStore store= SearchPlugin.getDefault().getPreferenceStore(); String id= store.getString(DEFAULT_PERSPECTIVE); if (PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(id) == null) { store.putValue(DEFAULT_PERSPECTIVE, NO_DEFAULT_PERSPECTIVE); } }
private static void handleDeletedPerspectives() { IPreferenceStore store= TeamUIPlugin.getPlugin().getPreferenceStore(); String id= store.getString(SYNCVIEW_DEFAULT_PERSPECTIVE); if (PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(id) == null) { store.putValue(SYNCVIEW_DEFAULT_PERSPECTIVE, SYNCVIEW_DEFAULT_PERSPECTIVE_NONE); } }
private static void handleDeletedPerspectives() { IPreferenceStore store= TeamUIPlugin.getPlugin().getPreferenceStore(); String id= store.getString(SYNCVIEW_DEFAULT_PERSPECTIVE); if (PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(id) == null) { store.putValue(SYNCVIEW_DEFAULT_PERSPECTIVE, SYNCVIEW_DEFAULT_PERSPECTIVE_NONE); } }
ArrayList<String> getPerspectiveExtensionActionSets(String id) { IPerspectiveDescriptor desc = getWorkbenchWindow().getWorkbench().getPerspectiveRegistry() .findPerspectiveWithId(id); if (desc != null) { MPerspective temporary = modelService.createModelElement(MPerspective.class); ModeledPageLayout modelLayout = new ModeledPageLayout(window, modelService, partService, temporary, desc, this, true); PerspectiveExtensionReader reader = new PerspectiveExtensionReader(); reader.setIncludeOnlyTags(new String[] { IWorkbenchRegistryConstants.TAG_ACTION_SET }); reader.extendLayout(null, id, modelLayout); return new ArrayList<>(ModeledPageLayout.getIds(temporary, ModeledPageLayout.ACTION_SET_TAG)); } return null; }