本文整理匯總了Java中org.eclipse.swt.custom.ScrolledComposite.setExpandHorizontal方法的典型用法代碼示例。如果您正苦於以下問題:Java ScrolledComposite.setExpandHorizontal方法的具體用法?Java ScrolledComposite.setExpandHorizontal怎麽用?Java ScrolledComposite.setExpandHorizontal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.custom.ScrolledComposite
的用法示例。
在下文中一共展示了ScrolledComposite.setExpandHorizontal方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: DiskInfoTab
import org.eclipse.swt.custom.ScrolledComposite; //導入方法依賴的package包/類
/**
* Create the DISK INFO tab.
*/
public DiskInfoTab(CTabFolder tabFolder, FormattedDisk[] disks) {
this.formattedDisks = disks;
CTabItem ctabitem = new CTabItem(tabFolder, SWT.NULL);
ctabitem.setText(textBundle.get("DiskInfoTab.Title")); //$NON-NLS-1$
tabFolder.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
getInfoTable().removeAll();
buildDiskInfoTable(getFormattedDisk(0)); // FIXME!
}
});
ScrolledComposite scrolledComposite = new ScrolledComposite(
tabFolder, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
scrolledComposite.setExpandHorizontal(true);
scrolledComposite.setExpandVertical(true);
ctabitem.setControl(scrolledComposite);
composite = new Composite(scrolledComposite, SWT.NONE);
createDiskInfoTable();
if (disks.length > 1) {
RowLayout layout = new RowLayout(SWT.VERTICAL);
layout.wrap = false;
composite.setLayout(layout);
for (int i=0; i<disks.length; i++) {
Label label = new Label(composite, SWT.NULL);
label.setText(disks[i].getDiskName());
buildDiskInfoTable(disks[i]);
}
} else {
composite.setLayout(new FillLayout());
buildDiskInfoTable(disks[0]);
}
composite.pack();
scrolledComposite.setContent(composite);
scrolledComposite.setMinSize(
composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
示例2: NotesCheckinControl
import org.eclipse.swt.custom.ScrolledComposite; //導入方法依賴的package包/類
protected NotesCheckinControl(final Composite parent, final int style, final CheckinControlOptions options) {
super(parent, style, Messages.getString("NotesCheckinControl.Title"), CheckinSubControlType.CHECKIN_NOTES); //$NON-NLS-1$
this.options = options;
final FillLayout layout = new FillLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
setLayout(layout);
final int rootStyle = options.isForDialog() ? SWT.BORDER : SWT.NONE;
rootComposite = new ScrolledComposite(this, SWT.V_SCROLL | rootStyle);
rootComposite.setLayout(new FillLayout());
rootComposite.setExpandHorizontal(true);
rootComposite.setExpandVertical(true);
addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(final DisposeEvent e) {
if (pendingCheckin != null) {
pendingCheckin.getPendingChanges().removeAffectedTeamProjectsChangedListener(teamProjectsListener);
}
}
});
}
示例3: FXCanvasScrollApp
import org.eclipse.swt.custom.ScrolledComposite; //導入方法依賴的package包/類
protected FXCanvasScrollApp() {
shell = new Shell();
shell.setText(this.getClass().getSimpleName());
shell.setLayout(new FillLayout());
ScrolledComposite scrollPane = new ScrolledComposite(shell, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
FXCanvas fxCanvas = new FXCanvas(scrollPane, SWT.BORDER);
fxCanvas.setScene(createScene(SCROLL_CONTAINER_ID));
scrollPane.setContent(fxCanvas);
scrollPane.setExpandHorizontal(true);
scrollPane.setExpandVertical(true);
fxCanvas.pack();
scrollPane.setMinSize(fxCanvas.getSize());
shell.pack();
Monitor monitor = shell.getMonitor();
Rectangle monitorRect = monitor.getClientArea();
Rectangle shellRect = shell.getBounds();
shellRect.x = Math.max(0, (monitorRect.width - shellRect.width) / 2);
shellRect.y = Math.max(0, (monitorRect.height - shellRect.height) / 2);
shell.setBounds(shellRect);
shell.open();
}
示例4: setSize
import org.eclipse.swt.custom.ScrolledComposite; //導入方法依賴的package包/類
private void setSize(Composite composite) {
if (composite != null) {
// Note: The font is set here in anticipation that the class
// inheriting
// this base class may add widgets to the dialog. setSize
// is assumed to be called just before we go live.
applyDialogFont(composite);
Point minSize = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
composite.setSize(minSize);
// set scrollbar composite's min size so page is expandable but
// has scrollbars when needed
if (composite.getParent() instanceof ScrolledComposite) {
ScrolledComposite sc1 = (ScrolledComposite) composite.getParent();
sc1.setMinSize(minSize);
sc1.setExpandHorizontal(true);
sc1.setExpandVertical(true);
}
}
}
示例5: setSize
import org.eclipse.swt.custom.ScrolledComposite; //導入方法依賴的package包/類
private void setSize(Composite composite) {
if (composite != null) {
// Note: The font is set here in anticipation that the class inheriting
// this base class may add widgets to the dialog. setSize
// is assumed to be called just before we go live.
applyDialogFont(composite);
Point minSize = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
composite.setSize(minSize);
// set scrollbar composite's min size so page is expandable but
// has scrollbars when needed
if (composite.getParent() instanceof ScrolledComposite) {
ScrolledComposite sc1 = (ScrolledComposite) composite.getParent();
sc1.setMinSize(minSize);
sc1.setExpandHorizontal(true);
sc1.setExpandVertical(true);
}
}
}
示例6: createBParam
import org.eclipse.swt.custom.ScrolledComposite; //導入方法依賴的package包/類
private void createBParam(FormToolkit toolkit, CTabFolder tabFolder) {
CTabItem bptab = new CTabItem(tabFolder, SWT.NONE);
bptab.setText(Messages.ParametersDialog_built_in_parameters);
ScrolledComposite scompo = new ScrolledComposite(tabFolder, SWT.V_SCROLL | SWT.H_SCROLL);
scompo.setExpandHorizontal(true);
scompo.setExpandVertical(true);
Composite sectionClient = toolkit.createComposite(scompo);
sectionClient.setLayout(new GridLayout(2, false));
for (JRParameter p : prompts)
if (!p.isForPrompting() || p.isSystemDefined())
createInput(toolkit, sectionClient, (JRDesignParameter) p);
sectionClient.pack();
scompo.setMinSize(sectionClient.getSize());
scompo.setContent(sectionClient);
bptab.setControl(scompo);
}
示例7: createUI_52_VertexScrolledContainer
import org.eclipse.swt.custom.ScrolledComposite; //導入方法依賴的package包/類
private Composite createUI_52_VertexScrolledContainer(final Composite parent) {
// scrolled container
_vertexScrolledContainer = new ScrolledComposite(parent, SWT.V_SCROLL);
GridDataFactory.fillDefaults().grab(true, true).applyTo(_vertexScrolledContainer);
_vertexScrolledContainer.setExpandVertical(true);
_vertexScrolledContainer.setExpandHorizontal(true);
// vertex container
final Composite vertexContainer = new Composite(_vertexScrolledContainer, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, true).applyTo(vertexContainer);
GridLayoutFactory.fillDefaults()//
.numColumns(6)
.applyTo(vertexContainer);
// vertexContainer.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
_vertexScrolledContainer.setContent(vertexContainer);
_vertexScrolledContainer.addControlListener(new ControlAdapter() {
@Override
public void controlResized(final ControlEvent e) {
_vertexScrolledContainer.setMinSize(vertexContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
});
return vertexContainer;
}
示例8: createUserParam
import org.eclipse.swt.custom.ScrolledComposite; //導入方法依賴的package包/類
private void createUserParam(FormToolkit toolkit, CTabFolder tabFolder) {
if (canShowParameters()) {
CTabItem ptab = new CTabItem(tabFolder, SWT.NONE);
ptab.setText(Messages.ParametersDialog_user_parameters);
ScrolledComposite scompo = new ScrolledComposite(tabFolder, SWT.V_SCROLL | SWT.H_SCROLL);
scompo.setExpandHorizontal(true);
scompo.setExpandVertical(true);
Composite sectionClient = toolkit.createComposite(scompo);
sectionClient.setLayout(new GridLayout(2, false));
for (JRParameter p : prompts)
if (p.isForPrompting() && !p.isSystemDefined())
createInput(toolkit, sectionClient, (JRDesignParameter) p);
sectionClient.pack();
scompo.setMinSize(sectionClient.getSize());
scompo.setContent(sectionClient);
ptab.setControl(scompo);
}
}
示例9: createByRole
import org.eclipse.swt.custom.ScrolledComposite; //導入方法依賴的package包/類
private void createByRole(CTabFolder tabFolder) {
CTabItem bptab = new CTabItem(tabFolder, SWT.NONE);
bptab.setText(Messages.PermissionPage_6);
scRole = new ScrolledComposite(tabFolder, SWT.H_SCROLL | SWT.V_SCROLL);
scRole.setLayoutData(new GridData(GridData.FILL_BOTH));
cmpRole = new Composite(scRole, SWT.NONE);
cmpRole.setLayout(new GridLayout(2, true));
scRole.setContent(cmpRole);
// Set the minimum size
scRole.setMinSize(cmpRole.computeSize(SWT.DEFAULT, SWT.DEFAULT).x, cmpRole.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
// Expand both horizontally and vertically
scRole.setExpandHorizontal(true);
scRole.setExpandVertical(true);
bptab.setControl(scRole);
}
示例10: createControl
import org.eclipse.swt.custom.ScrolledComposite; //導入方法依賴的package包/類
@Override
public void createControl(Composite parent) {
Composite mainComposite = new Composite(parent, SWT.NONE);
mainComposite.setLayout(GridLayoutFactory.fillDefaults().create());
Label titleLabel = new Label(mainComposite, SWT.NONE);
titleLabel.setText(Messages.ShowServersPage_label);
ScrolledComposite scrollComp = new ScrolledComposite(mainComposite, SWT.V_SCROLL | SWT.H_SCROLL);
scrollComp.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).hint(SWT.DEFAULT, 200).create());
scrollComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
scrollComp.setLayout(new GridLayout(1,false));
scrollComp.setExpandHorizontal(true);
scrollComp.setExpandVertical(true);
content = new Composite(scrollComp, SWT.NONE);
scrollComp.setContent(content);
content.setLayout(new GridLayout(1,false));
content.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
setControl(mainComposite);
}
示例11: createPartControl
import org.eclipse.swt.custom.ScrolledComposite; //導入方法依賴的package包/類
@Override
public void createPartControl(Composite parent) {
scrollComp = new ScrolledComposite(parent, SWT.V_SCROLL);
scrollComp.setLayoutData(new GridData(GridData.FILL_BOTH));
scrollComp.setLayout(new GridLayout(1,false));
scrollComp.setExpandVertical(true);
scrollComp.setExpandHorizontal(true);
scrollComp.addControlListener(new ControlAdapter() {
@Override
public void controlResized(ControlEvent e) {
refreshScrolledHeight();
}
});
mainContainer = new Composite(scrollComp, SWT.BORDER);
mainContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
scrollComp.setContent(mainContainer);
mainContainer.setLayout(new ButtonFillLayout());
IWorkbenchPart editor = getContributingPart();
if (editor instanceof CachedSelectionProvider){
CachedSelectionProvider cachedSelEditor = (CachedSelectionProvider)editor;
cachedSelEditor.getSelectionCache().addSelectionChangeListener(selectionListener);
}
}
示例12: createDialogArea
import org.eclipse.swt.custom.ScrolledComposite; //導入方法依賴的package包/類
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
ScrolledComposite scrollable = new ScrolledComposite(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
scrollable.setExpandHorizontal(true);
scrollable.setExpandVertical(true);
scrollable.setLayoutData(new GridData(GridData.FILL_BOTH));
viewer = new PlanRulesTreeViewer(scrollable);
viewer.setContentProvider(new PlanRulesContentProvider());
viewer.setInput(element);
setViewerFromRules();
Tree tree = viewer.getTree();
scrollable.setContent(tree);
tree.setSize(tree.computeSize(SWT.DEFAULT, SWT.DEFAULT));
return composite;
}
示例13: createGroupPanel
import org.eclipse.swt.custom.ScrolledComposite; //導入方法依賴的package包/類
private void createGroupPanel(Composite parent, ParamGroup paramGroup) {
ScrolledComposite sc = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
sc.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
sc.setExpandHorizontal(true);
sc.setExpandVertical(true);
Group panel = new Group(sc, SWT.NONE);
GridLayout layout = new GridLayout(2, false);
layout.marginHeight = 3;
layout.marginWidth = 3;
layout.verticalSpacing = 0;
layout.horizontalSpacing = 5;
panel.setLayout(layout);
GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
panel.setLayoutData(data);
panel.setText(paramGroup.getLabel());
tabComposites[0] = panel;
scrolledComposite[0] = sc;
}
示例14: createTab
import org.eclipse.swt.custom.ScrolledComposite; //導入方法依賴的package包/類
/**
* Create the tab.
*
* @param tabFolder
* The folder to add the tab to.
* @param tabIndex
* The index of the tab within the parent tab folder.
*/
private void createTab(TabFolder tabFolder, int tabIndex) {
TabItem configurationTab = new TabItem(tabFolder, SWT.NONE, tabIndex);
configurationTab.setText("SPL Profile");
ScrolledComposite scrolledComposite = new ScrolledComposite(tabFolder, SWT.V_SCROLL);
scrolledComposite.setExpandHorizontal(true);
scrolledComposite.setExpandVertical(true);
configurationTab.setControl(scrolledComposite);
Composite composite = new Composite(scrolledComposite, SWT.FILL);
composite.setLayout(new GridLayout(1, false));
composite.setLayoutData(new GridData(GridData.FILL, GridData.VERTICAL_ALIGN_BEGINNING, true, false));
createHeader(composite);
createQualityGoalGroup(composite);
createMechanismGroup(composite);
scrolledComposite.setContent(composite);
scrolledComposite.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
示例15: createContents
import org.eclipse.swt.custom.ScrolledComposite; //導入方法依賴的package包/類
@Override
protected Control createContents(Composite parent) {
this.getShell().setText(_Command);
ScrolledComposite scrolledComposite = new ScrolledComposite(parent, SWT.V_SCROLL);
scrolledComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
scrolledComposite.setExpandHorizontal(true);
Text text = new Text(scrolledComposite, SWT.MULTI | SWT.READ_ONLY | SWT.WRAP);
text.setText(_Result);
text.pack();
scrolledComposite.setContent(text);
return scrolledComposite;
}