org.eclipse.ui.IWorkbenchPreferenceConstants Java Examples
The following examples show how to use
org.eclipse.ui.IWorkbenchPreferenceConstants.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ApplicationWorkbenchWindowAdvisor.java From elexis-3-core with Eclipse Public License 1.0 | 6 votes |
/** * Diese Methode wird jeweils unmittelbar vor dem öffnen des Anwendungsfensters ausgeführt. */ public void preWindowOpen(){ IWorkbenchWindowConfigurer configurer = getWindowConfigurer(); // configurer.setInitialSize(new Point(900, 700)); configurer.setShowCoolBar(true); configurer.setShowStatusLine(true); configurer.setShowProgressIndicator(true); configurer.setTitle(Hub.APPLICATION_NAME + " " + Elexis.VERSION); configurer.setShowFastViewBars(true); if (CoreHub.localCfg.get(Preferences.SHOWPERSPECTIVESELECTOR, Boolean.toString(false)) .equals(Boolean.toString(true))) { configurer.setShowPerspectiveBar(true); } else { configurer.setShowPerspectiveBar(false); } // Wir wollen die schicken runden Tabs von Eclipse 3.x PlatformUI.getPreferenceStore().setValue( IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS, false); // Aber die Animationen sind eher nervend, nicht? PlatformUI.getPreferenceStore().setValue(IWorkbenchPreferenceConstants.ENABLE_ANIMATIONS, false); }
Example #2
Source File: WorkingSetActionProvider.java From tmxeditor8 with GNU General Public License v2.0 | 6 votes |
/** * Restores the working set filter from the persistence store. */ protected void initWorkingSetFilter(String workingSetName) { IWorkingSet workingSet = null; if (workingSetName != null && workingSetName.length() > 0) { IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager(); workingSet = workingSetManager.getWorkingSet(workingSetName); } else if (PlatformUI.getPreferenceStore().getBoolean( IWorkbenchPreferenceConstants.USE_WINDOW_WORKING_SET_BY_DEFAULT)) { // use the window set by default if the global preference is set workingSet = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getAggregateWorkingSet(); } if (workingSet != null) { setWorkingSet(workingSet); } }
Example #3
Source File: WorkingSetActionProvider.java From translationstudio8 with GNU General Public License v2.0 | 6 votes |
/** * Restores the working set filter from the persistence store. */ protected void initWorkingSetFilter(String workingSetName) { IWorkingSet workingSet = null; if (workingSetName != null && workingSetName.length() > 0) { IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager(); workingSet = workingSetManager.getWorkingSet(workingSetName); } else if (PlatformUI.getPreferenceStore().getBoolean( IWorkbenchPreferenceConstants.USE_WINDOW_WORKING_SET_BY_DEFAULT)) { // use the window set by default if the global preference is set workingSet = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getAggregateWorkingSet(); } if (workingSet != null) { setWorkingSet(workingSet); } }
Example #4
Source File: SWTUtil.java From APICloud-Studio with GNU General Public License v3.0 | 6 votes |
/** * Creates the tab folder for displaying the composite fragments * * @param parent */ public static CTabFolder createTabFolder(Composite parent) { Display display = getStandardDisplay(); Color c1 = display.getSystemColor(SWT.COLOR_TITLE_BACKGROUND), c2 = display .getSystemColor(SWT.COLOR_TITLE_BACKGROUND_GRADIENT); CTabFolder tabs = new CTabFolder(parent, SWT.NO_REDRAW_RESIZE | SWT.NO_TRIM | SWT.FLAT); GridData gd = new GridData(GridData.FILL_BOTH); gd.horizontalSpan = 2; tabs.setSelectionBackground(new Color[] { c1, c2 }, new int[] { 100 }, true); tabs.setSelectionForeground(getStandardDisplay().getSystemColor(SWT.COLOR_TITLE_FOREGROUND)); tabs.setSimple(PlatformUI.getPreferenceStore().getBoolean( IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS)); tabs.setLayoutData(gd); tabs.setBorderVisible(true); tabs.setFont(parent.getFont()); return tabs; }
Example #5
Source File: ColoredViewersManager.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
public void propertyChange(PropertyChangeEvent event) { String property= event.getProperty(); if (property.equals(JFacePreferences.QUALIFIER_COLOR) || property.equals(JFacePreferences.COUNTER_COLOR) || property.equals(JFacePreferences.DECORATIONS_COLOR) || property.equals(HIGHLIGHT_BG_COLOR_NAME) || property.equals(HIGHLIGHT_WRITE_BG_COLOR_NAME) || property.equals(INHERITED_COLOR_NAME) || property.equals(IWorkbenchPreferenceConstants.USE_COLORED_LABELS) ) { Display.getDefault().asyncExec(new Runnable() { public void run() { updateAllViewers(); } }); } }
Example #6
Source File: FilteredTreeComposite.java From nebula with Eclipse Public License 2.0 | 5 votes |
/** * Create the filtered tree. * * @param treeStyle the style bits for the <code>Tree</code> * @param filter the filter to be used * @since 3.3 */ protected void init(int treeStyle, PatternFilter filter) { patternFilter = filter; showFilterControls = true; if (!XViewerDisplay.isStandaloneXViewer() && XViewerDisplay.isWorkbenchRunning()) { showFilterControls = PlatformUI.getPreferenceStore().getBoolean(IWorkbenchPreferenceConstants.SHOW_FILTERED_TEXTS); } createControl(parent, treeStyle); createRefreshJob(); setInitialText(WorkbenchMessages.FilteredTree_FilterMessage); setFont(parent.getFont()); }
Example #7
Source File: Activator.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * Sets Application-wide properties */ @Override public void start(BundleContext bundleContext) throws Exception { PlatformUI.getPreferenceStore().setValue(IWorkbenchPreferenceConstants.LINK_NAVIGATOR_TO_EDITOR, true); PlatformUI.getPreferenceStore().setValue(IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS, false); super.start(bundleContext); }
Example #8
Source File: PreferenceInitializer.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Override public void initializeDefaultPreferences() { initializeWorkbenchPreferences(); final IPreferenceStore store = getBonitaPreferenceStore(); final IPreferenceStore webStore = getWebBrowserPreferenceStore(); setUTF8DefaultEncoding(); initDefaultWebPreferences(store, webStore); store.setDefault(SHOW_CONDITION_ON_TRANSITION, "false"); store.setDefault(DELETE_TENANT_ON_EXIT, false); store.setDefault(LOAD_ORGANIZATION, false); store.setDefault(AUTOMATIC_ID, "true"); initDefaultLocalesPreference(store); store.setDefault(BonitaCoolBarPreferenceConstant.COOLBAR_DEFAULT_SIZE, BonitaCoolBarPreferenceConstant.SMALL); store.setDefault(APLLICATION_DEPLOYMENT_MODE, ALL_IN_BAR); store.setDefault(DEFAULT_USERXP_THEME, "default"); store.setDefault(DEFAULT_APPLICATION_THEME, "Default Application"); store.setDefault(ASK_RENAME_ON_FIRST_SAVE, true); store.setDefault(ALWAYS_USE_SCRIPTING_MODE, false); store.setDefault(SHOW_LEGACY_6X_MODE, false); store.setDefault(UID_JVM_OPTS, "-Xmx256m"); store.setDefault(BonitaPreferenceConstants.CUSTOM_PAGE_DEBUG, false); getAPIPreferenceStore().setValue(IWorkbenchPreferenceConstants.DISABLE_OPEN_EDITOR_IN_PLACE, true); initDefaultDebugPreferences(); final IPreferenceStore jdtUIStore = getJDTPreferenceStore(); jdtUIStore.setValue(PreferenceConstants.EDITOR_MARK_OCCURRENCES, Boolean.FALSE); }
Example #9
Source File: DecoratingFileSearchLabelProvider.java From Pydev with Eclipse Public License 1.0 | 5 votes |
@Override public void propertyChange(PropertyChangeEvent event) { String property = event.getProperty(); if (property.equals(JFacePreferences.QUALIFIER_COLOR) || property.equals(JFacePreferences.COUNTER_COLOR) || property.equals(JFacePreferences.DECORATIONS_COLOR) || property.equals(HIGHLIGHT_BG_COLOR_NAME) || property.equals(IWorkbenchPreferenceConstants.USE_COLORED_LABELS)) { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { refresh(); } }); } }
Example #10
Source File: ClientWorkbenchWindowAdvisor.java From ice with Eclipse Public License 1.0 | 5 votes |
@Override public void preWindowOpen() { // Get Display width and height Rectangle bounds = PlatformUI.getWorkbench().getDisplay().getBounds(); // Grab the Workbench Window Configurer, used to set things such as // perspectives bar, coolbar, etc.. IWorkbenchWindowConfigurer configurer = getWindowConfigurer(); // Set the size of the application the the size of the Display configurer.setInitialSize(new Point(bounds.width, bounds.height)); // Turn on the Coolbar, status bar, menu bar, and Perspectives bar configurer.setShowCoolBar(true); configurer.setShowStatusLine(true); configurer.setShowMenuBar(true); configurer.setShowPerspectiveBar(true); // Set the Application Title configurer.setTitle("ICE - " + "Eclipse Integrated Computational Environment"); //$NON-NLS-1$ // Move the Perspectives Bar to the Top Right, and make the editor tabs // curved instead of boxy and rectangular (looks better) PlatformUI.getPreferenceStore().setValue( IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS, false); return; }
Example #11
Source File: LifeCycleHook.java From MergeProcessor with Apache License 2.0 | 5 votes |
@ProcessRemovals public void removeElementsFromContext() { /* * WorkbenchWindow.populateStandardTrim(MTrimBar) automatically shows the heap * status in the status line. LifeCycleHook.removeElementsFromContext(...) is * called before the element is created. Therefore, we set the preference to not * show the heap status. * * This behaviour is only known in the 3.x legacy compatibility mode. */ PrefUtil.getAPIPreferenceStore().setValue(IWorkbenchPreferenceConstants.SHOW_MEMORY_MONITOR, false); }
Example #12
Source File: ModulaSearchLabelProvider.java From xds-ide with Eclipse Public License 1.0 | 5 votes |
public void propertyChange(PropertyChangeEvent event) { String property= event.getProperty(); if (property.equals(JFacePreferences.QUALIFIER_COLOR) || property.equals(JFacePreferences.COUNTER_COLOR) || property.equals(JFacePreferences.DECORATIONS_COLOR) || property.equals(IWorkbenchPreferenceConstants.USE_COLORED_LABELS) || property.equals(M2LabelProvider.EDITOR_SEARCH_RESULT_INDICATION_COLOR)) { Display.getDefault().asyncExec(new Runnable() { public void run() { refresh(); } }); } }
Example #13
Source File: DecoratingTypeScriptSearchLabelProvider.java From typescript.java with MIT License | 5 votes |
public void propertyChange(PropertyChangeEvent event) { String property= event.getProperty(); if (property.equals(JFacePreferences.QUALIFIER_COLOR) || property.equals(JFacePreferences.COUNTER_COLOR) || property.equals(JFacePreferences.DECORATIONS_COLOR) || property.equals(HIGHLIGHT_BG_COLOR_NAME) || property.equals(IWorkbenchPreferenceConstants.USE_COLORED_LABELS)) { Display.getDefault().asyncExec(new Runnable() { public void run() { refresh(); } }); } }
Example #14
Source File: AbstractNewProjectWizard.java From typescript.java with MIT License | 5 votes |
/** * Prompts the user for whether to switch perspectives. * * @param window * The workbench window in which to switch perspectives; must not * be <code>null</code> * @param finalPersp * The perspective to switch to; must not be <code>null</code>. * * @return <code>true</code> if it's OK to switch, <code>false</code> * otherwise */ private static boolean confirmPerspectiveSwitch(IWorkbenchWindow window, IPerspectiveDescriptor finalPersp) { IPreferenceStore store = IDEWorkbenchPlugin.getDefault().getPreferenceStore(); String pspm = store.getString(IDEInternalPreferences.PROJECT_SWITCH_PERSP_MODE); if (!IDEInternalPreferences.PSPM_PROMPT.equals(pspm)) { // Return whether or not we should always switch return IDEInternalPreferences.PSPM_ALWAYS.equals(pspm); } String desc = finalPersp.getDescription(); String message; if (desc == null || desc.length() == 0) message = NLS.bind(ResourceMessages.NewProject_perspSwitchMessage, finalPersp.getLabel()); else message = NLS.bind(ResourceMessages.NewProject_perspSwitchMessageWithDesc, new String[] { finalPersp.getLabel(), desc }); MessageDialogWithToggle dialog = MessageDialogWithToggle.openYesNoQuestion(window.getShell(), ResourceMessages.NewProject_perspSwitchTitle, message, null /* use the default message for the toggle */, false /* toggle is initially unchecked */, store, IDEInternalPreferences.PROJECT_SWITCH_PERSP_MODE); int result = dialog.getReturnCode(); // If we are not going to prompt anymore propogate the choice. if (dialog.getToggleState()) { String preferenceValue; if (result == IDialogConstants.YES_ID) { // Doesn't matter if it is replace or new window // as we are going to use the open perspective setting preferenceValue = IWorkbenchPreferenceConstants.OPEN_PERSPECTIVE_REPLACE; } else { preferenceValue = IWorkbenchPreferenceConstants.NO_NEW_PERSPECTIVE; } // update PROJECT_OPEN_NEW_PERSPECTIVE to correspond PrefUtil.getAPIPreferenceStore().setValue(IDE.Preferences.PROJECT_OPEN_NEW_PERSPECTIVE, preferenceValue); } return result == IDialogConstants.YES_ID; }
Example #15
Source File: PropertiesCorrectionAssistant.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
public PropertiesCorrectionAssistant(ITextEditor editor) { super(); Assert.isNotNull(editor); fEditor= editor; setQuickAssistProcessor(new PropertiesCorrectionProcessor(this)); enableColoredLabels(PlatformUI.getPreferenceStore().getBoolean(IWorkbenchPreferenceConstants.USE_COLORED_LABELS)); setInformationControlCreator(getInformationControlCreator()); }
Example #16
Source File: KeysPreferencePage.java From tmxeditor8 with GNU General Public License v2.0 | 4 votes |
@Override protected Control createContents(Composite parent) { PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IWorkbenchHelpContextIds.KEYS_PREFERENCE_PAGE); final Composite page = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(1, false); layout.marginWidth = 0; page.setLayout(layout); Group groupParent = new Group(page, SWT.None); groupParent.setLayout(new GridLayout()); groupParent.setLayoutData(new GridData(GridData.FILL_BOTH)); groupParent.setText(Messages.getString("preferencepage.KeysPreferencePage.groupParent")); HsImageLabel imageLabel = new HsImageLabel(Messages.getString("preferencepage.KeysPreferencePage.imageLabel"), Activator.getImageDescriptor(ImageConstant.PREFERENCE_SYS_KEY)); Composite cmp = imageLabel.createControl(groupParent); cmp.setLayout(new GridLayout()); Composite cmpTemp = (Composite) imageLabel.getControl(); cmpTemp.setLayoutData(new GridData(GridData.FILL_BOTH)); Composite cmpContent = new Composite(cmpTemp, SWT.None); cmpContent.setLayout(new GridLayout()); GridData data = new GridData(GridData.FILL_BOTH); data.horizontalSpan = 2; cmpContent.setLayoutData(data); // 不显示过滤文本框 PlatformUI.getPreferenceStore().setDefault(IWorkbenchPreferenceConstants.SHOW_FILTERED_TEXTS, false); IDialogSettings settings = getDialogSettings(); fPatternFilter = new CategoryPatternFilter(true, commandService.getCategory(null)); if (settings.get(TAG_FILTER_UNCAT) != null) { fPatternFilter.filterCategories(settings.getBoolean(TAG_FILTER_UNCAT)); } createTree(cmpContent); fill(); applyDialogFont(cmpContent); imageLabel.computeSize(); return page; }
Example #17
Source File: ModulaSearchLabelProvider.java From xds-ide with Eclipse Public License 1.0 | 4 votes |
public static boolean showColoredLabels() { return PlatformUI.getPreferenceStore().getBoolean(IWorkbenchPreferenceConstants.USE_COLORED_LABELS); }
Example #18
Source File: BonitaStudioWorkbenchWindowAdvisor.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
@Override public void openIntro() { PrefUtil.getAPIPreferenceStore().setValue(IWorkbenchPreferenceConstants.SHOW_INTRO, true); PrefUtil.saveAPIPrefs(); }
Example #19
Source File: FilteredItemsSelectionDialog.java From tlaplus with MIT License | 4 votes |
private static boolean showColoredLabels() { return PlatformUI.getPreferenceStore().getBoolean(IWorkbenchPreferenceConstants.USE_COLORED_LABELS); }
Example #20
Source File: DecoratingFileSearchLabelProvider.java From Pydev with Eclipse Public License 1.0 | 4 votes |
public static boolean showColoredLabels() { return PlatformUI.getPreferenceStore().getBoolean(IWorkbenchPreferenceConstants.USE_COLORED_LABELS); }
Example #21
Source File: LanguageCodesPreferencePage.java From tmxeditor8 with GNU General Public License v2.0 | 4 votes |
/** * 构建界面显示控件 * @param parent * 顶层容器 ; */ private Composite initContents(Composite parent) { final Composite page = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(1, false); layout.marginWidth = 0; page.setLayout(layout); // 不显示过滤文本框 PlatformUI.getPreferenceStore().setDefault(IWorkbenchPreferenceConstants.SHOW_FILTERED_TEXTS, false); Group groupParent = new Group(page, SWT.None); groupParent.setLayout(new GridLayout()); groupParent.setLayoutData(new GridData(GridData.FILL_BOTH)); groupParent.setText(Messages.getString("languagecode.LanguageCodesPreferencePage.groupParent")); HsImageLabel imageLabel = new HsImageLabel( Messages.getString("languagecode.LanguageCodesPreferencePage.imageLabel"), Activator.getImageDescriptor("images/preference/system/sys_language_code_32.png")); Composite cmp = imageLabel.createControl(groupParent); cmp.setLayout(new GridLayout()); Composite cmpTemp = (Composite) imageLabel.getControl(); cmpTemp.setLayoutData(new GridData(GridData.FILL_BOTH)); Composite cmpContent = new Composite(cmpTemp, SWT.None); cmpContent.setLayout(layout); GridData data = new GridData(GridData.FILL_BOTH); data.horizontalSpan = 2; cmpContent.setLayoutData(data); // 放置过滤文本框的容器 createFilterControls(cmpContent); // 创建添加、删除按钮 createLanguageControls(page); // 暂注释掉 创建与当前语言区域相关的数字、货币、时间、短日期、长日期的格式显示控件 // createLocaleFormatControls(page); imageLabel.computeSize(); // cmpContent.computeSize(SWT.DEFAULT, SWT.DEFAULT); return page; }
Example #22
Source File: DecoratingTypeScriptSearchLabelProvider.java From typescript.java with MIT License | 4 votes |
public static boolean showColoredLabels() { return PlatformUI.getPreferenceStore().getBoolean(IWorkbenchPreferenceConstants.USE_COLORED_LABELS); }
Example #23
Source File: UnOpenAgainEditorPresentationFactory.java From tmxeditor8 with GNU General Public License v2.0 | 4 votes |
public StackPresentation createEditorPresentation(Composite parent, IStackPresentationSite site) { DefaultTabFolder folder = new DefaultTabFolder(parent, editorTabPosition | SWT.BORDER, site .supportsState(IStackPresentationSite.STATE_MINIMIZED), site.supportsState(IStackPresentationSite.STATE_MAXIMIZED)); /* * Set the minimum characters to display, if the preference is something * other than the default. This is mainly intended for RCP applications * or for expert users (i.e., via the plug-in customization file). * * Bug 32789. */ final IPreferenceStore store = PlatformUI.getPreferenceStore(); if (store .contains(IWorkbenchPreferenceConstants.EDITOR_MINIMUM_CHARACTERS)) { final int minimumCharacters = store .getInt(IWorkbenchPreferenceConstants.EDITOR_MINIMUM_CHARACTERS); if (minimumCharacters >= 0) { folder.setMinimumCharacters(minimumCharacters); } } PresentablePartFolder partFolder = new PresentablePartFolder(folder); TabbedStackPresentation result = new TabbedStackPresentation(site, partFolder, new StandardEditorSystemMenu(site)); DefaultThemeListener themeListener = new DefaultThemeListener(folder, result.getTheme()); result.getTheme().addListener(themeListener); new DefaultMultiTabListener(result.getApiPreferences(), IWorkbenchPreferenceConstants.SHOW_MULTIPLE_EDITOR_TABS, folder); new DefaultSimpleTabListener(result.getApiPreferences(), IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS, folder); return result; }
Example #24
Source File: KeysPreferencePage.java From tmxeditor8 with GNU General Public License v2.0 | 4 votes |
@Override protected Control createContents(Composite parent) { PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IWorkbenchHelpContextIds.KEYS_PREFERENCE_PAGE); final Composite page = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(1, false); layout.marginWidth = 0; page.setLayout(layout); Group groupParent = new Group(page, SWT.None); groupParent.setLayout(new GridLayout()); groupParent.setLayoutData(new GridData(GridData.FILL_BOTH)); groupParent.setText(Messages.getString("preferencepage.KeysPreferencePage.groupParent")); HsImageLabel imageLabel = new HsImageLabel(Messages.getString("preferencepage.KeysPreferencePage.imageLabel"), Activator.getImageDescriptor(ImageConstants.PREFERENCE_SYS_KEY)); Composite cmp = imageLabel.createControl(groupParent); cmp.setLayout(new GridLayout()); Composite cmpTemp = (Composite) imageLabel.getControl(); cmpTemp.setLayoutData(new GridData(GridData.FILL_BOTH)); Composite cmpContent = new Composite(cmpTemp, SWT.None); cmpContent.setLayout(new GridLayout()); GridData data = new GridData(GridData.FILL_BOTH); data.horizontalSpan = 2; cmpContent.setLayoutData(data); // 不显示过滤文本框 PlatformUI.getPreferenceStore().setDefault(IWorkbenchPreferenceConstants.SHOW_FILTERED_TEXTS, false); IDialogSettings settings = getDialogSettings(); fPatternFilter = new CategoryPatternFilter(true, commandService.getCategory(null)); if (settings.get(TAG_FILTER_UNCAT) != null) { fPatternFilter.filterCategories(settings.getBoolean(TAG_FILTER_UNCAT)); } createTree(cmpContent); fill(); applyDialogFont(cmpContent); imageLabel.computeSize(); return page; }
Example #25
Source File: KeysPreferencePage.java From translationstudio8 with GNU General Public License v2.0 | 4 votes |
@Override protected Control createContents(Composite parent) { PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IWorkbenchHelpContextIds.KEYS_PREFERENCE_PAGE); final Composite page = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(1, false); layout.marginWidth = 0; page.setLayout(layout); Group groupParent = new Group(page, SWT.None); groupParent.setLayout(new GridLayout()); groupParent.setLayoutData(new GridData(GridData.FILL_BOTH)); groupParent.setText(Messages.getString("preferencepage.KeysPreferencePage.groupParent")); HsImageLabel imageLabel = new HsImageLabel(Messages.getString("preferencepage.KeysPreferencePage.imageLabel"), Activator.getImageDescriptor(ImageConstant.PREFERENCE_SYS_KEY)); Composite cmp = imageLabel.createControl(groupParent); cmp.setLayout(new GridLayout()); Composite cmpTemp = (Composite) imageLabel.getControl(); cmpTemp.setLayoutData(new GridData(GridData.FILL_BOTH)); Composite cmpContent = new Composite(cmpTemp, SWT.None); cmpContent.setLayout(new GridLayout()); GridData data = new GridData(GridData.FILL_BOTH); data.horizontalSpan = 2; cmpContent.setLayoutData(data); // 不显示过滤文本框 PlatformUI.getPreferenceStore().setDefault(IWorkbenchPreferenceConstants.SHOW_FILTERED_TEXTS, false); IDialogSettings settings = getDialogSettings(); fPatternFilter = new CategoryPatternFilter(true, commandService.getCategory(null)); if (settings.get(TAG_FILTER_UNCAT) != null) { fPatternFilter.filterCategories(settings.getBoolean(TAG_FILTER_UNCAT)); } createTree(cmpContent); fill(); applyDialogFont(cmpContent); imageLabel.computeSize(); return page; }
Example #26
Source File: LanguageCodesPreferencePage.java From translationstudio8 with GNU General Public License v2.0 | 4 votes |
/** * 构建界面显示控件 * @param parent * 顶层容器 ; */ private Composite initContents(Composite parent) { final Composite page = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(1, false); layout.marginWidth = 0; page.setLayout(layout); // 不显示过滤文本框 PlatformUI.getPreferenceStore().setDefault(IWorkbenchPreferenceConstants.SHOW_FILTERED_TEXTS, false); Group groupParent = new Group(page, SWT.None); groupParent.setLayout(new GridLayout()); groupParent.setLayoutData(new GridData(GridData.FILL_BOTH)); groupParent.setText(Messages.getString("languagecode.LanguageCodesPreferencePage.groupParent")); HsImageLabel imageLabel = new HsImageLabel( Messages.getString("languagecode.LanguageCodesPreferencePage.imageLabel"), Activator.getImageDescriptor(ImageConstant.PREFERENCE_SYS_LANG_CODE)); Composite cmp = imageLabel.createControl(groupParent); cmp.setLayout(new GridLayout()); Composite cmpTemp = (Composite) imageLabel.getControl(); cmpTemp.setLayoutData(new GridData(GridData.FILL_BOTH)); Composite cmpContent = new Composite(cmpTemp, SWT.None); cmpContent.setLayout(layout); GridData data = new GridData(GridData.FILL_BOTH); data.horizontalSpan = 2; cmpContent.setLayoutData(data); // 放置过滤文本框的容器 createFilterControls(cmpContent); // 创建添加、删除按钮 createLanguageControls(page); // 暂注释掉 创建与当前语言区域相关的数字、货币、时间、短日期、长日期的格式显示控件 // createLocaleFormatControls(page); imageLabel.computeSize(); // cmpContent.computeSize(SWT.DEFAULT, SWT.DEFAULT); return page; }
Example #27
Source File: UnOpenAgainEditorPresentationFactory.java From translationstudio8 with GNU General Public License v2.0 | 4 votes |
public StackPresentation createEditorPresentation(Composite parent, IStackPresentationSite site) { DefaultTabFolder folder = new DefaultTabFolder(parent, editorTabPosition | SWT.BORDER, site .supportsState(IStackPresentationSite.STATE_MINIMIZED), site.supportsState(IStackPresentationSite.STATE_MAXIMIZED)); /* * Set the minimum characters to display, if the preference is something * other than the default. This is mainly intended for RCP applications * or for expert users (i.e., via the plug-in customization file). * * Bug 32789. */ final IPreferenceStore store = PlatformUI.getPreferenceStore(); if (store .contains(IWorkbenchPreferenceConstants.EDITOR_MINIMUM_CHARACTERS)) { final int minimumCharacters = store .getInt(IWorkbenchPreferenceConstants.EDITOR_MINIMUM_CHARACTERS); if (minimumCharacters >= 0) { folder.setMinimumCharacters(minimumCharacters); } } PresentablePartFolder partFolder = new PresentablePartFolder(folder); TabbedStackPresentation result = new TabbedStackPresentation(site, partFolder, new StandardEditorSystemMenu(site)); DefaultThemeListener themeListener = new DefaultThemeListener(folder, result.getTheme()); result.getTheme().addListener(themeListener); new DefaultMultiTabListener(result.getApiPreferences(), IWorkbenchPreferenceConstants.SHOW_MULTIPLE_EDITOR_TABS, folder); new DefaultSimpleTabListener(result.getApiPreferences(), IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS, folder); return result; }
Example #28
Source File: WorkingSetFilterActionGroup.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
private boolean useWindowWorkingSetByDefault() { return fAllowWindowWorkingSetByDefault && PlatformUI.getPreferenceStore().getBoolean(IWorkbenchPreferenceConstants.USE_WINDOW_WORKING_SET_BY_DEFAULT); }
Example #29
Source File: ColoredViewersManager.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
public static boolean showColoredLabels() { return PlatformUI.getPreferenceStore().getBoolean(IWorkbenchPreferenceConstants.USE_COLORED_LABELS); }