本文整理汇总了Java中org.eclipse.swt.widgets.Text.setEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java Text.setEnabled方法的具体用法?Java Text.setEnabled怎么用?Java Text.setEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Text
的用法示例。
在下文中一共展示了Text.setEnabled方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buttonSelectionListener
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
/**
* The Function will call to disable the widgets
* @param textbox1
* @param textbox2
* @param buttonWidgets
* @return Selection Adapter
*/
private SelectionAdapter buttonSelectionListener( Text textbox2,Widget... buttonWidgets){
Supplier<Stream<Widget>> streamSupplier = () -> Stream.of(buttonWidgets);
SelectionAdapter adapter = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
newTableRadioButton.setSelection(false);
textbox2.setEnabled(false);
streamSupplier.get().forEach((Widget widgets) ->{((Button)widgets).setEnabled(false);});
if(OSValidator.isMac()){
((Button)event.getSource()).setFocus();
}
propertyDialogButtonBar.enableApplyButton(true);
}
};
return adapter;
}
示例2: disabledWidgetsifWholeExpressionIsParameterForAggregateCumulate
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
/**
* @param isParam
* @param isWholeOperationParameter
*/
private void disabledWidgetsifWholeExpressionIsParameterForAggregateCumulate(Button isParam,
boolean isWholeOperationParameter) {
if (isWholeOperationParameter) {
Text textAccumulator = (Text) isParam.getData(Messages.TEXT_ACCUMULATOR);
Button isParamAccumulator = (Button) isParam.getData(Messages.ISPARAM_ACCUMULATOR);
Combo comboDataTypes = (Combo) isParam.getData(Messages.COMBODATATYPES);
Button button =(Button) isParam.getData(Constants.EXPRESSION_EDITOR_BUTTON1);
button.setEnabled(false);
textAccumulator.setEnabled(false);
isParamAccumulator.setEnabled(false);
comboDataTypes.setEnabled(false);
super.disabledWidgetsifWholeExpressionIsParameter(isParamAccumulator, isWholeOperationParameter);
}
}
示例3: disabledWidgetsifWholeExpressionIsParameter
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
/**
* @param isParam
* @param isWholeOperationParameter
*/
protected void disabledWidgetsifWholeExpressionIsParameter(Button isParam, boolean isWholeOperationParameter) {
if (isWholeOperationParameter) {
TableViewer tableViewer = (TableViewer) isParam.getData(Constants.INPUT_FIELD_TABLE);
Button addButton = (Button) isParam.getData(Constants.ADD_BUTTON);
Button deleteButton = (Button) isParam.getData(Constants.DELETE_BUTTON);
Text expressionIdTextBox = (Text) isParam.getData(Constants.EXPRESSION_ID_TEXT_BOX);
Button browseButton = (Button) isParam.getData(Constants.EXPRESSION_EDITOR_BUTTON);
Text outputFieldTextBox = (Text) isParam.getData(Constants.OUTPUT_FIELD_TEXT_BOX);
tableViewer.getTable().setEnabled(false);
addButton.setEnabled(false);
deleteButton.setEnabled(false);
expressionIdTextBox.setEnabled(false);
browseButton.setEnabled(false);
outputFieldTextBox.setEnabled(false);
}
}
示例4: attachToPropertySubGroup
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
@Override
public void attachToPropertySubGroup(AbstractELTContainerWidget subGroup) {
logger.debug("Starting {} button creation");
ELTDefaultSubgroupComposite selectUpdateKeysComposite = new ELTDefaultSubgroupComposite(subGroup.getContainerControl());
selectUpdateKeysComposite.createContainerWidget();
ELTDefaultLable defaultLable1 = new ELTDefaultLable(Messages.LABEL_UPDATE_BY_KEYS);
selectUpdateKeysComposite.attachWidget(defaultLable1);
setPropertyHelpWidget((Control) defaultLable1.getSWTWidgetControl());
ELTDefaultTextBox defaultUpdateByKeysTextBox = new ELTDefaultTextBox();
selectUpdateKeysComposite.attachWidget(defaultUpdateByKeysTextBox);
updateByKeysTextBox=(Text)defaultUpdateByKeysTextBox.getSWTWidgetControl();
updateByKeysTextBox.setEnabled(false);
setPropertyHelpWidget((Control) defaultUpdateByKeysTextBox.getSWTWidgetControl());
ELTDefaultButton eltDefaultButton = new ELTDefaultButton(Messages.LABEL_SELECT_KEYS);
selectUpdateKeysComposite.attachWidget(eltDefaultButton);
selectKeysButton=(Button)eltDefaultButton.getSWTWidgetControl();
updateByKeysTextBoxDecorator = WidgetUtility.addDecorator(updateByKeysTextBox, Messages.bind(Messages.EMPTY_FIELD, "JDBC Driver \n Class"));
updateByKeysTextBoxDecorator.setMarginWidth(3);
if(StringUtils.isNotEmpty(propertyValue)){
updateByKeysTextBox.setText(propertyValue);
updateByKeysTextBoxDecorator.hide();
}
attachButtonListner(selectKeysButton);
updateByKeysTextBox.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent event) {
Text textBox=(Text)event.widget;
if(StringUtils.isBlank(textBox.getText())){
updateByKeysTextBoxDecorator.show();
}else{
updateByKeysTextBoxDecorator.hide();
}
}
});
}
示例5: createNewMode
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private void createNewMode() {
btnCreateNewRadioButton = new Button(this, SWT.RADIO);
btnCreateNewRadioButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 12, 1));
btnCreateNewRadioButton.setText(MessageUtil.getString("standalone_mode"));
btnCreateNewRadioButton.setSelection(false);
btnCreateNewRadioButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
switch (e.type) {
case SWT.Selection:
updateUI();
break;
}
}
});
btnCreateNewRadioButton.setData(GW4E_CONVERSION_WIDGET_ID, GW4E_NEWCLASS_CHECKBOX);
Composite composite = new Composite(this, SWT.NONE);
composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 12, 1));
composite.setLayout(new GridLayout(12, false));
lblNewClassnameLabel = new Label(composite, SWT.NONE);
lblNewClassnameLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
lblNewClassnameLabel.setText("Class name");
lblNewClassnameLabel.setEnabled(false);
newClassnameText = new Text(composite, SWT.BORDER);
newClassnameText.setEnabled(false);
newClassnameText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent event) {
listener.handleEvent(null);
}
});
newClassnameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 8, 1));
newClassnameText.setEnabled(false);
newClassnameText.setData(GW4E_CONVERSION_WIDGET_ID, GW4E_NEWCLASS_TEXT);
}
示例6: 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;
}
示例7: createSearchTextBox
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private void createSearchTextBox(Composite headerComposite) {
functionSearchTextBox = new Text(headerComposite, SWT.BORDER);
GridData gd_searchTextBox = new GridData(SWT.RIGHT, SWT.CENTER, true, true, 0, 0);
gd_searchTextBox.widthHint = 150;
functionSearchTextBox.setLayoutData(gd_searchTextBox);
functionSearchTextBox.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 128, 128, 128));
functionSearchTextBox.setText(Constants.DEFAULT_SEARCH_TEXT);
functionSearchTextBox.setEnabled(false);
addListnersToSearchTextBox();
ExpressionEditorUtil.INSTANCE.addFocusListenerToSearchTextBox(functionSearchTextBox);
}
示例8: validateTextWidget
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private void validateTextWidget(Text text, boolean isEnable, ControlDecoration controlDecoration, Color color){
text.setText("");
text.setEnabled(isEnable);
if(!isEnable){
controlDecoration.hide();
}
text.setBackground(color);
}
示例9: disabledWidgetsifWholeExpressionIsParameterForAggregateCumulate
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
/**
* @param isParam
* @param isWholeOperationParameter
*/
private void disabledWidgetsifWholeExpressionIsParameterForAggregateCumulate(Button isParam,
boolean isWholeOperationParameter) {
if (isWholeOperationParameter) {
Text textAccumulator = (Text) isParam.getData(Messages.TEXT_ACCUMULATOR);
Button isParamAccumulator = (Button) isParam.getData(Messages.ISPARAM_ACCUMULATOR);
Combo comboDataTypes = (Combo) isParam.getData(Messages.COMBODATATYPES);
textAccumulator.setEnabled(false);
isParamAccumulator.setEnabled(false);
comboDataTypes.setEnabled(false);
super.disabledWidgetsifWholeExpressionIsParameter(isParamAccumulator, isWholeOperationParameter);
}
}
示例10: disabledWidgetsifWholeOperationIsParameter
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private void disabledWidgetsifWholeOperationIsParameter(Button isParam,boolean isWholeOperationParameter)
{
if (isWholeOperationParameter) {
Button text = (Button) isParam;
Text parameterTextBox = (Text) text.getData(PARAMETER_TEXT_BOX);
TableViewer operationInputFieldTableViewer = (TableViewer) text.getData(OPERATION_INPUT_FIELD_TABLE_VIEWER);
TableViewer operationalOutputFieldTableViewer = (TableViewer) text.getData(OPERATION_OUTPUT_FIELD_TABLE_VIEWER);
Text operationClassTextBox = (Text) text.getData(OPERATION_CLASS_TEXT_BOX);
Text operationIDTextBox = (Text) text.getData(OPERATION_ID_TEXT_BOX);
Button btnNewButton = (Button) text.getData(BTN_NEW_BUTTON);
Button inputAdd = (Button) text.getData(INPUT_ADD_BUTTON);
Button inputDelete = (Button) text.getData(INPUT_DELETE_BUTTON);
Button outputAdd = (Button) text.getData(OUTPUT_ADD_BUTTON);
Button outputDelete = (Button) text.getData(OUTPUT_DELETE_BUTTON);
parameterTextBox.setEnabled(true);
operationInputFieldTableViewer.getTable().setEnabled(false);
operationalOutputFieldTableViewer.getTable().setEnabled(false);
operationClassTextBox.setEnabled(false);
operationIDTextBox.setEnabled(false);
btnNewButton.setEnabled(false);
inputAdd.setEnabled(false);
inputDelete.setEnabled(false);
outputAdd.setEnabled(false);
outputDelete.setEnabled(false);
}
}
示例11: attachToPropertySubGroup
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
@Override
public void attachToPropertySubGroup(AbstractELTContainerWidget container) {
logger.trace("Starting {} textbox creation", textBoxConfig.getName());
lableAndTextBox = new ELTDefaultSubgroupComposite(container.getContainerControl());
lableAndTextBox.createContainerWidget();
AbstractELTWidget label = new ELTDefaultLable(textBoxConfig.getName() + " ");
lableAndTextBox.attachWidget(label);
setPropertyHelpWidget((Control) label.getSWTWidgetControl());
AbstractELTWidget textBoxWidget = new ELTDefaultTextBox().
grabExcessHorizontalSpace(textBoxConfig.getGrabExcessSpace());//.textBoxWidth(textBoxConfig.getwidgetWidth());
lableAndTextBox.attachWidget(textBoxWidget);
textBox = (Text) textBoxWidget.getSWTWidgetControl();
textBox.setEnabled(textBoxConfig.isEnabled());
txtDecorator = WidgetUtility.addDecorator(textBox, Messages.bind(Messages.EMPTY_FIELD, textBoxConfig.getName()));
txtDecorator.setMarginWidth(3);
GridData gridData = (GridData)textBox.getLayoutData();
if(OSValidator.isMac()){
gridData.widthHint = 106;
}else{
gridData.widthHint = 80;
}
attachListeners(textBoxWidget);
String property = propertyValue;
textBox.setText(property);
/**
*parameter resolution at dev phase
*/
Utils.INSTANCE.loadProperties();
cursor = container.getContainerControl().getDisplay().getSystemCursor(SWT.CURSOR_HAND);
populateWidget();
logger.trace("Finished {} textbox creation", textBoxConfig.getName());
}
示例12: createPageNumberDisplay
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private void createPageNumberDisplay(Composite composite_3) {
Text pageNumberDisplayTextBox = new Text(composite_3, SWT.BORDER | SWT.CENTER);
pageNumberDisplayTextBox.setEnabled(false);
pageNumberDisplayTextBox.setEditable(false);
GridData gd_text = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
gd_text.widthHint = 178;
pageNumberDisplayTextBox.setLayoutData(gd_text);
windowControls.put(ControlConstants.PAGE_NUMBER_DISPLAY, pageNumberDisplayTextBox);
}
示例13: createExtendMode
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private void createExtendMode() {
btnExtendRadioButton = new Button(this, SWT.RADIO);
btnExtendRadioButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 12, 1));
btnExtendRadioButton.setText(MessageUtil.getString("extending_class"));
btnExtendRadioButton.setSelection(false);
btnExtendRadioButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
switch (e.type) {
case SWT.Selection:
updateUI();
break;
}
}
});
btnExtendRadioButton.setData(GW4E_CONVERSION_WIDGET_ID, GW4E_EXTEND_CHECKBOX);
Composite composite = new Composite(this, SWT.NONE);
composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 12, 1));
composite.setLayout(new GridLayout(12, false));
lblExtendedLabel = new Label(composite, SWT.NONE);
lblExtendedLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
lblExtendedLabel.setText(MessageUtil.getString("class_extended"));
lblExtendedLabel.setEnabled(false);
comboExtendedClassnameViewer = new AncestorViewer(composite);
comboExtendedClassnameViewer.initialize(GW4E_CONVERSION_COMBO_ANCESTOR_EXTEND_TEST, false);
comboExtendedClassnameViewer.getCombo().setData(GW4E_CONVERSION_WIDGET_ID, GW4E_CONVERSION_COMBO_ANCESTOR_EXTEND_TEST);
Combo combo = comboExtendedClassnameViewer.getCombo();
combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 8, 1));
combo.setEnabled(false);
lblExtendingLabel = new Label(composite, SWT.NONE);
lblExtendingLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
lblExtendingLabel.setText(MessageUtil.getString("classname"));
lblExtendingLabel.setEnabled(false);
extendingClassnameText = new Text(composite, SWT.BORDER);
extendingClassnameText.setEnabled(false);
extendingClassnameText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent event) {
listener.handleEvent(null);
}
});
extendingClassnameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 8, 1));
extendingClassnameText.setEnabled(false);
extendingClassnameText.setData(GW4E_CONVERSION_WIDGET_ID, GW4E_EXTEND_CLASS_TEXT);
}