use of org.eclipse.ui.forms.widgets.Section in project knime-core by knime.
the class PreferredRendererPreferencePage method createFieldEditors.
/**
* {@inheritDoc}
*/
@Override
protected void createFieldEditors() {
Map<String, List<ExtensibleUtilityFactory>> groupedUtilityFactories = new HashMap<String, List<ExtensibleUtilityFactory>>();
// TODO retrieve the utility factories from the data type extension point once we have it
for (ExtensibleUtilityFactory fac : ExtensibleUtilityFactory.getAllFactories()) {
List<ExtensibleUtilityFactory> groupList = groupedUtilityFactories.get(fac.getGroupName());
if (groupList == null) {
groupList = new ArrayList<ExtensibleUtilityFactory>(16);
groupedUtilityFactories.put(fac.getGroupName(), groupList);
}
groupList.add(fac);
}
List<String> groupNames = new ArrayList<String>(groupedUtilityFactories.keySet());
Collections.sort(groupNames);
for (String group : groupNames) {
final Section sectionExpander = new Section(getFieldEditorParent(), ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT);
sectionExpander.setText(group);
final Composite section = new Composite(sectionExpander, SWT.NONE);
sectionExpander.setClient(section);
sectionExpander.addExpansionListener(new ExpansionAdapter() {
@Override
public void expansionStateChanged(final ExpansionEvent e) {
Composite comp = section;
while (!(comp instanceof ScrolledComposite)) {
comp = comp.getParent();
}
// this is to fix a bug in Eclipse, no scrollbar is shown when this is true
((ScrolledComposite) comp).setExpandVertical(false);
comp = section;
while (!(comp instanceof ScrolledComposite)) {
comp.setSize(comp.computeSize(SWT.DEFAULT, SWT.DEFAULT));
comp.layout();
comp = comp.getParent();
}
}
});
List<ExtensibleUtilityFactory> utilityFactories = groupedUtilityFactories.get(group);
Collections.sort(utilityFactories, utilityFactoryComparator);
for (ExtensibleUtilityFactory utilFac : utilityFactories) {
List<DataValueRendererFactory> rendererFactories = new ArrayList<DataValueRendererFactory>(utilFac.getAvailableRenderers());
Collections.sort(rendererFactories, rendererFactoryComparator);
String[][] comboEntries = new String[utilFac.getAvailableRenderers().size()][2];
int i = 0;
for (DataValueRendererFactory rendFac : rendererFactories) {
comboEntries[i++] = new String[] { rendFac.getDescription(), rendFac.getId() };
}
ComboFieldEditor c = new ComboFieldEditor(utilFac.getPreferenceKey(), utilFac.getName(), comboEntries, section);
c.setEnabled(comboEntries.length > 1, section);
addField(c);
m_fieldEditors.put(utilFac.getPreferenceKey(), c);
}
// add a dummy control which occupies the second column so that the next expander is in a new row
new Label(getFieldEditorParent(), SWT.NONE);
}
DefaultScope.INSTANCE.getNode(FrameworkUtil.getBundle(DataValueRendererFactory.class).getSymbolicName()).addPreferenceChangeListener(this);
}
use of org.eclipse.ui.forms.widgets.Section in project cubrid-manager by CUBRID.
the class NoticeDashboardPage method createContentSections.
private void createContentSections(Composite left, Composite right) {
Section section;
section = createExpandableSection(left, Messages.titleAnnouncement, "Announcement");
section.setExpanded(true);
section = createExpandableSection(left, Messages.titleMajorFeatures, "MajorFeatures");
section.setExpanded(true);
section = createExpandableSection(left, Messages.titleTechTrends, "TechTrends");
section.setExpanded(true);
section = createExpandableSection(right, Messages.titleReleaseNews, "ReleaseNews");
section.setExpanded(true);
section = createExpandableSection(right, Messages.titleTutorials, "Tutorials");
section.setExpanded(true);
section = createExpandableSection(right, Messages.titleUsefulLinks, "UsefulLinks");
section.setExpanded(true);
}
use of org.eclipse.ui.forms.widgets.Section in project cubrid-manager by CUBRID.
the class NoticeDashboardPage method createSection.
private Section createSection(Composite parent, String title, String category, int sectionStyle) {
Section section = toolkit.createSection(parent, sectionStyle);
section.clientVerticalSpacing = 5;
section.setLayout(new GridLayout());
section.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
section.setText(title);
if (category != null) {
TableWrapLayout layout = new TableWrapLayout();
layout.numColumns = 1;
Composite composite = toolkit.createComposite(section, SWT.None);
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
section.setClient(composite);
FormText text = createFormText(composite);
formTexts.put(category, text);
}
sections.add(section);
return section;
}
use of org.eclipse.ui.forms.widgets.Section in project cubrid-manager by CUBRID.
the class NoticeDashboardPage method createActionSection.
@SuppressWarnings("unused")
private void createActionSection(Composite parent) {
Section section = createStaticSection(parent, Messages.titleCommonAction);
Composite composite = toolkit.createComposite(section);
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 2;
composite.setLayout(gridLayout);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
section.setClient(composite);
GridData data = new GridData(GridData.BEGINNING);
data.widthHint = 200;
ImageHyperlink addHost = toolkit.createImageHyperlink(composite, SWT.NONE);
addHost.setLayoutData(data);
addHost.setImage(CommonUIPlugin.getImageDescriptor("icons/action/host_add.png").createImage());
addHost.setText(Messages.titleAddHostBtn);
addHost.addHyperlinkListener(new IHyperlinkListener() {
public void linkExited(HyperlinkEvent e) {
}
public void linkEntered(HyperlinkEvent e) {
}
public void linkActivated(HyperlinkEvent e) {
ActionManager.getInstance().getAction("com.cubrid.cubridmanager.ui.host.action.AddHostAction").run();
}
});
ImageHyperlink connectHost = toolkit.createImageHyperlink(composite, SWT.NONE);
connectHost.setLayoutData(data);
connectHost.setImage(CommonUIPlugin.getImageDescriptor("icons/action/host_connect.png").createImage());
connectHost.setText(Messages.titleConHostBtn);
connectHost.addHyperlinkListener(new IHyperlinkListener() {
public void linkExited(HyperlinkEvent e) {
}
public void linkEntered(HyperlinkEvent e) {
}
public void linkActivated(HyperlinkEvent e) {
ActionManager.getInstance().getAction("com.cubrid.cubridmanager.ui.host.action.ConnectHostAction").run();
}
});
ImageHyperlink preferences = toolkit.createImageHyperlink(composite, SWT.NONE);
preferences.setLayoutData(data);
preferences.setImage(CommonUIPlugin.getImageDescriptor("icons/action/property.png").createImage());
preferences.setText(Messages.titlePreferencesBtn);
preferences.addHyperlinkListener(new IHyperlinkListener() {
public void linkExited(HyperlinkEvent e) {
}
public void linkEntered(HyperlinkEvent e) {
}
public void linkActivated(HyperlinkEvent e) {
ActionManager.getInstance().getAction("preferences").run();
}
});
ImageHyperlink help = toolkit.createImageHyperlink(composite, SWT.NONE);
help.setLayoutData(data);
help.setImage(CommonUIPlugin.getImageDescriptor("icons/action/help.png").createImage());
help.setText(Messages.titleHelpBtn);
help.addHyperlinkListener(new IHyperlinkListener() {
public void linkExited(HyperlinkEvent e) {
}
public void linkEntered(HyperlinkEvent e) {
}
public void linkActivated(HyperlinkEvent e) {
ActionManager.getInstance().getAction(HelpDocumentAction.ID).run();
}
});
}
use of org.eclipse.ui.forms.widgets.Section in project tesb-studio-se by Talend.
the class CamelDependenciesEditor method createTableViewer.
private CamelDependenciesPanel createTableViewer(Composite parent, FormToolkit toolkit, String title, String type) {
Section section = toolkit.createSection(parent, Section.TITLE_BAR);
section.setText(title);
final CamelDependenciesPanel c = (type == ManifestItem.BUNDLE_CLASSPATH) ? new CheckedCamelDependenciesPanel(section, type, isReadOnly(), this, this) : new CamelDependenciesPanel(section, type, isReadOnly(), this, this);
section.setClient(c);
toolkit.adapt(c);
return c;
}
Aggregations