本文整理汇总了Java中org.eclipse.swt.widgets.Text.setBounds方法的典型用法代码示例。如果您正苦于以下问题:Java Text.setBounds方法的具体用法?Java Text.setBounds怎么用?Java Text.setBounds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Text
的用法示例。
在下文中一共展示了Text.setBounds方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: relocate
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
@Override
public void relocate(CellEditor celleditor) {
Text text = (Text) celleditor.getControl();
Point pref = text.computeSize(SWT.DEFAULT, SWT.DEFAULT);
Rectangle rect = nameLabel.getTextBounds().getCopy();
nameLabel.translateToAbsolute(rect);
text.setBounds(rect.x - 1, rect.y - 1, pref.x + 1, pref.y + 1);
}
示例2: addHeader
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
public Composite addHeader(){
Composite composite = new Composite(container, SWT.NONE);
GridLayout gl_composite = new GridLayout(textGridRow.getNumberOfColumn() + 1, false);
gl_composite.horizontalSpacing = 7;
gl_composite.marginWidth = 1;
gl_composite.marginHeight = 0;
gl_composite.verticalSpacing = 1;
composite.setLayout(gl_composite);
Button rowSelection = new Button(composite, SWT.CHECK);
Map<Integer, TextGridColumnLayout> columns = textGridRow.getTextGridColumns();
for(int columnNumber:columns.keySet()){
Text text = new Text(composite, SWT.BORDER);
if(!columns.get(columnNumber).grabHorizantalAccessSpace()){
GridData gd_text = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gd_text.widthHint = columns.get(columnNumber).getColumnWidth();
text.setLayoutData(gd_text);
text.setEditable(false);
text.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
text.setBackground(SWTResourceManager.getColor(SWT.COLOR_LIST_SELECTION));
}else{
text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
text.setBounds(0, 0, 76, 21);
text.setFocus();
text.setEditable(false);
text.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
text.setBackground(SWTResourceManager.getColor(SWT.COLOR_LIST_SELECTION));
}
if(rowData!=null)
text.setText(rowData.get(columnNumber));
}
return composite;
}
示例3: addRaw
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
public Composite addRaw(){
Composite composite = new Composite(container, SWT.NONE);
GridLayout gl_composite = new GridLayout(textGridRow.getNumberOfColumn() + 1, false);
gl_composite.horizontalSpacing = 7;
gl_composite.marginWidth = 1;
gl_composite.marginHeight = 0;
gl_composite.verticalSpacing = 1;
composite.setLayout(gl_composite);
Button rowSelection = new Button(composite, SWT.CHECK);
rowSelection.setEnabled(enabled);
Map<Integer, TextGridColumnLayout> columns = textGridRow.getTextGridColumns();
for(int columnNumber:columns.keySet()){
Text text = new Text(composite, SWT.BORDER);
if(!columns.get(columnNumber).grabHorizantalAccessSpace()){
GridData gd_text = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gd_text.widthHint = columns.get(columnNumber).getColumnWidth();
text.setLayoutData(gd_text);
text.setEditable(columns.get(columnNumber).isEditable());
text.setEnabled(columns.get(columnNumber).isEnabled());
}else{
text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
text.setBounds(0, 0, 76, 21);
text.setFocus();
text.setEditable(columns.get(columnNumber).isEditable());
text.setEnabled(columns.get(columnNumber).isEnabled());
}
if(rowData!=null)
text.setText(rowData.get(columnNumber));
}
return composite;
}
示例4: textBoxWidget
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
public Text textBoxWidget(Composite parent, int style, int[] bounds,
String text, boolean value) {
Text textWidget = new Text(parent, style);
textWidget.setBounds(bounds[0], bounds[1], bounds[2], bounds[3]);
textWidget.setText(text);
textWidget.setEditable(value);
return textWidget;
}
示例5: textBoxWidget
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
public Text textBoxWidget(Composite parent, int[] bounds, String textValue, boolean value) {
Text text = new Text(parent, SWT.BORDER | SWT.READ_ONLY | SWT.LEFT);
text.setBounds(bounds[0], bounds[1], bounds[2], bounds[3]);
text.setText(textValue);
text.setEditable(value);
return text;
}
示例6: relocate
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
@Override
public void relocate(CellEditor celleditor) {
Text text = (Text)celleditor.getControl();
Rectangle rect = comment.getClientArea();
comment.translateToAbsolute(rect);
org.eclipse.swt.graphics.Rectangle trim = text.computeTrim(0, 0, 0, 0);
rect.translate(trim.x, trim.y);
rect.width += trim.width;
rect.height += trim.height;
//text.setBounds(rect.x, rect.y, rect.width, rect.height);
text.setBounds(rect.x - 5, rect.y - 8, rect.width+10, rect.height+16);
}
示例7: relocate
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
@Override
public void relocate(CellEditor celleditor) {
Text text=(Text)celleditor.getControl();
text.setBounds(node.getX(), node.getY(),node.getWidth(), node.getHeight());
}