本文整理匯總了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));
}
示例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: 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();
}
示例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();
}
}
示例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);
}
}
});
}
示例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();
}