List of usage examples for org.eclipse.jface.preference IPreferenceStore getBoolean
boolean getBoolean(String name);
From source file:com.iw.plugins.spindle.editors.Editor.java
License:Mozilla Public License
public ContentAssistant getContentAssistant() { if (fContentAssistant == null) { fContentAssistant = new ContentAssistant(); IPreferenceStore store = UIPlugin.getDefault().getPreferenceStore(); fContentAssistant.enableAutoInsert(store.getBoolean(PreferenceConstants.AUTO_ACTIVATE_CONTENT_ASSIST)); }//from www. j a va 2s . co m return fContentAssistant; }
From source file:com.iw.plugins.spindle.editors.spec.assist.SpecCompletionProcessor.java
License:Mozilla Public License
private String getSkeletonSpecification(String extension) { IPreferenceStore store = UIPlugin.getDefault().getPreferenceStore(); boolean useTabs = store.getBoolean(UIPlugin.PLUGIN_ID + ".FORMATTER_USE_TABS_TO_INDENT"); int tabSize = store.getInt(UIPlugin.PLUGIN_ID + ".EDITOR_DISPLAY_TAB_WIDTH"); StringWriter swriter = new StringWriter(); IndentingWriter iwriter = new IndentingWriter(swriter, useTabs, tabSize, 0, null); if ("jwc".equals(extension)) { XMLUtil.writeComponentSpecification(iwriter, UIPlugin.DEFAULT_COMPONENT_SPEC, 0); return swriter.toString(); } else if ("page".equals(extension)) { XMLUtil.writeComponentSpecification(iwriter, UIPlugin.DEFAULT_PAGE_SPEC, 0); return swriter.toString(); } else if ("application".equals(extension)) { XMLUtil.writeApplicationSpecification(iwriter, UIPlugin.DEFAULT_APPLICATION_SPEC, 0); return swriter.toString(); } else if ("library".equals(extension)) { XMLUtil.writeLibrarySpecification(iwriter, UIPlugin.DEFAULT_LIBRARY_SPEC, 0); return swriter.toString(); }/* ww w.jav a 2 s .c om*/ return ""; }
From source file:com.iw.plugins.spindle.editors.spec.outline.MultiPageContentOutline.java
License:Mozilla Public License
private IContentOutlinePage getInitialPage() { IPreferenceStore store = UIPlugin.getDefault().getPreferenceStore(); boolean flag = store.getBoolean(SHOW_TAPESTRY_OUTLINE); if (flag)/* ww w . j a v a 2 s . c om*/ return fTapestryOutlinePage; return fXMLOutlinePage; }
From source file:com.iw.plugins.spindle.editors.spec.outline.TapestryOutlinePage.java
License:Mozilla Public License
/** * @param fAlphaCatSorter/*from w ww .j a va2 s . com*/ */ private void updateSorter(boolean categoryChanged) { IPreferenceStore store = UIPlugin.getDefault().getPreferenceStore(); ViewerSorter toBeShown; boolean showAlpha = store.getBoolean(ALPHA_PREFERENCE); if (showAlpha) toBeShown = fAlphaCatSorter; else toBeShown = fDefaultSorter; Control control = getControl(); if (control == null || control.isDisposed()) { fCurrentSorter = toBeShown; return; } treeViewer.setSorter(null); treeViewer.setSorter(toBeShown); }
From source file:com.iw.plugins.spindle.editors.spec.SpecEditor.java
License:Mozilla Public License
public boolean isFoldingEnabled() { IPreferenceStore store = UIPlugin.getDefault().getPreferenceStore(); return store.getBoolean(PreferenceConstants.EDITOR_FOLDING_ENABLED); }
From source file:com.iw.plugins.spindle.editors.spec.SpecFileDocumentProvider.java
License:Mozilla Public License
private String getSkeletonSpecification(String extension) { IPreferenceStore store = UIPlugin.getDefault().getPreferenceStore(); boolean useTabs = store.getBoolean(PreferenceConstants.FORMATTER_TAB_CHAR); int tabSize = store.getInt(PreferenceConstants.FORMATTER_TAB_SIZE); StringWriter swriter = new StringWriter(); IndentingWriter iwriter = new IndentingWriter(swriter, useTabs, tabSize, 0, null); if ("jwc".equals(extension)) { XMLUtil.writeComponentSpecification(iwriter, UIPlugin.DEFAULT_COMPONENT_SPEC, 0); return swriter.toString(); } else if ("page".equals(extension)) { XMLUtil.writeComponentSpecification(iwriter, UIPlugin.DEFAULT_PAGE_SPEC, 0); return swriter.toString(); } else if ("application".equals(extension)) { XMLUtil.writeApplicationSpecification(iwriter, UIPlugin.DEFAULT_APPLICATION_SPEC, 0); return swriter.toString(); } else if ("library".equals(extension)) { XMLUtil.writeLibrarySpecification(iwriter, UIPlugin.DEFAULT_LIBRARY_SPEC, 0); return swriter.toString(); }/*from w w w .ja va2 s . c om*/ return ""; }
From source file:com.iw.plugins.spindle.ui.wizards.factories.LibraryFactory.java
License:Mozilla Public License
static private String getLibraryContent() throws CoreException, InterruptedException { PluginLibrarySpecification librarySpec = new PluginLibrarySpecification(); librarySpec.setPublicId(SpecificationParser.TAPESTRY_DTD_1_3_PUBLIC_ID); IPreferenceStore store = UIPlugin.getDefault().getPreferenceStore(); boolean useTabs = store.getBoolean(PreferenceConstants.FORMATTER_TAB_CHAR); int tabSize = store.getInt(PreferenceConstants.FORMATTER_TAB_SIZE); StringWriter swriter = new StringWriter(); IndentingWriter iwriter = new IndentingWriter(swriter, useTabs, tabSize, 0, null); XMLUtil.writeLibrarySpecification(iwriter, librarySpec, 0); iwriter.flush();//from w ww .j a v a 2s.c o m return swriter.toString(); }
From source file:com.iw.plugins.spindle.ui.wizards.source.MoveImplicitToSpecWizard.java
License:Mozilla Public License
private void init(TemplateEditor templateEditor, XMLNode sourceNode, List sourceAttributes, ITextEditor targetEditor, PluginComponentSpecification buildStateComponent) { IPreferenceStore store = UIPlugin.getDefault().getPreferenceStore(); fUseTabIndent = store.getBoolean(FORMATTER_USE_TABS_TO_INDENT); fTabSpaces = store.getInt(EDITOR_DISPLAY_TAB_WIDTH); fTemplateEditor = templateEditor;/*from w w w . j a v a 2s.c om*/ fImplicitNode = sourceNode; fAttributeList = sourceAttributes; fSpecEditor = targetEditor; fRelatedSpec = buildStateComponent; TemplateTapestryAccess access = new TemplateTapestryAccess(templateEditor); String jwcid = null; for (Iterator iter = sourceAttributes.iterator(); iter.hasNext();) { XMLNode node = (XMLNode) iter.next(); if (node.getName().equals(TemplateParser.JWCID_ATTRIBUTE_NAME)) { jwcid = node.getAttributeValue(); break; } } access.setJwcid(jwcid); fSimpleId = access.getSimpleId(); fFullType = access.getFullType(); fImplicitComponent = access.getResolvedComponent(); initializeDocuments(); }
From source file:com.iw.plugins.spindle.wizards.NewTapComponentWizardPage.java
License:Mozilla Public License
/** * @see DialogPage#createControl(Composite) *//* w ww . jav a 2s.co m*/ public void createControl(Composite container) { Composite composite = new Composite(container, SWT.NONE); FormLayout layout = new FormLayout(); layout.marginWidth = 4; layout.marginHeight = 4; composite.setLayout(layout); FormData formData = new FormData(); formData.top = new FormAttachment(0, 0); formData.left = new FormAttachment(0, 0); formData.width = 400; composite.setLayoutData(formData); Control nameFieldControl = fComponentNameDialog.getControl(composite); Control containerFieldControl = fContainerDialogField.getControl(composite); Control packageFieldControl = fPackageDialogField.getControl(composite); Control autoAddControl = fAutoAddField.getControl(composite); Control genHTML = fGenerateHTML.getControl(composite); Control labelControl = fNextLabel.getControl(composite); addControl(nameFieldControl, composite, 10); Control separator = createSeparator(composite, nameFieldControl); addControl(containerFieldControl, separator, 4); addControl(packageFieldControl, containerFieldControl, 4); separator = createSeparator(composite, packageFieldControl); addControl(autoAddControl, separator, 4); separator = createSeparator(composite, autoAddControl); addControl(genHTML, separator, 10); addControl(labelControl, genHTML, 50); setControl(composite); setFocus(); IPreferenceStore pstore = TapestryPlugin.getDefault().getPreferenceStore(); fAutoAddField.updateStatus(); fGenerateHTML.setCheckBoxValue(pstore.getBoolean(P_GENERATE_HTML)); updateStatus(); }
From source file:com.ixenit.membersort.handlers.MemberComparator.java
License:Apache License
@Override public int compare(BodyDeclaration o1, BodyDeclaration o2) { IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore(); String savedOrder = preferenceStore.getString(PreferenceConstants.P_ORDER); String[] order = OrderConverter.convert(savedOrder); boolean orderByName = preferenceStore.getBoolean(PreferenceConstants.P_ORDER_BY_NAME); Member member1 = _createMember(o1); Member member2 = _createMember(o2); int modifierOrder1 = _computeOrderByModifiers(member1.modifiers, order); int modifierOrder2 = _computeOrderByModifiers(member2.modifiers, order); // If they have the same modifiers then compare them by name if (modifierOrder1 == modifierOrder2) { return orderByName ? member1.name.compareTo(member2.name) : 0; }/* ww w. j a va2 s. c o m*/ // Compare them by modifiers return (modifierOrder1 < modifierOrder2) ? -1 : 1; }