当前位置: 首页>>代码示例>>Java>>正文


Java Text.setBounds方法代码示例

本文整理汇总了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);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:9,代码来源:VertextCellEditorLocator.java

示例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;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:40,代码来源:TextGridRowBuilder.java

示例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;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:38,代码来源:TextGridRowBuilder.java

示例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;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:10,代码来源:ELTSWTWidgets.java

示例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;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:9,代码来源:ELTLookupConfigGrid.java

示例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);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:14,代码来源:CommentBoxCellEditorLocator.java

示例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());
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:6,代码来源:NodeCellEditorLocator.java


注:本文中的org.eclipse.swt.widgets.Text.setBounds方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。