本文整理汇总了Java中org.eclipse.swt.layout.RowData类的典型用法代码示例。如果您正苦于以下问题:Java RowData类的具体用法?Java RowData怎么用?Java RowData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RowData类属于org.eclipse.swt.layout包,在下文中一共展示了RowData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDialogArea
import org.eclipse.swt.layout.RowData; //导入依赖的package包/类
protected Control createDialogArea(Composite parent) {
Composite area = (Composite) super.createDialogArea(parent);
Composite container = new Composite(area, SWT.NONE);
RowLayout layout = new RowLayout(SWT.HORIZONTAL);
container.setLayout(layout);
// container.setLayoutData(new GridData(GridData.FILL_BOTH));
// TitleArea中的Title
setTitle("属性文件更新");
// TitleArea中的Message
setMessage("输入正确的url地址,以更新文件。\n可提示的属性数量会根据当前项目存在的jar包,对已有属性增加或者删除!");
Label label = new Label(container, SWT.NONE);
label.setText("项目URL: ");
combo = new Combo(container, SWT.DROP_DOWN);
String[] items = new String[getUrlMap().size()];
getUrlMap().values().toArray(items);
combo.setItems(items);
String url = getPreferedUrl(projectName);
combo.setText(url);
combo.setLayoutData(new RowData(400, 30));
return area;
}
示例2: createAttributeText
import org.eclipse.swt.layout.RowData; //导入依赖的package包/类
private Text createAttributeText ( final String attribute )
{
final Text t = new Text ( this, SWT.BORDER );
final Fields field = Fields.byField ( attribute );
if ( field == null )
{
t.setEditable ( true );
t.setMessage ( Messages.custom_field );
}
else
{
t.setEditable ( false );
t.setText ( field.getName () );
}
t.addKeyListener ( new KeyAdapter () {
@Override
public void keyReleased ( final KeyEvent e )
{
AssertionComposite.this.orCondition.updateFilter ();
};
} );
final RowData rowData = new RowData ();
rowData.width = 132;
t.setLayoutData ( rowData );
return t;
}
示例3: createAssertionCombo
import org.eclipse.swt.layout.RowData; //导入依赖的package包/类
private Combo createAssertionCombo ()
{
final Combo c = new Combo ( this, SWT.NONE );
for ( final Assertion assertion : Assertion.values () )
{
c.add ( assertion.toString () );
}
c.select ( 0 );
c.addSelectionListener ( new SelectionAdapter () {
@Override
public void widgetSelected ( final SelectionEvent e )
{
AssertionComposite.this.orCondition.updateFilter ();
}
} );
final RowData rowData = new RowData ();
rowData.width = 75;
c.setLayoutData ( rowData );
return c;
}
示例4: createValueText
import org.eclipse.swt.layout.RowData; //导入依赖的package包/类
private Text createValueText ()
{
final Text t = new Text ( this, SWT.BORDER );
t.setMessage ( Messages.argument );
t.addKeyListener ( new KeyAdapter () {
@Override
public void keyReleased ( final KeyEvent e )
{
AssertionComposite.this.orCondition.updateFilter ();
}
} );
final RowData rowData = new RowData ();
rowData.width = 132;
t.setLayoutData ( rowData );
return t;
}
示例5: GenericResourceLoadControl
import org.eclipse.swt.layout.RowData; //导入依赖的package包/类
public GenericResourceLoadControl(Composite parent, SaveLoadConfig<T> config) {
super(parent, SWT.NONE);
this.config = config;
setLayout(new RowLayout());
Button loadButton = new Button(this, SWT.PUSH);
loadButton.setText(config.getLoadLabel());
loadButton.setLayoutData(new RowData());
loadButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleLoad();
}
});
}
示例6: GenericResourceSaveControl
import org.eclipse.swt.layout.RowData; //导入依赖的package包/类
public GenericResourceSaveControl(Composite parent, SaveLoadConfig<T> config) {
super(parent, SWT.NONE);
this.config = config;
setLayout(new RowLayout());
Button saveButton = new Button(this, SWT.PUSH);
saveButton.setText(config.getSaveLabel());
saveButton.setLayoutData(new RowData());
saveButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleSave();
}
});
}
示例7: refreshSelected
import org.eclipse.swt.layout.RowData; //导入依赖的package包/类
private void refreshSelected() {
int selected = menu.getSelectionIndex();
adjustSelectedElement();
for (int i=0; i<elements.size(); i++) {
if (i != selected) {
ListPaneElement element =(ListPaneElement)elements.get(i);
element.getComposite().setVisible(false);
RowData dt = new RowData();
dt.exclude = true;
element.getComposite().setLayoutData(dt);
}
}
panes.layout(true);
}
示例8: addElement
import org.eclipse.swt.layout.RowData; //导入依赖的package包/类
public Composite addElement(String key, String label) {
Composite composite = new Composite(panes, SWT.NONE);
RowData dt = new RowData();
dt.exclude = elements.size() != 0;
composite.setLayoutData(dt);
GridLayout lyt = new GridLayout(1, false);
lyt.marginHeight = 0;
lyt.marginWidth = 0;
composite.setLayout(lyt);
if (showTitles) {
Label lbl = new Label(composite, SWT.NONE);
lbl.setText(label);
lbl.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
}
menu.add(label + " ");
Composite content = new Composite(composite, style);
content.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
elements.add(new ListPaneElement(key, label, composite));
return content;
}
示例9: initText
import org.eclipse.swt.layout.RowData; //导入依赖的package包/类
private void initText() {
String txt =
"Droid Navi " + DroidNavi.VERSION + "\n\n" +
"Licensed under LGPL v2.0\n\n" +
"Libraries in use:\n" +
"Jackson JSON Processor 1.9.13\n" +
"Standard Widget Toolkti (SWT) 4.4\n" +
"QRGen 1.4\n" +
"Zxing Java Core 3.0\n" +
"Log4j2 2.0 RC1";
Label text = new Label(getWindowShell(), SWT.LEFT);
text.setText(txt);
Label space = new Label(getWindowShell(), SWT.NONE);
RowData data = new RowData();
data.height = 10;
space.setLayoutData(data);
}
示例10: createContextButton
import org.eclipse.swt.layout.RowData; //导入依赖的package包/类
protected CLabel createContextButton (String text, Image icon)
{
CLabel lbl = new CLabel(buttonsContainer, SWT.NONE);
lbl.setLayoutData(new RowData(SWT.DEFAULT, 28));
lbl.setRightMargin(10);
lbl.setLeftMargin(8);
lbl.setText(text);
lbl.setImage(icon);
lbl.setBackground(ColorResources.COLOR_CS_BLUE);
lbl.setForeground(ColorResources.COLOR_WHITE);
lbl.setCursor(new Cursor(getDisplay(), SWT.CURSOR_HAND));
contextButtonsMap.put(lbl, text);
return lbl;
}
示例11: hideExcessiveLeftMostPathButtons
import org.eclipse.swt.layout.RowData; //导入依赖的package包/类
void hideExcessiveLeftMostPathButtons() {
final Control[] pathButtons = pathButtonBar.getChildren();
final int width = pathButtonBar.getBounds().width;
for ( int ndx = 0; ndx < pathButtons.length &&
pathButtonBar.computeSize( SWT.DEFAULT, SWT.DEFAULT ).x > width; ++ndx ) {
scrollPathBarLeftButton.setVisible( true );
final Control pathButton = pathButtons[ ndx ];
if ( pathButton.isVisible() ) {
pathButton.setVisible( false );
( ( RowData ) pathButton.getLayoutData() ).exclude = true;
}
}
scrollPathBarLeftButton.setVisible( pathButtons.length == 0 ? false
: ( ( RowData ) ( ( Label ) pathButtons[ 0 ] ).getLayoutData() ).exclude );
scrollPathBarRightButton.setVisible( pathButtons.length == 0 ? false
: ( ( RowData ) ( ( Label ) pathButtons[ pathButtons.length - 1 ] ).getLayoutData() ).exclude );
pathButtonBar.layout();
pathButtonBar.getParent().layout();
}
示例12: newPathButton
import org.eclipse.swt.layout.RowData; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.modeshape.modeler.ui.FocusTreeView#newPathButton(java.lang.String, java.lang.String, java.lang.Object,
* java.lang.Object)
*/
@Override
public Object newPathButton( final String text,
final String description,
final Object backgroundColor,
final Object foregroundColor ) {
final Label button = new Label( pathButtonBar, SWT.NONE );
button.setText( text );
button.setToolTipText( description );
button.setBackground( ( Color ) backgroundColor );
button.setForeground( ( Color ) foregroundColor );
button.setAlignment( SWT.CENTER );
final Point size = button.computeSize( SWT.DEFAULT, SWT.DEFAULT );
button.setLayoutData( new RowData( size.x + 10, size.y ) );
button.addPaintListener( pathButtonPaintListener );
hideExcessiveLeftMostPathButtons();
return button;
}
示例13: scrollPathBarRight
import org.eclipse.swt.layout.RowData; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.modeshape.modeler.ui.FocusTreeView#scrollPathBarRight()
*/
@Override
public void scrollPathBarRight() {
final Control[] pathButtons = pathButtonBar.getChildren();
// Show first hidden path button on right
for ( int ndx = pathButtons.length; --ndx >= 0; ) {
Control pathButton = pathButtons[ ndx ];
if ( pathButton.isVisible() ) {
// Show next path button
pathButton = pathButtons[ ++ndx ];
pathButton.setVisible( true );
( ( RowData ) pathButton.getLayoutData() ).exclude = false;
break;
}
}
// Hide first shown path button on left until all buttons fit in button bar
hideExcessiveLeftMostPathButtons();
}
示例14: hideExcessiveLeftMostPathButtons
import org.eclipse.swt.layout.RowData; //导入依赖的package包/类
void hideExcessiveLeftMostPathButtons() {
final Control[] pathButtons = pathButtonBar.getChildren();
final int width = pathButtonBar.getBounds().width;
for ( int ndx = 0; ndx < pathButtons.length &&
pathButtonBar.computeSize( SWT.DEFAULT, SWT.DEFAULT ).x > width; ++ndx ) {
leftPathBarButton.setVisible( true );
final Control pathButton = pathButtons[ ndx ];
if ( pathButton.isVisible() ) {
pathButton.setVisible( false );
( ( RowData ) pathButton.getLayoutData() ).exclude = true;
}
}
leftPathBarButton.setVisible( pathButtons.length == 0 ? false : ( ( RowData ) ( ( Label ) pathButtons[ 0 ] ).getLayoutData() ).exclude );
rightPathBarButton.setVisible( pathButtons.length == 0 ? false : ( ( RowData ) ( ( Label ) pathButtons[ pathButtons.length - 1 ] ).getLayoutData() ).exclude );
pathButtonBar.layout();
pathButtonBar.getParent().layout();
}
示例15: scrollPathBarRight
import org.eclipse.swt.layout.RowData; //导入依赖的package包/类
void scrollPathBarRight() {
final Control[] pathButtons = pathButtonBar.getChildren();
// Show first hidden path button on right
for ( int ndx = pathButtons.length; --ndx >= 0; ) {
Control pathButton = pathButtons[ ndx ];
if ( pathButton.isVisible() ) {
// Show next path button
pathButton = pathButtons[ ++ndx ];
pathButton.setVisible( true );
( ( RowData ) pathButton.getLayoutData() ).exclude = false;
break;
}
}
// Hide first shown path button on left until all buttons fit in button bar
hideExcessiveLeftMostPathButtons();
}