本文整理汇总了Java中org.eclipse.ui.forms.widgets.ExpandableComposite.COMPACT属性的典型用法代码示例。如果您正苦于以下问题:Java ExpandableComposite.COMPACT属性的具体用法?Java ExpandableComposite.COMPACT怎么用?Java ExpandableComposite.COMPACT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.ui.forms.widgets.ExpandableComposite
的用法示例。
在下文中一共展示了ExpandableComposite.COMPACT属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initAdditionalParametersUi
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();
}
});
}
示例2: initRecogTools
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();
}
});
}
示例3: createDiffViewer
/**
* 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);
}
示例4: initWerGroup
private void initWerGroup() {
ExpandableComposite werExp = new ExpandableComposite(this, ExpandableComposite.COMPACT);
Composite werGroup = new Composite(werExp, SWT.SHADOW_ETCHED_IN);
werGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
// metadatagroup.setText("Document metadata");
werGroup.setLayout(new GridLayout(2, false));
Label refLabel = new Label(werGroup, 0);
refLabel.setText("Reference:");
refVersionCombo = new Combo(werGroup, SWT.READ_ONLY);
Label hypLabel = new Label(werGroup, 0);
hypLabel.setText("Hypothesis:");
hypVersionCombo = new Combo(werGroup, SWT.READ_ONLY);
Label emptyLabel = new Label(werGroup,0);
computeWerBtn = new Button(werGroup, SWT.PUSH);
computeWerBtn.setText("Compare");
computeWerBtn.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
computeWerBtn.setToolTipText("Compares the two selected transcripts and computes word error rate and character error rate.");
computeWerBtn.pack();
werExp.setClient(werGroup);
werExp.setText("Compute WER");
werExp.setExpanded(true);
werExp.addExpansionListener(new ExpansionAdapter() {
public void expansionStateChanged(ExpansionEvent e) {
layout();
}
});
}
示例5: initOtherTools
private void initOtherTools() {
ExpandableComposite exp = new ExpandableComposite(this, ExpandableComposite.COMPACT);
exp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Composite c = new Composite(exp, SWT.SHADOW_ETCHED_IN);
c.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
c.setLayout(new GridLayout(1, true));
otherToolsPagesSelector = new CurrentTranscriptOrCurrentDocPagesSelector(c, SWT.NONE, true);
otherToolsPagesSelector.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
polygon2baselinesBtn = new Button(c, SWT.PUSH);
polygon2baselinesBtn.setText("Add Baselines to Polygons");
polygon2baselinesBtn.setToolTipText("Creates baselines for all surrounding polygons - warning: existing baselines will be lost (text is retained however!)");
polygon2baselinesBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
baseline2PolygonBtn = new Button(c, SWT.PUSH);
baseline2PolygonBtn.setText("Add Polygons to Baselines");
baseline2PolygonBtn.setToolTipText("Creates polygons for all baselines - warning: existing polygons will be lost (text is retained however!)");
baseline2PolygonBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
exp.setClient(c);
new Label(c, SWT.NONE);
exp.setText("Other Tools");
Fonts.setBoldFont(exp);
exp.setExpanded(true);
exp.addExpansionListener(new ExpansionAdapter() {
public void expansionStateChanged(ExpansionEvent e) {
layout();
}
});
}
示例6: initWerGroup
private void initWerGroup() {
werExp = new ExpandableComposite(this, ExpandableComposite.COMPACT);
werExp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
werGroup = new Composite(werExp, SWT.SHADOW_ETCHED_IN);
werGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
// metadatagroup.setText("Document metadata");
werGroup.setLayout(new GridLayout(2, false));
refVersionChooser = new TranscriptVersionChooser("Reference:\n(Correct Text) ", werGroup, 0);
refVersionChooser.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
hypVersionChooser = new TranscriptVersionChooser("Hypothesis:\n(HTR Text) ", werGroup, 0);
hypVersionChooser.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
Label emptyLabel = new Label(werGroup,0);
computeWerBtn = new Button(werGroup, SWT.PUSH);
computeWerBtn.setText("Compare");
computeWerBtn.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true, 2, 1));
computeWerBtn.setToolTipText("Compares the two selected transcripts and computes word error rate and character error rate.");
// computeWerBtn.pack();
compareVersionsBtn = new Button(werGroup, SWT.PUSH);
compareVersionsBtn.setText("Compare Versions in Textfile");
compareVersionsBtn.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true, 2, 1));
compareVersionsBtn.setToolTipText("Shows the difference of the two selected versions");
werExp.setClient(werGroup);
werExp.setText("Compute Accuracy");
Fonts.setBoldFont(werExp);
werExp.setExpanded(true);
werExp.addExpansionListener(new ExpansionAdapter() {
public void expansionStateChanged(ExpansionEvent e) {
layout();
}
});
}
示例7: createSection
/**
* Creates an expandable section within the parent created previously by calling
* <code>createSectionComposite</code>. Controls can be added directly to the returned
* composite, which has no layout initially.
*
* @param label the display name of the section
* @return a composite within the expandable section
*/
public Composite createSection(String label) {
Assert.isNotNull(fBody);
final ExpandableComposite excomposite = new ExpandableComposite(fBody, SWT.NONE,
ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT | ExpandableComposite.COMPACT);
if (fFirstChild == null) fFirstChild = excomposite;
excomposite.setText(label);
String last = null;
if (fLastOpenKey != null && fDialogSettingsStore != null)
last = fDialogSettingsStore.getString(fLastOpenKey);
if (fFirstChild == excomposite && !__NONE.equals(last) || label.equals(last)) {
excomposite.setExpanded(true);
if (fFirstChild != excomposite) fFirstChild.setExpanded(false);
} else {
excomposite.setExpanded(false);
}
excomposite.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
updateSectionStyle(excomposite);
manage(excomposite);
Composite contents = new Composite(excomposite, SWT.NONE);
excomposite.setClient(contents);
return contents;
}
示例8: createSection
/**
* Creates an expandable section within the parent created previously by
* calling <code>createSectionComposite</code>. Controls can be added
* directly to the returned composite, which has no layout initially.
*
* @param label the display name of the section
* @return a composite within the expandable section
*/
public Composite createSection(String label) {
Assert.isNotNull(fBody);
final ExpandableComposite excomposite= new ExpandableComposite(fBody, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT | ExpandableComposite.COMPACT);
if (fFirstChild == null)
fFirstChild= excomposite;
excomposite.setText(label);
String last= null;
if (fLastOpenKey != null && fDialogSettingsStore != null)
last= fDialogSettingsStore.getString(fLastOpenKey);
if (fFirstChild == excomposite && !__NONE.equals(last) || label.equals(last)) {
excomposite.setExpanded(true);
if (fFirstChild != excomposite)
fFirstChild.setExpanded(false);
} else {
excomposite.setExpanded(false);
}
excomposite.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
updateSectionStyle(excomposite);
manage(excomposite);
Composite contents= new Composite(excomposite, SWT.NONE);
excomposite.setClient(contents);
return contents;
}
示例9: AdvancedSettingsComponent
/**
* Creates a new component.
*
* @param wizardPage
*/
public AdvancedSettingsComponent(final Composite parent,
final ProjectImportConfiguration propectImportConfiguration,
final boolean enableProjectNameTemplate,
SimplerParametersWizardPage wizardPage) {
super(parent, ExpandableComposite.COMPACT | ExpandableComposite.TWISTIE
| ExpandableComposite.EXPANDED);
this.wizardPage = wizardPage;
setText("Advanced");
final Composite advancedComposite = new Composite(this, SWT.NONE);
setClient(advancedComposite);
addExpansionListener(new ExpansionAdapter() {
public void expansionStateChanged(ExpansionEvent e) {
Shell shell = parent.getShell();
Point minSize = shell.getMinimumSize();
shell.setMinimumSize(shell.getSize().x, minSize.y);
shell.pack();
parent.layout();
shell.setMinimumSize(minSize);
}
});
GridLayout gridLayout = new GridLayout();
gridLayout.marginLeft = 11;
gridLayout.numColumns = 2;
advancedComposite.setLayout(gridLayout);
createAdvancedSection(advancedComposite);
}
开发者ID:Adobe-Marketing-Cloud,项目名称:aem-eclipse-developer-tools,代码行数:31,代码来源:AdvancedSettingsComponent.java
示例10: createDialogArea
/**
* Create contents of the dialog.
* @param parent
*/
@Override protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
container.setLayout(new GridLayout(2, false));
iconLabel = new Label(container, 0);
iconLabel.setImage(Images.getSystemImage(swtIcon));
messageText = new StyledText(container, SWT.FLAT | SWT.READ_ONLY | SWT.MULTI | SWT.WRAP | SWT.VERTICAL);
messageText.setBackground(container.getBackground());
messageText.setText(message);
messageText.setLayoutData(new GridData(GridData.FILL_BOTH));
hasDetails = !StringUtils.isEmpty(detailedMessage) || exception != null;
if (hasDetails) {
ec = new ExpandableComposite(container, ExpandableComposite.COMPACT);
ec.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
ec.setLayout(new GridLayout());
exceptionText = new StyledText(ec, SWT.BORDER | SWT.MULTI | SWT.VERTICAL | SWT.WRAP);
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gd.heightHint = 800;
exceptionText.setLayoutData(gd);
String msg = "";
int i=0;
if (!StringUtils.isEmpty(detailedMessage)) {
msg = detailedMessage+"\n\n";
i = msg.length();
}
String exceptionStr = exception==null ? "" : ExceptionUtil.printStackTrace(exception);
String exceptionHeader = "Exception:\n";
if (!StringUtils.isEmpty(exceptionStr)) {
msg += exceptionHeader;
msg += exceptionStr;
}
exceptionText.setText(msg);
if (!StringUtils.isEmpty(exceptionStr)) {
TextStyle ts = new TextStyle(Fonts.createBoldFont(exceptionText.getFont()), exceptionText.getForeground(), exceptionText.getBackground());
StyleRange sr = new StyleRange(ts);
sr.start = i;
sr.length = exceptionHeader.length();
exceptionText.setStyleRange(sr);
}
ec.setClient(exceptionText);
ec.setText("Details");
Fonts.setBoldFont(ec);
ec.setExpanded(false);
ec.addExpansionListener(new ExpansionAdapter() {
public void expansionStateChanged(ExpansionEvent e) {
updateSize();
}
});
// getShell().pack();
}
// getShell().setSize(getShell().computeSize(SWT.DEFAULT, getMinHeight()));
// parent.pack();
// getShell().setSize(getShell().computeSize(SWT.DEFAULT, getMinHeight()));
SWTUtil.centerShell(getShell());
// updateSize();
return container;
}
示例11: initStyleSheetsWidget
private void initStyleSheetsWidget() {
ExpandableComposite styleSheetExp = new ExpandableComposite(container, ExpandableComposite.COMPACT);
styleSheetExp.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 2, 1));
Composite styleSheetGroup = new Composite(styleSheetExp, SWT.SHADOW_ETCHED_IN);
// styleSheetGroup = new Group(textStyleGroup, SWT.NONE);
// styleSheetGroup.setText("Stylesheets");
styleSheetGroup.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 2, 1));
styleSheetGroup.setLayout(new GridLayout(3, false));
styleSheetList = new org.eclipse.swt.widgets.List(styleSheetGroup, SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL);
styleSheetList.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 3));
styleSheetList.pack();
int nrOfVisibleItems = 4;
((GridData)styleSheetList.getLayoutData()).heightHint = styleSheetList.getItemHeight()*nrOfVisibleItems;
// Menu m = new Menu(textStyleGroup);
// MenuItem mi = new MenuItem(m, 0);
// mi.setText("Delete");
// styleSheetList.setMenu(m);
Label l = new Label(styleSheetGroup, SWT.LEFT);
l.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
l.setText("Name: ");
styleSheetName = new Text(styleSheetGroup, SWT.LEFT | SWT.BORDER);
styleSheetName.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
addAsStyleSheet = new Button(styleSheetGroup, SWT.PUSH);
addAsStyleSheet.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 2, 1));
addAsStyleSheet.setText("Add stylesheet");
deleteStyleSheet = new Button(styleSheetGroup, SWT.PUSH);
deleteStyleSheet.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 2, 1));
deleteStyleSheet.setText("Delete stylesheet");
// textStyleGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
// styleSheetCombo = createComboWithLabel(textStyleGroup, "Style sheet", SWT.DROP_DOWN | SWT.READ_ONLY);
// styleSheetList = createListWithLabel(styleSheetGroup, "Style sheet", SWT.SINGLE | SWT.V_SCROLL);
// styleSheetList.setSize(styleSheetList.computeSize(SWT.DEFAULT, styleSheetList.getItemHeight()*3));
// styleSheetList.setSize(styleSheetList.computeSize(SWT.DEFAULT, 10));
loadStyleSheets();
styleSheetExp.setClient(styleSheetGroup);
styleSheetExp.setText("Style sheets");
styleSheetExp.setExpanded(false);
styleSheetExp.addExpansionListener(new ExpansionAdapter() {
public void expansionStateChanged(ExpansionEvent e) {
container.layout();
}
});
}