本文整理汇总了Java中org.eclipse.swt.widgets.Text.getText方法的典型用法代码示例。如果您正苦于以下问题:Java Text.getText方法的具体用法?Java Text.getText怎么用?Java Text.getText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Text
的用法示例。
在下文中一共展示了Text.getText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getZnodeData
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
@Override
public byte[] getZnodeData() throws Exception {
Text filePathText = (Text) getControl(CONTROL_NAME_DATA_FILE_TEXT);
String filePath = filePathText.getText();
File file = new File(filePath);
String fileName = file.getName();
if (!file.exists()) {
throw new IOException("File '" + fileName + "' does not exist.");
}
if (!file.isFile()) {
throw new IOException("Path '" + filePath + "' is not a valid file.");
}
long length = file.length();
if (length > Znode.MAX_DATA_SIZE) {
throw new Exception("File '" + fileName
+ "' size is greater than the maximum allowed Znode data size (" + Znode.MAX_DATA_SIZE
+ " bytes).");
}
FileEditor fileEditor = new FileEditor(file);
return fileEditor.read();
}
示例2: checkIfXPathIsDuplicate
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private void checkIfXPathIsDuplicate( ) {
Text loopXpathQueryTextBox=(Text)table.getData();
String loopXPathQuery=loopXpathQueryTextBox.getText();
Set<Path> setToCheckDuplicates= new HashSet<Path>();
Set<String> uniqueName=new HashSet<>();
for(TableItem tableItem:table.getItems()){
Path xPathColumn=makeXPathAbsoluteIfNot(tableItem.getText(2), loopXPathQuery);
if(!uniqueName.add(tableItem.getText(0))){
tableItem.setData(Constants.ERROR_MESSAGE,FIELD_IS_DUPLICATE);
setRedColor(tableItem);
}
else if(!setToCheckDuplicates.add(xPathColumn)){
tableItem.setData(Constants.ERROR_MESSAGE,Messages.X_PATH_IS_DUPLICATE);
setRedColor(tableItem);
}
else{
tableItem.setData(Constants.ERROR_MESSAGE,"");
setBlackColor(tableItem);
}
}
}
示例3: buttonWidgetSelectionListener
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private SelectionAdapter buttonWidgetSelectionListener(Text textWidget){
SelectionAdapter adapter = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
String text = textWidget.getText();
SQLQueryStatementDialog sqlQueryStatementDialog = new SQLQueryStatementDialog(
Display.getCurrent().getActiveShell(), text);
sqlQueryStatementDialog.open();
if(sqlQueryStatementDialog.getStyleTextSqlQuery() != null){
textWidget.setText(sqlQueryStatementDialog.getStyleTextSqlQuery());
}
if(sqlQueryStatementDialog.isTextValueChanged()){
propertyDialogButtonBar.enableApplyButton(true);
}
}
};
return adapter;
}
示例4: jumpPageListener
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private void jumpPageListener() {
final Text jumpPageTextBox = ((Text) windowControls.get(ControlConstants.JUMP_TEXT));
if (((Text) windowControls.get(ControlConstants.JUMP_TEXT)).getText().isEmpty()) {
statusManager.setStatus(new StatusMessage(StatusConstants.ERROR, Messages.JUMP_PAGE_TEXTBOX_CAN_NOTE_BE_EMPTY));
return;
}
String statusMessage=Messages.FETCHING_PAGE + " " + jumpPageTextBox.getText();
statusManager.setStatus(new StatusMessage(StatusConstants.PROGRESS, statusMessage));
statusManager.setAllWindowControlsEnabled(false);
Long pageNumberToJump = Long.valueOf(jumpPageTextBox.getText());
executeJumpPageJob(statusMessage, pageNumberToJump);
}
示例5: updateStatusFromGridTextInput
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private GridCompositeStatus updateStatusFromGridTextInput(GridTextInput source) {
Text textControl = source.getText();
String name = source.getName();
GridTextInput.Type inputType = source.getType();
String message;
GridCompositeStatus.Type statusType;
String text = textControl.getText();
String defaultValue = source.getDefaultTextValue();
if (inputType.isValueRequired() && text.trim().length() == 0) {
if (defaultValue != null) {
message = name + " value must be specified. Default value is " + defaultValue;
}
else {
message = name + " value must be specified.";
}
statusType = GridCompositeStatus.Type.ERROR_REQUIRED;
return new GridCompositeStatus(name, message, statusType);
}
if (inputType.isInteger() && !GridTextInput.isValidIntegerText(text)) {
if (defaultValue != null) {
message = name + " value must be a positive integer. Default value is " + defaultValue;
}
else {
message = name + " value must be a positive integer.";
}
statusType = GridCompositeStatus.Type.ERROR_INVALID;
return new GridCompositeStatus(name, message, statusType);
}
return GridCompositeStatus.OK_STATUS;
}
示例6: okPressed
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
@Override
protected void okPressed() {
GridComposite gridComposite = getGridComposite();
CCombo typeCombo = (CCombo) gridComposite.getControl(CONTROL_NAME_TYPE_COMBO);
Text schemeText = (Text) gridComposite.getControl(CONTROL_NAME_SCHEME_TEXT);
Text authStringText = (Text) gridComposite.getControl(CONTROL_NAME_AUTH_STRING_TEXT);
AuthInfo.Type type = AuthInfo.Type.valueOf(typeCombo.getText());
String scheme = schemeText.getText();
String authString = authStringText.getText();
_AuthInfo = new AuthInfo(type, scheme, authString);
super.okPressed();
}
示例7: okPressed
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
@Override
protected void okPressed() {
GridComposite gridComposite = getGridComposite();
Text userNameText = (Text) gridComposite.getControl(CONTROL_NAME_USER_NAME_TEXT);
Text passwordText = (Text) gridComposite.getControl(CONTROL_NAME_PASSWORD_TEXT);
String userName = userNameText.getText();
String password = passwordText.getText();
_DigestId = generateDigest(userName + ":" + password);
super.okPressed();
}
示例8: getPassword
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
public String getPassword() {
Text passwordText = (Text) getGridComposite().getControl(CONTROL_NAME_PASSWORD_TEXT);
String password = passwordText.getText();
if (password.isEmpty()) {
return null;
}
return password;
}
示例9: getConnectionDescriptor
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
public ZooKeeperConnectionDescriptor getConnectionDescriptor() {
Text nameText = (Text) getControl(CONTROL_NAME_NAME_TEXT);
Text sessionTimeoutText = (Text) getControl(CONTROL_NAME_SESSION_TIMEOUT_TEXT);
String name = nameText.getText();
int sessionTimeout = Integer.parseInt(sessionTimeoutText.getText());
ZooKeeperConnectionDescriptor connection = new ZooKeeperConnectionDescriptor(name, sessionTimeout);
connection.getServers().addAll(_ServerComposite.getElementList());
connection.setRootPath(getRootPath());
return connection;
}
示例10: validate
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
protected void validate() {
Text text = (Text) deco.getControl();
String value = text.getText();
String errorMsg = validator.isValid(value);
if (errorMsg == null) {
deco.hide();
}
else {
deco.show();
deco.setImage(errorImg);
deco.setDescriptionText(errorMsg);
}
}
示例11: getServiceUrl
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
public JMXServiceURL getServiceUrl() {
Text jmxUrlText = (Text) getGridComposite().getControl(CONTROL_NAME_JMX_URL_TEXT);
String jmxServiceUrlString = jmxUrlText.getText();
try {
return new JMXServiceURL(jmxServiceUrlString);
}
catch (MalformedURLException e) {
// Validation should ensure that this should never happen
return null;
}
}
示例12: modifyText
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
@Override
public void modifyText(ModifyEvent event) {
Text textBox = (Text)event.getSource();
Button btnRemoteMode = (Button)textBox.getData(RunConfigDialog.SELECTION_BUTTON_KEY);
String txt= textBox.getText();
if (StringUtils.isBlank(txt)) {
if(errorDecorator==null){
errorDecorator = WidgetUtility.addDecorator(textBox,Messages.bind(Messages.EMPTY_FIELD, fieldName));
}
if(btnRemoteMode!=null){
if(btnRemoteMode.getSelection()){
errorDecorator.show();
}else
errorDecorator.hide();
}else{
errorDecorator.show();
}
errorDecorator.setMarginWidth(3);
} else {
if(errorDecorator!=null)
errorDecorator.hide();
}
}
示例13: getDirectEditCommand
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
@Override
protected Command getDirectEditCommand(DirectEditRequest request) {
Text text=(Text)request.getCellEditor().getControl();
TransitionLabel transitionLabel=(TransitionLabel)(this.getHost().getModel());
return new TransitionLabelDirectEditCommand(transitionLabel,text.getText());
}
示例14: getHost
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
public String getHost() {
Text hostText = (Text) getGridComposite().getControl(CONTROL_NAME_HOST_TEXT);
String host = hostText.getText();
return host.trim();
}
示例15: getCurrentValue
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
protected String getCurrentValue() {
Text text = (Text) deco.getControl();
return text.getText();
}