List of usage examples for org.eclipse.jface.resource JFaceResources DIALOG_FONT
String DIALOG_FONT
To view the source code for org.eclipse.jface.resource JFaceResources DIALOG_FONT.
Click Source Link
"org.eclipse.jface.dialogfont"
). From source file:org.eclipse.jst.j2ee.internal.ui.JavaEEDeploymentAssemblyAdvancedSectionBuilder.java
License:Open Source License
private Composite createAdvancedSection(Composite parent) { // Build the expandable composite ExpandableComposite excomposite = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT | ExpandableComposite.COMPACT); excomposite.setText(Messages.J2EEModuleDependenciesPropertyPage_ADVANCED); excomposite.setExpanded(false);/*from w w w. j ava 2 s . c o m*/ excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 1, 1)); excomposite.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent e) { expandedStateChanged((ExpandableComposite) e.getSource()); } }); // Build the composite has the contents of the expandable widget Composite innerComposite = new Composite(excomposite, SWT.NONE); excomposite.setClient(innerComposite); GridLayout gl = new GridLayout(2, false); gl.marginHeight = 0; gl.marginWidth = 0; innerComposite.setLayout(gl); return innerComposite; }
From source file:org.eclipse.jst.jsf.ui.internal.validation.OptionsConfigurationBlock.java
License:Open Source License
ExpandableComposite createStyleSection(Composite parent, String label, int nColumns) { ExpandableComposite excomposite = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT); excomposite.setText(label);/*from ww w . j a va 2s . com*/ excomposite.setExpanded(false); excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1)); excomposite.addExpansionListener(new ExpansionAdapter() { public void expansionStateChanged(ExpansionEvent e) { expandedStateChanged((ExpandableComposite) e.getSource()); } }); fExpandedComposites.add(excomposite); makeScrollableCompositeAware(excomposite); return excomposite; }
From source file:org.eclipse.ltk.internal.ui.refactoring.ChangeElementLabelProvider.java
License:Open Source License
public Font getFont(Object element) { if (isDerived(element)) { return JFaceResources.getFontRegistry().getItalic(JFaceResources.DIALOG_FONT); } else {/* ww w . java 2 s .co m*/ return null; } }
From source file:org.eclipse.mylyn.builds.ui.spi.BuildServerPart.java
License:Open Source License
@Override protected Control createAdditionalContents(final Composite parent) { // SectionComposite sectionComposite = new SectionComposite(parent, SWT.NONE); // //sectionComposite.setMinHeight(150); // sectionComposite.setExpandVertical(false); final ExpandableComposite section = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT | ExpandableComposite.COMPACT | ExpandableComposite.EXPANDED); section.clientVerticalSpacing = 0;/*from w w w . j ava2s .co m*/ section.setBackground(parent.getBackground()); section.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); section.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent e) { if (section.getLayoutData() instanceof GridData) { ((GridData) section.getLayoutData()).grabExcessVerticalSpace = e.getState(); } parent.layout(true); } }); section.setText("Build Plans"); // ExpandableComposite section = section.createSection("Build Plans"); // section.setExpanded(true); // if (section.getLayoutData() instanceof GridData) { // GridData gd = ((GridData) section.getLayoutData()); // gd.grabExcessVerticalSpace = true; // gd.verticalAlignment = SWT.FILL; // gd.minimumHeight = 150; // } Composite composite = new Composite(section, SWT.NONE); section.setClient(composite); GridLayoutFactory.fillDefaults().numColumns(2).margins(0, 5).applyTo(composite); CheckboxFilteredTree filteredTree = new CheckboxFilteredTree(composite, SWT.FULL_SELECTION | SWT.BORDER, new SubstringPatternFilter()); GridDataFactory.fillDefaults().grab(true, true).hint(SWT.DEFAULT, 200).applyTo(filteredTree); planViewer = filteredTree.getCheckboxTreeViewer();//new CheckboxTreeViewer(composite, SWT.FULL_SELECTION | SWT.BORDER); planViewer.addCheckStateListener(new ICheckStateListener() { public void checkStateChanged(CheckStateChangedEvent event) { BuildPlan plan = (BuildPlan) event.getElement(); plan.setSelected(event.getChecked()); } }); planViewer.setCheckStateProvider(new ICheckStateProvider() { public boolean isChecked(Object element) { return ((IBuildPlan) element).isSelected(); } public boolean isGrayed(Object element) { for (IBuildPlan child : ((IBuildPlan) element).getChildren()) { if (!child.isSelected()) { return true; } } return false; } }); planViewer.setLabelProvider(new LabelProvider() { @Override public String getText(Object element) { return ((IBuildPlan) element).getName(); } }); planViewer.setContentProvider(new ITreeContentProvider() { private BuildServerConfiguration configuration; private final Object[] EMPTY_ARRAY = new Object[0]; public void dispose() { // ignore } public Object[] getChildren(Object parentElement) { return EMPTY_ARRAY; } public Object[] getElements(Object inputElement) { return configuration.getPlans().toArray(); } public Object getParent(Object element) { return null; } public boolean hasChildren(Object element) { return false; } public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { configuration = (BuildServerConfiguration) newInput; } }); planViewer.setSorter(new ViewerSorter()); Composite buttonComposite = new Composite(composite, SWT.NONE); GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.TOP).applyTo(buttonComposite); GridLayoutFactory.fillDefaults().numColumns(1).margins(0, 0).extendedMargins(0, 0, 0, 0) .applyTo(buttonComposite); createButtons(buttonComposite); return section; }
From source file:org.eclipse.mylyn.commons.workbench.forms.SectionComposite.java
License:Open Source License
public ExpandableComposite createSection(String title, int expansionStyle, final boolean grabExcessVerticalSpace) { final ExpandableComposite section = getToolkit().createExpandableComposite(getContent(), ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT | ExpandableComposite.COMPACT | expansionStyle);//from w ww.j a v a 2 s . c o m section.titleBarTextMarginWidth = 0; section.setBackground(null); section.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); section.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent e) { if ((Boolean) e.data == true && grabExcessVerticalSpace) { GridData g = (GridData) section.getLayoutData(); g.verticalAlignment = GridData.FILL; g.grabExcessVerticalSpace = true; section.setLayoutData(g); } else { GridData g = (GridData) section.getLayoutData(); g.verticalAlignment = GridData.BEGINNING; g.grabExcessVerticalSpace = false; section.setLayoutData(g); } resizeAndReflow(); } }); section.setText(title); if (content.getLayout() instanceof GridLayout) { GridDataFactory.fillDefaults().indent(0, 5).grab(true, false) .span(((GridLayout) content.getLayout()).numColumns, SWT.DEFAULT).applyTo(section); } return section; }
From source file:org.eclipse.mylyn.internal.bugzilla.ui.wizard.BugzillaAttachmentWizardPage.java
License:Open Source License
private void createAdvancedSection(final Composite container) { boolean flagFound = false; for (TaskAttribute attribute : attachmentAttribute.getAttributes().values()) { if (!attribute.getId().startsWith(BugzillaAttribute.KIND_FLAG)) { continue; }/*from ww w. ja v a2s .c o m*/ flagFound = true; break; } if (!flagFound) { return; } advancedExpandComposite = toolkit.createExpandableComposite(container, ExpandableComposite.COMPACT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); advancedExpandComposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); advancedExpandComposite.setBackground(container.getBackground()); advancedExpandComposite.setText(Messages.BugzillaAttachmentWizardPage_Advanced); advancedExpandComposite.setLayout(new GridLayout(4, false)); GridDataFactory.fillDefaults().indent(-6, 0).grab(true, false).span(4, SWT.DEFAULT) .applyTo(advancedExpandComposite); advancedExpandComposite.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent e) { container.layout(); container.redraw(); } }); Composite advancedBodyComposite = new Composite(advancedExpandComposite, SWT.NONE); GridLayoutFactory.fillDefaults().margins(0, 0).numColumns(2).applyTo(advancedBodyComposite); advancedBodyComposite.setBackground(container.getBackground()); createFlagEditors(2, advancedBodyComposite); advancedExpandComposite.setClient(advancedBodyComposite); }
From source file:org.eclipse.mylyn.internal.commons.ui.SectionComposite.java
License:Open Source License
public ExpandableComposite createSection(String title, int expansionStyle, final boolean grabExcessVerticalSpace) { final ExpandableComposite section = getToolkit().createExpandableComposite(getContent(), ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT | ExpandableComposite.COMPACT | expansionStyle);/* ww w .j a v a 2s . c o m*/ section.titleBarTextMarginWidth = 0; section.setBackground(null); section.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); section.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent e) { if ((Boolean) e.data == true && grabExcessVerticalSpace) { GridData g = (GridData) section.getLayoutData(); g.verticalAlignment = GridData.FILL; g.grabExcessVerticalSpace = true; section.setLayoutData(g); } else { GridData g = (GridData) section.getLayoutData(); g.verticalAlignment = GridData.BEGINNING; g.grabExcessVerticalSpace = false; section.setLayoutData(g); } Point newSize = section.getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT, true); Rectangle currentbounds = section.getShell().getBounds(); if (newSize.x > currentbounds.width || newSize.y > currentbounds.height) { Object shellData = section.getShell().getData(); if (shellData instanceof Window) { Window window = (Window) shellData; Rectangle preferredSize = new Rectangle(currentbounds.x, currentbounds.y, newSize.x, newSize.y); Rectangle result = WindowUtil.getConstrainedShellBounds(window, preferredSize); section.getShell().setBounds(result); } } else { layout(true); reflow(true); } } }); section.setText(title); if (content.getLayout() instanceof GridLayout) { GridDataFactory.fillDefaults().indent(0, 5).grab(true, false) .span(((GridLayout) content.getLayout()).numColumns, SWT.DEFAULT).applyTo(section); } return section; }
From source file:org.eclipse.mylyn.tasks.ui.wizards.AbstractTaskRepositoryPage.java
License:Open Source License
/** * @since 3.1//from w ww . j a va 2 s .c om */ protected ExpandableComposite createSection(final Composite parentControl, String title) { final ExpandableComposite section = toolkit.createExpandableComposite(parentControl, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT | ExpandableComposite.COMPACT); section.clientVerticalSpacing = 0; section.setBackground(parentControl.getBackground()); section.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); section.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent e) { parentControl.layout(true); getControl().getShell().pack(); } }); section.setText(title); GridDataFactory.fillDefaults().indent(0, 5).grab(true, false).span(3, SWT.DEFAULT).applyTo(section); return section; }
From source file:org.eclipse.pde.api.tools.ui.internal.preferences.ApiErrorsWarningsConfigurationBlock.java
License:Open Source License
/** * Creates an {@link ExpandableComposite} with a client composite and a * default grid layout/* w w w . ja va 2s.c o m*/ * * @param parent * @param title * @return */ private Composite createExpansibleComposite(Composite parent, String title) { ExpandableComposite ecomp = SWTFactory.createExpandibleComposite(parent, title, 1, GridData.FILL_HORIZONTAL); ecomp.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent e) { Object obj = e.getSource(); handleExpand(getScrollingParent(obj)); } }); ecomp.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); fExpComps.add(ecomp); Composite client = SWTFactory.createComposite(ecomp, 2, 1, GridData.FILL_BOTH); ecomp.setClient(client); return client; }
From source file:org.eclipse.pde.internal.ds.ui.editor.contentassist.TypeCompletionProposal.java
License:Open Source License
public IInformationControlCreator getInformationControlCreator() { if (!BrowserInformationControl.isAvailable(null)) return null; if (fCreator == null) { fCreator = new AbstractReusableInformationControlCreator() { /*/*from w ww .j a v a 2 s . com*/ * @see org.eclipse.jdt.internal.ui.text.java.hover.AbstractReusableInformationControlCreator#doCreateInformationControl(org.eclipse.swt.widgets.Shell) */ public IInformationControl doCreateInformationControl(Shell parent) { return new BrowserInformationControl(parent, JFaceResources.DIALOG_FONT, false); } }; } return fCreator; }