本文整理汇总了Java中org.eclipse.ui.forms.widgets.Section.setExpanded方法的典型用法代码示例。如果您正苦于以下问题:Java Section.setExpanded方法的具体用法?Java Section.setExpanded怎么用?Java Section.setExpanded使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.forms.widgets.Section
的用法示例。
在下文中一共展示了Section.setExpanded方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCountDownSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
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);
}
示例2: createPlayerSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
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);
}
示例3: createScoringSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
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);
}
示例4: createMapSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
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);
}
示例5: createSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
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();
}
示例6: createHtmlSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
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;
}
示例7: createGlobalParamterSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
private void createGlobalParamterSection(Composite body) {
Section section = UI.section(body, toolkit, M.GlobalParameters);
Composite client = UI.sectionClient(section, toolkit);
UI.gridLayout(client, 1);
String[] columns = { M.Name, M.Value,
M.Uncertainty, M.Description };
TableViewer table = Tables.createViewer(client, columns);
ParameterLabel label = new ParameterLabel();
table.setLabelProvider(label);
Viewers.sortByLabels(table, label, 0, 2, 3);
Viewers.sortByDouble(table, (Parameter p) -> p.getValue(), 1);
Tables.bindColumnWidths(table.getTable(), 0.4, 0.3);
table.getTable().getColumns()[1].setAlignment(SWT.RIGHT);
section.setExpanded(false);
setGlobalTableInput(table);
bindGlobalParamActions(section, table);
}
示例8: render
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
void render(Composite body, FormToolkit toolkit) {
log.trace("render flow-use-section for flow {}", flow);
FlowDao dao = new FlowDao(database);
Set<Long> recipients = dao.getWhereInput(flow.getId());
Set<Long> providers = dao.getWhereOutput(flow.getId());
if (recipients.isEmpty() && providers.isEmpty())
return;
Section section = UI.section(body, toolkit, M.UsedInProcesses);
section.setExpanded(false);
parent = UI.sectionClient(section, toolkit);
this.toolkit = toolkit;
App.runInUI("Render usage links", () -> {
renderLinks(M.ConsumedBy, recipients, Icon.INPUT.get());
renderLinks(M.ProducedBy, providers, Icon.OUTPUT.get());
});
}
示例9: createClient
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
protected void createClient(Section section, FormToolkit toolkit) {
section.setText(getText());
section.setDescription(getDescription());
section.setExpanded(isSectionExpanded());
text = toolkit.createFormText(section, false);
text.setColor(getRedKey(),toolkit.getColors().getColor(getRedKey()));
try { text.setText(getTextContent(), true, false); }
catch (SWTException e) { text.setText("", false, false); } //$NON-NLS-1$
// text.setImage("page", image);
section.setClient(text);
section.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
text.addHyperlinkListener(this);
text.setColor(getRedKey(),toolkit.getColors().getColor(getRedKey()));
text.setColor(getBlueKey(),toolkit.getColors().getColor(getBlueKey()));
text.setColor(getGreenKey(),toolkit.getColors().getColor(getGreenKey()));
text.setColor(getYellowKey(),toolkit.getColors().getColor(getYellowKey()));
}
示例10: createSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
private Composite createSection(FormToolkit toolkit, final ScrolledForm form, String sectionTitle,
String sectionDescription) {
Section section = toolkit.createSection(form.getBody(),
sectionDescription == null ? Section.TITLE_BAR : Section.TITLE_BAR | Section.DESCRIPTION);
section.setText(sectionTitle);
if(sectionDescription != null)
section.setDescription(sectionDescription);
section.setExpanded(true);
Composite sectionClient = toolkit.createComposite(section);
section.setClient(sectionClient);
return sectionClient;
}
示例11: toggleContainingSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
public static void toggleContainingSection(final Composite composite) {
final Section section = getContainingSection(composite);
if (section != null) {
section.setExpanded(false);
section.setExpanded(true);
}
}
示例12: createMapSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
private void createMapSection() {
Section mapSection = toolkit.createSection(form.getBody(),
ExpandableComposite.TWISTIE | Section.DESCRIPTION | ExpandableComposite.TITLE_BAR);
mapSection.setText("Conditions and Damage Decks");
mapSection.setExpanded(true);
mapSection.setDescription("This section shows a list of Damage Decks, and Condition cards. Use the tool bar to toggle which deck is shown.");
Composite mapComposite = toolkit.createComposite(mapSection);
GridLayout squadGridLayout = new GridLayout();
squadGridLayout.numColumns = 3;
mapComposite.setLayout(squadGridLayout);
listViewer = new XStreamerListViewer(mapComposite, SWT.WRAP | SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL);
Map<String, Object> miscellaneousCards = us.nineworlds.xstreamer.core.Activator.getDefault().getExtraCardsModel().getMiscellaneousCards();
List<Object> damageCardsTFA = (List<Object>) miscellaneousCards.get("Damage Deck TFA");
listViewer.add(damageCardsTFA.toArray());
listViewer.addSelectionChangedListener(new LoadOtherCardsImageSelectionListener());
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);
}
示例13: createArmySection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
private void createArmySection() {
Section squadSection = toolkit.createSection(form.getBody(),
ExpandableComposite.TWISTIE | Section.DESCRIPTION | ExpandableComposite.TITLE_BAR);
String points = "";
squadSection.setText("Army - Total Points " + points);
squadSection.setExpanded(true);
squadSection.setDescription("This contains the player's army");
Composite squadComposite = toolkit.createComposite(squadSection);
GridLayout squadGridLayout = new GridLayout();
squadGridLayout.numColumns = 3;
squadComposite.setLayout(squadGridLayout);
treeViewer = new TreeViewer(squadComposite, SWT.WRAP | SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL);
treeViewer.setContentProvider(new ArmyContentProvider());
treeViewer.setLabelProvider(new ArmyLabelProvider());
treeViewer.setInput(getPlayerModel());
treeViewer.addSelectionChangedListener(new ArmySelectionChangeListener());
GridData treeSize = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 5);
treeSize.minimumHeight = 300;
treeSize.heightHint = 300;
treeViewer.getTree().setLayoutData(treeSize);
Tree tree = treeViewer.getTree();
tree.addListener(SWT.Resize, new Listener() {
@Override
public void handleEvent(Event arg0) {
Point size = tree.getSize();
if (size.x > 300) {
tree.setSize(300, size.y);
}
}
});
squadSection.setClient(squadComposite);
}
示例14: createRoutesDomainsSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
private void createRoutesDomainsSection() {
Section routeSection = toolkit.createSection(getSection().getParent(), Section.TITLE_BAR | Section.TWISTIE);
routeSection.setLayout(new GridLayout());
GridDataFactory.fillDefaults().grab(true, true).applyTo(routeSection);
routeSection.setText(Messages.ApplicationMasterPart_TEXT_ROUTES);
routeSection.setExpanded(true);
routeSection.clientVerticalSpacing = 0;
Composite client = toolkit.createComposite(routeSection);
client.setLayout(new GridLayout(1, false));
GridDataFactory.fillDefaults().grab(true, true).applyTo(client);
routeSection.setClient(client);
Button button = toolkit.createButton(client, Messages.ApplicationMasterPart_TEXT_REMOVE_BUTTON, SWT.PUSH);
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(button);
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
UIJob uiJob = new UIJob(Messages.ApplicationMasterPart_JOB_REMOVE_ROUTE) {
public IStatus runInUIThread(IProgressMonitor monitor) {
CloudRoutesWizard wizard = new CloudRoutesWizard(cloudServer);
WizardDialog dialog = new WizardDialog(editorPage.getEditorSite().getShell(), wizard);
dialog.open();
return Status.OK_STATUS;
}
};
uiJob.setSystem(true);
uiJob.setPriority(Job.INTERACTIVE);
uiJob.schedule();
}
});
}
示例15: regenerateSection
import org.eclipse.ui.forms.widgets.Section; //导入方法依赖的package包/类
protected void regenerateSection(final String sectionID) {
final Section section = sectionMap.get(sectionID);
boolean expandedState = true;
if (section != null) {
expandedState = section.isExpanded();
}
sectionMap.remove(sectionID);
final Composite parentComposite = getParentComposite();
final Control[] children = parentComposite.getChildren();
for (int i = 0; i < children.length; i++) {
if (children[i] == section) {
final TeamExplorerSectionConfig sectionConfig =
(TeamExplorerSectionConfig) section.getData(SECTION_CONFIG_DATA_NAME);
final ITeamExplorerSection sectionInstance =
(ITeamExplorerSection) section.getData(SECTION_INSTANCE_DATA_NAME);
section.dispose();
final Section newSection = createSectionContent(parentComposite, sectionConfig, sectionInstance);
final GridData gridData = new GridData();
gridData.horizontalAlignment = SWT.FILL;
gridData.grabExcessHorizontalSpace = true;
if (i > 0) {
gridData.verticalIndent = 0;
}
if (i == children.length - 1) {
gridData.verticalAlignment = SWT.FILL;
gridData.grabExcessVerticalSpace = true;
}
newSection.setLayoutData(gridData);
newSection.setExpanded(expandedState);
sectionMap.put(sectionID, newSection);
newSection.setText(sectionInstance.getTitle());
newSection.moveBelow(children[Math.max(0, i - 1)]);
return;
}
}
}