/** * @see org.yakindu.sct.editor.sgen.extensions.IFeatureConfigurationSection#getSection() */ @Override public Section createSection(final FormToolkit toolkit, final Composite parent) { this.section = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE); this.section.setText(convertCamelCaseName(getFeatureType().getName(), !getFeatureType().isOptional())); this.section.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.FILL_GRAB)); final Composite composite = toolkit.createComposite(this.section); final TableWrapLayout layout = new TableWrapLayout(); layout.numColumns = 2; composite.setLayout(layout); for (final FeatureParameter parameter : getFeatureType().getParameters()) { final Control control = createParameterControl(toolkit, composite, parameter); this.controls.put(parameter, control); } this.section.setClient(composite); return this.section; }
private void createCountDownSection() { Section countDown = toolkit.createSection(form.getBody(), ExpandableComposite.TWISTIE | Section.DESCRIPTION| ExpandableComposite.TITLE_BAR); countDown.setText("Count Down Section"); countDown.setExpanded(true); countDown.setDescription("Time left in the match."); Composite countDownClient = toolkit.createComposite(countDown); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 5; gridLayout.makeColumnsEqualWidth = false; countDownClient.setLayout(gridLayout); hourCountDownLabel = toolkit.createLabel(countDownClient, "00"); toolkit.createLabel(countDownClient, ":"); minuteCountDownLabel = toolkit.createLabel(countDownClient, "00"); toolkit.createLabel(countDownClient, ":"); secondsCountDownLabel = toolkit.createLabel(countDownClient, "00"); countDown.setClient(countDownClient); }
private void createPlayerSection() { Section playersSection = toolkit.createSection(form.getBody(), ExpandableComposite.TWISTIE | Section.DESCRIPTION| ExpandableComposite.TITLE_BAR); playersSection.setText("Player Section"); playersSection.setExpanded(true); playersSection.setDescription("The players that are playing."); Composite playerClient = toolkit.createComposite(playersSection); GridLayout playerGridLayout = new GridLayout(); playerGridLayout.numColumns = 2; playerClient.setLayout(playerGridLayout); firstPlayerName = createPlayerNameField(playerClient, "Player 1: "); secondPlayerName = createPlayerNameField(playerClient, "Player 2: "); Button updateButton = toolkit.createButton(playerClient, "Update", SWT.PUSH | SWT.RESIZE); GridData updateButtonData = new GridData(); updateButtonData.horizontalSpan = 2; updateButtonData.widthHint = 60; updateButtonData.grabExcessHorizontalSpace = true; updateButton.setLayoutData(updateButtonData); updateButton.addSelectionListener(new PlayerNameUpdateButtonSelectionListener(this)); playersSection.setClient(playerClient); }
private void createScoringSection() { Section playersSection = toolkit.createSection(form.getBody(), ExpandableComposite.TWISTIE | Section.DESCRIPTION| ExpandableComposite.TITLE_BAR); playersSection.setText("Scoreboard Section"); playersSection.setExpanded(false); playersSection.setDescription("Current scores for the game"); Composite playerClient = toolkit.createComposite(playersSection); GridLayout playerGridLayout = new GridLayout(); playerGridLayout.numColumns = 2; playerClient.setLayout(playerGridLayout); firstPlayerScore = createPlayerNameField(playerClient, "Player 1: "); secondPlayerScore = createPlayerNameField(playerClient, "Player 2: "); Button updateButton = toolkit.createButton(playerClient, "Update", SWT.PUSH | SWT.RESIZE); GridData updateButtonData = new GridData(); updateButtonData.horizontalSpan = 2; updateButtonData.widthHint = 60; updateButtonData.grabExcessHorizontalSpace = true; updateButton.setLayoutData(updateButtonData); updateButton.addSelectionListener(new PlayerScoreUpdateButtonSelectionListener2(this)); playersSection.setClient(playerClient); }
private void createMapSection() { Section mapSection = toolkit.createSection(form.getBody(), ExpandableComposite.TWISTIE | Section.DESCRIPTION | ExpandableComposite.TITLE_BAR); mapSection.setText("Skirmish Maps"); mapSection.setExpanded(true); mapSection.setDescription("A list of available skirmish maps."); Composite mapComposite = toolkit.createComposite(mapSection); GridLayout squadGridLayout = new GridLayout(); squadGridLayout.numColumns = 3; mapComposite.setLayout(squadGridLayout); listViewer = new ListViewer(mapComposite, SWT.WRAP | SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL); listViewer.add(SkirmishMapsLookup.getInstance().getMaps().toArray()); listViewer.addSelectionChangedListener(new LoadMapImageSelectionListener()); GridData mapSize = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 5); mapSize.minimumHeight = 300; mapSize.heightHint = 300; listViewer.getList().setLayoutData(mapSize); mapSection.setClient(mapComposite); }
private void initAdditionalParametersUi() { ExpandableComposite exp = new ExpandableComposite(this, ExpandableComposite.COMPACT); exp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1)); additonalParameters = new Text(exp, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL); additonalParameters.setLayoutData(new GridData(GridData.FILL_BOTH)); additonalParameters.setToolTipText("Advanced parameters for Text2Image - use key=value format in each line!"); // advancedParameters.setText("hyphen=null\n"); // advancedPropertiesTable = buildPropertyTable(exp, true); exp.setClient(additonalParameters); exp.setText("Additional Parameters"); // Fonts.setBoldFont(exp); exp.setExpanded(true); exp.addExpansionListener(new ExpansionAdapter() { public void expansionStateChanged(ExpansionEvent e) { layout(); } }); }
private void initRecogTools() { ExpandableComposite exp = new ExpandableComposite(this, ExpandableComposite.COMPACT); exp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); trComp = new TextRecognitionComposite(exp, 0); trComp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1)); exp.setClient(trComp); exp.setText("Text Recognition"); Fonts.setBoldFont(exp); exp.setExpanded(true); exp.addExpansionListener(new ExpansionAdapter() { public void expansionStateChanged(ExpansionEvent e) { layout(); } }); }
public void selectOption(Key key) { Control control = findControl(key); if (control != null) { if (!fExpandedComposites.isEmpty()) { ExpandableComposite expandable = getParentExpandableComposite(control); if (expandable != null) { for (int i = 0; i < fExpandedComposites.size(); i++) { ExpandableComposite curr = (ExpandableComposite) fExpandedComposites.get(i); curr.setExpanded(curr == expandable); } expandedStateChanged(expandable); } } control.setFocus(); } }
protected ExpandableComposite createStyleSection(Composite parent, String label, int nColumns) { ExpandableComposite excomposite = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT); excomposite.setText(label); 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; }
public void createSection(Composite parent) { // Don't create section if CF server is not the Pivotal CF server if (!CloudFoundryURLNavigation.canEnableCloudFoundryNavigation(getCloudFoundryServer())) { return; } super.createSection(parent); FormToolkit toolkit = getFormToolkit(parent.getDisplay()); Section section = toolkit.createSection(parent, ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); section.setText(Messages.SpringInsightSection_TEXT_SPRING_INSIGHT); section.setExpanded(false); Composite composite = toolkit.createComposite(section); section.setClient(composite); GridLayoutFactory.fillDefaults().numColumns(1).margins(10, 5).applyTo(composite); GridDataFactory.fillDefaults().grab(true, false).applyTo(composite); new GoToSpringLinkWidget(composite, toolkit).createControl(); }
protected ExpandableComposite createStyleSection(Composite parent, String label, int nColumns) { ExpandableComposite excomposite = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT); excomposite.setText(label); 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() { @Override public void expansionStateChanged(ExpansionEvent e) { expandedStateChanged((ExpandableComposite) e.getSource()); } }); expandedComposites.add(excomposite); makeScrollableCompositeAware(excomposite); return excomposite; }
private Composite createProblemCategory(Composite parent, String label) { // Expandable panel for each category of problems ExpandableComposite expandPanel = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT); expandPanel.setText(label); expandPanel.setExpanded(false); expandPanel.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); expandPanel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false)); expandPanel.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent e) { topPanel.layout(true, true); scrollPanel.setMinSize(topPanel.computeSize(SWT.DEFAULT, SWT.DEFAULT)); } }); // Create panel to store the actual problems Composite categoryPanel = new Composite(expandPanel, SWT.NONE); categoryPanel.setLayout(new GridLayout(2, false)); expandPanel.setClient(categoryPanel); return categoryPanel; }
/** * Creates an individual diff viewer in the given composite. */ private void createDiffViewer(final FormToolkit toolkit, Composite composite, final TaskAttribute diffTaskAttribute) { int style = ExpandableComposite.TREE_NODE | ExpandableComposite.LEFT_TEXT_CLIENT_ALIGNMENT | ExpandableComposite.COMPACT; ExpandableComposite diffComposite = toolkit.createExpandableComposite(composite, style); diffComposite.clientVerticalSpacing = 0; diffComposite.setLayout(new GridLayout()); diffComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); diffComposite.setTitleBarForeground(toolkit.getColors().getColor(IFormColors.TITLE)); diffComposite.setText(calculateDiffChangeHeader(diffTaskAttribute)); final Composite diffViewerComposite = toolkit.createComposite(diffComposite); diffComposite.setClient(diffViewerComposite); diffViewerComposite.setLayout( new FillWidthLayout(EditorUtil.getLayoutAdvisor(getTaskEditorPage()), 15, 0, 0, 3)); diffComposite.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent event) { expandCollapseDiff(toolkit, diffViewerComposite, diffTaskAttribute, event.getState()); } }); GridDataFactory.fillDefaults().grab(true, false).applyTo(diffComposite); }
/** * @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, * org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) */ public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) { super.createControls(parent, tabbedPropertySheetPage); Composite group = getWidgetFactory().createSection(parent, com.jaspersoft.studio.messages.Messages.SubTitleSection_Subtitle_Label, true, 2); section = (ExpandableComposite)group.getParent(); getWidgetFactory().createCLabel(group, com.jaspersoft.studio.messages.Messages.SubTitleSection_Expression_Label); createWidget4Property(group, JRDesignChart.PROPERTY_SUBTITLE_EXPRESSION, false); getWidgetFactory().createCLabel(group, com.jaspersoft.studio.messages.Messages.SubTitleSection_Color_Label); createWidget4Property(group, JRBaseChart.PROPERTY_SUBTITLE_COLOR, false); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2; createWidget4Property(group, JRDesignChart.PROPERTY_SUBTITLE_FONT, false).getControl().setLayoutData(gd); }
@Override public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) { super.createControls(parent, aTabbedPropertySheetPage); Composite group = getWidgetFactory().createComposite(parent); group.setLayout(new GridLayout(2, false)); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2; createWidget4Property(group, TitleSettings.PROPERTY_showTitle, false).getControl().setLayoutData(gd); createWidget4Property(group, TitleSettings.PROPERTY_position); createWidget4Property(group, TitleSettings.PROPERTY_horizontalAlignment); createWidget4Property(group, TitleSettings.PROPERTY_verticalAlignment); createWidget4Property(group, TitleSettings.PROPERTY_foregroundPaint); createWidget4Property(group, TitleSettings.PROPERTY_backgroundPaint); Composite paddingComposite = PadUtil.createWidgets4Property(parent, "", com.jaspersoft.studio.messages.Messages.common_padding, this); paddingSection = (ExpandableComposite)paddingComposite.getParent(); }
@Override public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) { super.createControls(parent, aTabbedPropertySheetPage); Composite group = getWidgetFactory().createComposite(parent); group.setLayout(new GridLayout(2, false)); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2; createWidget4Property(group, LegendSettings.PROPERTY_showLegend, false).getControl().setLayoutData(gd); createWidget4Property(group, LegendSettings.PROPERTY_position); createWidget4Property(group, LegendSettings.PROPERTY_horizontalAlignment); createWidget4Property(group, LegendSettings.PROPERTY_verticalAlignment); createWidget4Property(group, LegendSettings.PROPERTY_foregroundPaint); createWidget4Property(group, LegendSettings.PROPERTY_backgroundPaint); Composite paddingComposite = PadUtil.createWidgets4Property(parent, LegendSettings.PROPERTY_blockFrame, "Block Frame", this); paddingSection = (ExpandableComposite)paddingComposite.getParent(); }
/** * @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, * org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) */ public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) { super.createControls(parent, tabbedPropertySheetPage); Composite group = getWidgetFactory().createSectionTitle(parent, Messages.TitleSection_0, true, 4, 1); section = (ExpandableComposite)group.getParent(); getWidgetFactory().createCLabel(group, Messages.TitleSection_1); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 3; createWidget4Property(group, StandardChartSettings.PROPERTY_TITLE_EXPRESSION, false) .getControl().setLayoutData(gd); createWidget4Property(group, StandardChartSettings.PROPERTY_TITLE_POSITION); createWidget4Property(group, StandardChartSettings.PROPERTY_TITLE_COLOR); gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 4; createWidget4Property(group, StandardChartSettings.PROPERTY_TITLE_FONT, false).getControl().setLayoutData(gd); }
/** * @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, * org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) */ public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) { super.createControls(parent, tabbedPropertySheetPage); Composite group = getWidgetFactory().createSectionTitle(parent, Messages.SubTitleSection_0, true, 2, 1); section = (ExpandableComposite)group.getParent(); getWidgetFactory().createCLabel(group, Messages.SubTitleSection_1); createWidget4Property(group, StandardChartSettings.PROPERTY_SUBTITLE_EXPRESSION, false); getWidgetFactory().createCLabel(group, Messages.SubTitleSection_2); createWidget4Property(group, StandardChartSettings.PROPERTY_SUBTITLE_COLOR, false); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2; createWidget4Property(group, StandardChartSettings.PROPERTY_SUBTITLE_FONT, false) .getControl().setLayoutData(gd); }
/** * @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, * org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) */ public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) { super.createControls(parent, tabbedPropertySheetPage); parent = getWidgetFactory().createSection(parent, "Paragraph", true, 2); section = (ExpandableComposite)parent.getParent(); createWidget4Property(parent, JRBaseParagraph.PROPERTY_LINE_SPACING); createWidget4Property(parent, JRBaseParagraph.PROPERTY_LINE_SPACING_SIZE); createWidget4Property(parent, JRBaseParagraph.PROPERTY_FIRST_LINE_INDENT); createWidget4Property(parent, JRBaseParagraph.PROPERTY_LEFT_INDENT); createWidget4Property(parent, JRBaseParagraph.PROPERTY_RIGHT_INDENT); createWidget4Property(parent, JRBaseParagraph.PROPERTY_SPACING_BEFORE); createWidget4Property(parent, JRBaseParagraph.PROPERTY_SPACING_AFTER); createWidget4Property(parent, JRBaseParagraph.PROPERTY_TAB_STOP_WIDTH); }
/** * @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, * org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) */ public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) { super.createControls(parent, tabbedPropertySheetPage); parent = getWidgetFactory().createSection(parent, Messages.SizeSection_sizeSectionTitle, true, 4); section = (ExpandableComposite)parent.getParent(); ASPropertyWidget hw = createWidget4Property(parent, JRDesignElement.PROPERTY_WIDTH); CLabel lbl = hw.getLabel(); lbl.setText(Messages.SizeSection_widthLabel); lbl.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); hw = createWidget4Property(parent, JRDesignElement.PROPERTY_HEIGHT); lbl = hw.getLabel(); lbl.setText(Messages.SizeSection_heightLabel); lbl.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); ASPropertyWidget w = createWidget4Property(parent, JRDesignElement.PROPERTY_STRETCH_TYPE); GridData gd = new GridData(); gd.horizontalSpan = 3; w.getControl().setLayoutData(gd); }
public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) { super.createControls(parent, tabbedPropertySheetPage); String anchorNameProperty = getAnchorNameProperty(); String bookmarkLevelProperty = getBookmarkLevelProperty(); if (bookmarkLevelProperty != null || anchorNameProperty != null){ parent = getWidgetFactory().createSection(parent, Messages.BookmarkSection_bookmarkSectionTitle, true, 2); section = (ExpandableComposite)parent.getParent(); parent.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); if (anchorNameProperty != null) { ASPropertyWidget exp = createWidget4Property(parent, anchorNameProperty, true); exp.getControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); } if (bookmarkLevelProperty != null){ createWidget4Property(parent,bookmarkLevelProperty, true); section.setExpanded(false); } } }
/** * @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, * org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) */ public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) { super.createControls(parent, tabbedPropertySheetPage); parent = getWidgetFactory().createSection(parent, Messages.LocationSection_locationLabel, true, 4); section = (ExpandableComposite)parent.getParent(); ASPropertyWidget pw = createWidget4Property(parent, JRDesignElement.PROPERTY_X); CLabel lbl = pw.getLabel(); lbl.setText(Messages.LocationSection_xCoordinateLabel); lbl.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); pw = createWidget4Property(parent, JRDesignElement.PROPERTY_Y); lbl = pw.getLabel(); lbl.setText(Messages.LocationSection_yCoordinateLabel); lbl.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); ASPropertyWidget w = createWidget4Property(parent, JRDesignElement.PROPERTY_POSITION_TYPE); GridData gd = new GridData(); gd.horizontalSpan = 3; w.getControl().setLayoutData(gd); }
/** * @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, * org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) */ public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) { super.createControls(parent, tabbedPropertySheetPage); parent = getWidgetFactory().createSection(parent, Messages.ColorsSection_colorSectionTitle, true, 4); section = (ExpandableComposite)parent.getParent(); //parent.setLayout(new GridLayout(4, false)); createWidget4Property(parent, JRBaseStyle.PROPERTY_FORECOLOR); createWidget4Property(parent, JRBaseStyle.PROPERTY_BACKCOLOR); Composite transparencyComp = new Composite(parent, SWT.NONE); GridLayout transparencyLayout = new GridLayout(2,false); transparencyLayout.marginWidth = 0; transparencyComp.setLayout(transparencyLayout); GridData gd = new GridData(); gd.horizontalSpan = 4; transparencyComp.setLayoutData(gd); createWidget4Property(transparencyComp, JRBaseStyle.PROPERTY_MODE,false); }
/** * @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, * org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) */ public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) { super.createControls(parent, tabbedPropertySheetPage); parent.setLayout(new GridLayout(2, false)); IPropertyDescriptor pd = getPropertyDesriptor(JRDesignElementDataset.PROPERTY_INCREMENT_TYPE); IPropertyDescriptor gpd = getPropertyDesriptor(JRDesignElementDataset.PROPERTY_INCREMENT_GROUP); getWidgetFactory().createCLabel(parent, pd.getDisplayName()); widgets.put(pd.getId(), new SPIncrementType(parent, this, pd, gpd)); createWidget4Property(parent, JRDesignElementDataset.PROPERTY_INCREMENT_WHEN_EXPRESSION); pd = getPropertyDesriptor(JRDesignElementDataset.PROPERTY_RESET_TYPE); gpd = getPropertyDesriptor(JRDesignElementDataset.PROPERTY_RESET_GROUP); getWidgetFactory().createCLabel(parent, pd.getDisplayName()); widgets.put(pd.getId(), new SPResetType(parent, this, pd, gpd)); Composite group = getWidgetFactory().createSection(parent, "Dataset Run", true, 2, 2); datasetRunSection = (ExpandableComposite)group.getParent(); createWidget4Property(group, JRDesignElementDataset.PROPERTY_DATASET_RUN); }
private void createBackCompatibilitySection() { Section backCompatibilitySection = new Section(this, ExpandableComposite.TREE_NODE); GridData backCompSectionGD = new GridData(SWT.FILL,SWT.FILL,true,false); backCompSectionGD.verticalIndent=10; backCompatibilitySection.setLayoutData(backCompSectionGD); backCompatibilitySection.setLayout(new FillLayout()); backCompatibilitySection.setText(Messages.JavaExpressionEditorComposite_BackCompatibilitySection); Composite composite = new Composite(backCompatibilitySection, SWT.NONE); composite.setLayout(new GridLayout(2, false)); Label lbl1 = new Label(composite, SWT.NONE); lbl1.setText(Messages.JavaExpressionEditorComposite_ValueClassMessage); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2; lbl1.setLayoutData(gd); valueType = new ClassType(composite, Messages.JavaExpressionEditorComposite_ClassTypeDialogTitle); valueType.addListener(new ModifyListener() { public void modifyText(ModifyEvent e) { valueClassName = valueType.getClassType(); } }); backCompatibilitySection.setClient(composite); }
/** * Adds a standardized section to the form part. This is intended to give a unified look and feel to the forms parts. * * @param parent * component to contribute to * @param text * title of the section * @param icon * image to set in the section * @return Section object */ public static Section createSection(FormToolkit toolkit, Composite parent, String text, Image icon, int style) { style = style | (text == null ? ExpandableComposite.NO_TITLE : ExpandableComposite.TITLE_BAR); Section section = toolkit.createSection(parent, style); if (icon != null) { Label label = toolkit.createLabel(section, ""); label.setImage(icon); section.setTextClient(label); } GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, false); layoutData.horizontalSpan = 2; layoutData.verticalIndent = 6; section.setLayoutData(layoutData); if (text != null) { section.setText(text); } return section; }
public void selectOption(Key key) { Control control= findControl(key); if (control != null) { if (!fExpandableComposites.isEmpty()) { ExpandableComposite expandable= getParentExpandableComposite(control); if (expandable != null) { for (int i= 0; i < fExpandableComposites.size(); i++) { ExpandableComposite curr= fExpandableComposites.get(i); curr.setExpanded(curr == expandable); } expandedStateChanged(expandable); } } control.setFocus(); } }
protected ExpandableComposite createStyleSection(Composite parent, String label, int nColumns, Key key) { ExpandableComposite excomposite= new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT); excomposite.setText(label); if (key != null) { excomposite.setData(key); } 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() { @Override public void expansionStateChanged(ExpansionEvent e) { expandedStateChanged((ExpandableComposite) e.getSource()); } }); fExpandableComposites.add(excomposite); makeScrollableCompositeAware(excomposite); return excomposite; }
protected void createGeneralInformation() { Section generalInformation = toolkit.createSection(form.getBody(), ExpandableComposite.TITLE_BAR | Section.DESCRIPTION); generalInformation.setText(EditorMessages.getString("ApexMetadataFormPage.GeneralInformationSection")); //$NON-NLS-1$ generalInformation.setDescription(EditorMessages .getString("ApexMetadataFormPage.GeneralInformationSection.Description")); //$NON-NLS-1$ Composite sectionClient = toolkit.createComposite(generalInformation); sectionClient.setLayout(new GridLayout(2, false)); // Label labelText = new TextFieldWidget(toolkit, "Label", ""); labelText.addTo(sectionClient); // Description descriptionText = new TextFieldWidget(toolkit, "Description", ""); descriptionText.addTo(sectionClient); // Api Version apiText = new TextFieldWidget(toolkit, EditorMessages.getString("ApexMetadataFormPage.APIVersionLabel"), "0.0"); //$NON-NLS-1$ //$NON-NLS-2$ apiText.addTo(sectionClient); generalInformation.setClient(sectionClient); }
@Override protected void createGeneralInformation() { Section generalInformation = toolkit.createSection(form.getBody(), ExpandableComposite.TITLE_BAR | Section.DESCRIPTION); generalInformation.setText(EditorMessages.getString("ApexMetadataFormPage.GeneralInformationSection")); //$NON-NLS-1$ generalInformation.setDescription(EditorMessages .getString("ApexMetadataFormPage.GeneralInformationSection.Description")); //$NON-NLS-1$ Composite sectionClient = toolkit.createComposite(generalInformation); sectionClient.setLayout(new GridLayout(2, false)); // Api Version apiText = new TextFieldWidget(toolkit, EditorMessages.getString("ApexMetadataFormPage.APIVersionLabel"), "0.0"); //$NON-NLS-1$ //$NON-NLS-2$ apiText.addTo(sectionClient); generalInformation.setClient(sectionClient); }
@Override protected void createGeneralInformation() { Section generalInformation = toolkit.createSection(form.getBody(), ExpandableComposite.TITLE_BAR | Section.DESCRIPTION); generalInformation.setText(EditorMessages.getString("ApexMetadataFormPage.GeneralInformationSection")); //$NON-NLS-1$ generalInformation.setDescription(EditorMessages .getString("ApexMetadataFormPage.GeneralInformationSection.Description")); //$NON-NLS-1$ Composite sectionClient = toolkit.createComposite(generalInformation); sectionClient.setLayout(new GridLayout(2, false)); // Api Version apiText = new TextFieldWidget(toolkit, EditorMessages.getString("ApexMetadataFormPage.APIVersionLabel"), "0.0"); //$NON-NLS-1$ //$NON-NLS-2$ apiText.addTo(sectionClient); // Status statusCombo = new ComboWidget<>(toolkit, EditorMessages.getString("ApexMetadataFormPage.StatusLabel"), ApexCodeUnitStatus.ACTIVE); //$NON-NLS-1$ statusCombo.addTo(sectionClient); generalInformation.setClient(sectionClient); }
private void fillBody(IManagedForm managedForm) { Composite body = managedForm.getForm().getBody(); TableWrapLayout layout = new TableWrapLayout(); //CheckStyle:MagicNumber| OFF layout.bottomMargin = 10; layout.topMargin = 5; layout.leftMargin = 10; layout.rightMargin = 10; layout.numColumns = 2; layout.makeColumnsEqualWidth = true; layout.verticalSpacing = 30; layout.horizontalSpacing = 10; //CheckStyle:MagicNumber| ON body.setLayout(layout); // sections managedForm.addPart(new IvyInfoSection(this, body, ExpandableComposite.TWISTIE, true)); managedForm.addPart(new IvyConfSection(this, body, ExpandableComposite.TWISTIE, true)); }
public void showChild(Object childSource){ if(childSource == null){ return; } for(CompositeContainerChild child : getChilds()){ if(childSource.equals(child.getSource())){ Composite childComposite = child.getComposite(); if(childComposite instanceof ExpandableComposite){ ExpandableComposite ec = (ExpandableComposite)childComposite; ec.setExpanded(true); composite.layout(); composite.redraw(); composite.pack(); } showControl(child.getComposite()); } } }
private void createSecondSection( ScrolledForm form, FormToolkit toolkit) { ExpandableComposite ec = toolkit.createExpandableComposite(form.getBody(), ExpandableComposite.TREE_NODE| ExpandableComposite.CLIENT_INDENT); ec.setText("Expandable Composite title"); String ctext = "We will now create a somewhat long text so that "+ "we can use it as content for the expandable composite. "+ "Expandable composite is used to hide or show the text using the " + "toggle control"; Label client = toolkit.createLabel(ec, ctext, SWT.WRAP); ec.setClient(client); TableWrapData td = new TableWrapData(); td.colspan = 2; ec.setLayoutData(td); ec.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent e) { form.reflow(true); } }); }
private void createPlanSection(Composite composite) { // Section planSection = toolkit.createSection(composite, Section.TITLE_BAR | ExpandableComposite.EXPANDED); // Composite planComposite = toolkit.createComposite(planSection, SWT.NULL); planComposite = toolkit.createComposite(planSection, SWT.NULL); planSection.setText("Plan"); planSection.setLayout(new GridLayout(1, Boolean.TRUE)); planSection.setLayoutData(new GridData(SWT.FILL, SWT.FILL, Boolean.TRUE, Boolean.TRUE)); planSection.marginHeight = 20; planSection.titleBarTextMarginWidth = 20; planComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, Boolean.TRUE, Boolean.TRUE)); planComposite.setLayout(new GridLayout(1, Boolean.TRUE)); planSection.setClient(planComposite); createReleasesSection(planComposite); createTitleSection(planComposite); createIterationsSection(planComposite); }
public static Composite createStaticSection( final FormToolkit toolkit, final Composite parent, final String sectionTitle, final String sectionDescription, final int numOfColumns ) { Section section; section = toolkit.createSection( parent, ExpandableComposite.TITLE_BAR | Section.DESCRIPTION | SWT.WRAP ); section.setText( sectionTitle ); section.setDescription( sectionDescription ); toolkit.createCompositeSeparator( section ); section.setLayout( AlignFormLayoutFactory.createClearTableWrapLayout( false, 1 ) ); TableWrapData data = new TableWrapData( TableWrapData.FILL_GRAB ); section.setLayoutData( data ); Composite client = toolkit.createComposite( section ); client.setLayout( AlignFormLayoutFactory.createSectionClientTableWrapLayout( false, numOfColumns ) ); section.setClient( client ); return client; }
public static Composite createHtmlSection( final FormToolkit toolkit, final Composite parent, final String sectionTitle) { Section section = toolkit.createSection( parent, ExpandableComposite.TITLE_BAR | Section.DESCRIPTION | ExpandableComposite.TWISTIE | SWT.WRAP ); section.setText(sectionTitle); TableWrapData td = new TableWrapData(); td.grabHorizontal = true; td.heightHint = 400; //added section.setLayoutData(td); section.setExpanded( false ); Composite client = toolkit.createComposite( section ); section.setClient( client ); return client; }