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


Java Text.setFocus方法代码示例

本文整理汇总了Java中org.eclipse.swt.widgets.Text.setFocus方法的典型用法代码示例。如果您正苦于以下问题:Java Text.setFocus方法的具体用法?Java Text.setFocus怎么用?Java Text.setFocus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.widgets.Text的用法示例。


在下文中一共展示了Text.setFocus方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initialize

import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
/**
 * This method initializes this
 * 
 */
private void initialize() {
       GridData gridData2 = new org.eclipse.swt.layout.GridData();
       gridData2.horizontalSpan = 3;
       label1 = new Label(this, SWT.NONE);
       label1.setText("Please use a relevant project name. Avoid the use of special characters  (âàéèêù...)\nand punctuation characters as space, pound or others. We suggest you use only lowercase letters. \nIf you use uppercase letters, be sure use the same letter case when you will call\ntransactions using the convertigo's url interface.\n\nThe project name also defines the Convertigo's physical and virtual directories:\n\n- All your project's ressources will be held in the <your_workspace>/convertigo/projects/<your_project_name> directory.\n- Your project's URL will be http://<server_name>:<port>/convertigo/projects/<your_project_name>\n\n");
       label1.setLayoutData(gridData2);
       GridData gridData1 = new org.eclipse.swt.layout.GridData();
       gridData1.grabExcessHorizontalSpace = true;
       gridData1.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
       gridData1.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
       GridData gridData = new org.eclipse.swt.layout.GridData();
       gridData.grabExcessHorizontalSpace = false;
       gridData.horizontalAlignment = org.eclipse.swt.layout.GridData.BEGINNING;
       gridData.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
       gridData.grabExcessVerticalSpace = false;
       label = new Label(this, SWT.NONE);
       label.setText("Project's name");
       label.setLayoutData(gridData);
       projectName = new Text(this, SWT.BORDER);
       projectName.setLayoutData(gridData1);
       projectName.addModifyListener(modifyListener);
       projectName.setFocus();
       GridLayout gridLayout = new GridLayout();
       gridLayout.numColumns = 2;
       this.setLayout(gridLayout);
       this.setSize(new org.eclipse.swt.graphics.Point(514,264));
		
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:33,代码来源:NewProjectWizardComposite1.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: createAssitTextBox

import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private void createAssitTextBox(Point cursorRelativePosition) {
	assistText = new Text((Composite) graphicControl, SWT.BORDER);
	assistText.setLocation(cursorRelativePosition.x, cursorRelativePosition.y - assistText.getLineHeight());
	assistText.setSize(200, assistText.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
	assistText.setTextLimit(51);
	assistText.setFocus();
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:8,代码来源:ComponentSearchUtility.java

示例5: controlChanged

import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
public void controlChanged(Control control) {
	sectionChanged(control);
	if (control instanceof Text) {
		Text t = ((Text) control);
		t.setFocus();
		t.setSelection(t.getText().length());
	} else if (control instanceof Combo) {
		Combo combo = (Combo) control;
		combo.setFocus();
	} else {
		control.setFocus();
	}
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:14,代码来源:AbstractSection.java

示例6: open

import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
/**
 * Create and display the wizard pane.
 * @see com.webcodepro.applecommander.ui.swt.wizard.WizardPane#open()
 */
public void open() {
	control = new Composite(parent, SWT.NULL);
	control.setLayoutData(layoutData);
	wizard.enableNextButton(false);
	wizard.enableFinishButton(true);
	RowLayout layout = new RowLayout(SWT.VERTICAL);
	layout.justify = true;
	layout.marginBottom = 5;
	layout.marginLeft = 5;
	layout.marginRight = 5;
	layout.marginTop = 5;
	layout.spacing = 3;
	control.setLayout(layout);
	Label label = new Label(control, SWT.WRAP);
	label.setText(textBundle.get("ExportFilePrompt")); //$NON-NLS-1$

	directoryText = new Text(control, SWT.WRAP | SWT.BORDER);
	if (wizard.getDirectory() != null) directoryText.setText(wizard.getDirectory());
	directoryText.setLayoutData(new RowData(parent.getSize().x - 30, -1));
	directoryText.setBackground(new Color(control.getDisplay(), 255,255,255));
	directoryText.setFocus();
	directoryText.addModifyListener(new ModifyListener() {
		public void modifyText(ModifyEvent event) {
			Text text = (Text) event.getSource();
			getWizard().setDirectory(text.getText());
		}
	});
	
	Button button = new Button(control, SWT.PUSH);
	button.setText(textBundle.get("BrowseButton")); //$NON-NLS-1$
	button.addSelectionListener(new SelectionAdapter() {
		public void widgetSelected(SelectionEvent e) {
			DirectoryDialog directoryDialog = new DirectoryDialog(getShell());
			directoryDialog.setFilterPath(getDirectoryText().getText());
			directoryDialog.setMessage(
				UiBundle.getInstance().get("ExportFileDirectoryPrompt")); //$NON-NLS-1$
			String directory = directoryDialog.open();
			if (directory != null) {
				getDirectoryText().setText(directory);
			}
		}
	});
}
 
开发者ID:AppleCommander,项目名称:AppleCommander,代码行数:48,代码来源:ExportFileDestinationPane.java

示例7: attachToPropertySubGroup

import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
@Override
public void attachToPropertySubGroup(AbstractELTContainerWidget container) {

	ELTDefaultSubgroupComposite eltDefaultSubgroupComposite = new ELTDefaultSubgroupComposite(
			container.getContainerControl());
	eltDefaultSubgroupComposite.createContainerWidget();

	AbstractELTWidget eltDefaultLable = new ELTDefaultLable(NAME);
	eltDefaultSubgroupComposite.attachWidget(eltDefaultLable);
	setPropertyHelpWidget((Control) eltDefaultLable.getSWTWidgetControl());

	AbstractELTWidget eltDefaultTextBox = new ELTDefaultTextBox().defaultText("Hello")
			.grabExcessHorizontalSpace(true);
	eltDefaultSubgroupComposite.attachWidget(eltDefaultTextBox);

	text = (Text) eltDefaultTextBox.getSWTWidgetControl();
	text.setFocus();
	text.setTextLimit(256);
	firstTextWidget = text;
	txtDecorator = WidgetUtility.addDecorator(text, Messages.FIELD_LABEL_ERROR);
	txtDecorator.setMarginWidth(3);
	ListenerHelper listenerHelper = new ListenerHelper();
	listenerHelper.put(HelperType.CONTROL_DECORATION, txtDecorator);
	listenerHelper.put(HelperType.CURRENT_COMPONENT, getComponent());
	try {
		listener = (ELTVerifyComponentNameListener) ListenerFactory.Listners.VERIFY_COMPONENT_NAME.getListener();
		listener.setNames((ArrayList<String>) super.componentMiscellaneousProperties
				.getComponentMiscellaneousProperty(COMPONENT_NAMES));
		eltDefaultTextBox.attachListener(listener, propertyDialogButtonBar, listenerHelper,
				eltDefaultTextBox.getSWTWidgetControl());

		focusOutListener = (ELTNormalFocusOutListener) ListenerFactory.Listners.NORMAL_FOCUS_OUT.getListener();
		listener.setNames((ArrayList<String>) super.componentMiscellaneousProperties
				.getComponentMiscellaneousProperty(COMPONENT_NAMES));
		eltDefaultTextBox.attachListener(focusOutListener, propertyDialogButtonBar, listenerHelper,
				eltDefaultTextBox.getSWTWidgetControl());

	} catch (Exception exception) {
		logger.error("Exception occured", exception);
	}

	populateWidget();

}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:45,代码来源:ELTComponentNameWidget.java


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