本文整理汇总了Java中swing2swt.layout.BorderLayout类的典型用法代码示例。如果您正苦于以下问题:Java BorderLayout类的具体用法?Java BorderLayout怎么用?Java BorderLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BorderLayout类属于swing2swt.layout包,在下文中一共展示了BorderLayout类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createContents
import swing2swt.layout.BorderLayout; //导入依赖的package包/类
/**
* Create contents of the window.
*/
protected void createContents() {
shlMyanmarTyping = new Shell();
shlMyanmarTyping.setSize(785, 500);
shlMyanmarTyping.setText("Myanmar Typing");
shlMyanmarTyping.setLayout(new BorderLayout(0, 0));
text = new Text(shlMyanmarTyping, SWT.BORDER);
text.setLayoutData(BorderLayout.NORTH);
Composite unicodeKeyPanel = new Composite(shlMyanmarTyping, SWT.NONE);
unicodeKeyPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 1, 1));
unicodeKeyPanel.setLayoutData(BorderLayout.CENTER);
for (MMKey key : MMKey.ALL_MM_KEYS) {
Button btnNewButton = new Button(unicodeKeyPanel, SWT.NONE);
btnNewButton.setText(key.toUnicode());
btnNewButton.setData(key);
btnNewButton.addSelectionListener(listener);
}
}
示例2: createPartControl
import swing2swt.layout.BorderLayout; //导入依赖的package包/类
@Override
public void createPartControl(Composite parent) {
composite = new Composite(parent, SWT.NONE);
composite.setLayout(new BorderLayout(0, 0));
final Composite composite_1 = new Composite(composite, SWT.NONE);
composite_1.moveAbove(null);
composite_1.setLayout(new GridLayout(2, false));
lblTitle = new Label(composite_1, SWT.NONE);
lblTitle.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
lblTitle.setText("No operations to display at this time.");
progressBar = new ProgressBar(composite_1, SWT.NONE);
// gd_progressBar.heightHint = 25;
progressBar.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
progressBar.setSelection(0);
// progressBar.setState(SWT.ERROR);
// Button btnCancel = new Button(composite_1, SWT.NO_BACKGROUND);
// btnCancel.setImage(ResourceManager.getPluginImage("de.umg.mi.idrt.ioe", "images/terminate_co.gif"));
// btnCancel.addSelectionListener(new SelectionListener() {
//
// @Override
// public void widgetSelected(SelectionEvent e) {
// }
//
// @Override
// public void widgetDefaultSelected(SelectionEvent e) {
// }
// });
lblCurrentAction = new Label(composite_1, SWT.NONE);
lblCurrentAction.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
lblCurrentAction.setText("");
composite.redraw();
composite.layout();
}
示例3: createControl
import swing2swt.layout.BorderLayout; //导入依赖的package包/类
/**
* Create contents of the wizard.
*
* @param parent
*/
@SuppressWarnings("restriction")
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
setControl(container);
container.setLayout(new BorderLayout(0, 0));
Composite composite = new Composite(container, SWT.NONE);
composite.setLayoutData(BorderLayout.NORTH);
composite.setLayout(new FillLayout(SWT.HORIZONTAL));
GridLayout layout = new GridLayout();
composite.setLayout(layout);
layout.numColumns = 2;
Label desc = new Label(composite, SWT.RIGHT);
desc.setText("Description");
Text descField = new Text(composite, SWT.None);
descField.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
description = descField.getText();
}
});
descField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
tree = new TreeViewer(container, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
tree.setContentProvider(new PatternContentProvider());
tree.setLabelProvider(new PatternLabelProvider());
tree.expandAll();
IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (editor instanceof XbaseEditor) {
XbaseEditor xeditor = (XbaseEditor) editor;
IXtextDocument document = xeditor.getDocument();
Object root = document.readOnly(new IUnitOfWork<Object, XtextResource>() {
@Override
public Object exec(XtextResource state) throws Exception {
return state.getContents().get(0);
}
});
if (root != null && root instanceof PatternModel) {
model = (PatternModel) root;
if(model.getPatterns().isEmpty())
setPageComplete(false);
else
setPageComplete(true);
tree.setInput(root);
}
}
}