Java 类org.eclipse.ui.forms.widgets.ExpandableComposite 实例源码

项目:arduino_sct_tools    文件:GenericFeatureConfigurationSection.java   
/**
 * @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;
}
项目:xstreamer    文件:CountDownTimerPage.java   
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);
}
项目:xstreamer    文件:GeneralFormPage.java   
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);
}
项目:xstreamer    文件:GeneralFormPage.java   
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);
}
项目:xstreamer    文件:MapsFormPage.java   
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);
}
项目:TranskribusSwtGui    文件:Text2ImageConfComposite.java   
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();
            }
        });
    }
项目:TranskribusSwtGui    文件:ToolsWidget.java   
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();
        }
    });
}
项目:typescript.java    文件:OptionsConfigurationBlock.java   
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();
    }
}
项目:typescript.java    文件:OptionsConfigurationBlock.java   
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;
}
项目:cft    文件:SpringInsightSection.java   
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();

    }
项目:bts    文件:OptionsConfigurationBlock.java   
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;
}
项目:gwt-eclipse-plugin    文件:ErrorsWarningsPage.java   
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;
}
项目:git-appraise-eclipse    文件:AppraiseDiffViewerPart.java   
/**
 * 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);
}
项目:PDFReporter-Studio    文件:SubTitleSection.java   
/**
 * @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);
}
项目:PDFReporter-Studio    文件:TitleSettingsSection.java   
@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();
}
项目:PDFReporter-Studio    文件:LegendSettingsSection.java   
@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();
}
项目:PDFReporter-Studio    文件:TitleSection.java   
/**
 * @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);
}
项目:PDFReporter-Studio    文件:SubTitleSection.java   
/**
 * @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);
}
项目:PDFReporter-Studio    文件:ParagraphSection.java   
/**
 * @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);
}
项目:PDFReporter-Studio    文件:SizeSection.java   
/**
 * @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);
}
项目:PDFReporter-Studio    文件:BookmarkSection.java   
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);
        }
    }
}
项目:PDFReporter-Studio    文件:LocationSection.java   
/**
 * @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);
}
项目:PDFReporter-Studio    文件:ColorsSection.java   
/**
 * @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);
}
项目:PDFReporter-Studio    文件:DatasetSection.java   
/**
 * @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);
}
项目:PDFReporter-Studio    文件:JavaExpressionEditorComposite.java   
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);
}
项目:OpenSPIFe    文件:DetailFormToolkit.java   
/**
 * 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;
}
项目:Eclipse-Postfix-Code-Completion    文件:OptionsConfigurationBlock.java   
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();
    }
}
项目:Eclipse-Postfix-Code-Completion    文件:OptionsConfigurationBlock.java   
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;
}
项目:idecore    文件:ApexComponentPropertySheet.java   
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);
}
项目:idecore    文件:ApexClassPropertySheet.java   
@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);
}
项目:idecore    文件:ApexTriggerPropertySheet.java   
@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);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:OptionsConfigurationBlock.java   
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();
    }
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:OptionsConfigurationBlock.java   
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;
}
项目:ant-ivyde    文件:OverviewFormPage.java   
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));
}
项目:Environment    文件:CompositeContainer.java   
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());
        }
    }
}
项目:codeexamples-eclipse    文件:FormsPart.java   
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);
          }
         });


}
项目:redmine.rap    文件:PlanView.java   
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);
    }
项目:align-api-project    文件:AlignFormSectionFactory.java   
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;
}
项目:align-api-project    文件:AlignFormSectionFactory.java   
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;
 }
项目:eclipse.spellchecker    文件:OptionsConfigurationBlock.java   
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();
    }
}