Java Code Examples for org.eclipse.swt.events.ModifyListener

The following examples show how to use org.eclipse.swt.events.ModifyListener. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: hop   Author: project-hop   File: AuthComposite.java    License: Apache License 2.0 6 votes vote down vote up
public AuthComposite( Composite composite, int style, PropsUi props, ModifyListener lsMod, PipelineMeta pipelineMeta,
                      String credentialGroupName, String usernameLabel, String passwordLabel ) {
  super( composite, style );
  checkNotNull( props );
  checkNotNull( lsMod );
  checkNotNull( pipelineMeta );

  this.props = props;
  this.lsMod = lsMod;
  this.pipelineMeta = pipelineMeta;

  this.authGroupLabel = credentialGroupName;
  this.usernameLabel = usernameLabel;
  this.passwordLabel = passwordLabel;

  layoutComposite();
}
 
Example #2
Source Project: tmxeditor8   Author: heartsome   File: CellEditorGlobalActionHanlder.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Add a <code>Text</code> control to the handler so that the Cut, Copy, Paste, Delete, Undo, Redo and Select All
 * actions are redirected to it when active.
 * @param viewer
 *            the inline <code>Text</code> control
 */
public void addTextViewer(CellEditorTextViewer viewer) {
	if (viewer == null) {
		return;
	}
	this.viewer = viewer;
	StyledText textControl = viewer.getTextWidget();

	viewer.addSelectionChangedListener(new ISelectionChangedListener() {
		public void selectionChanged(SelectionChangedEvent event) {
			updateActionsEnableState();
		}
	});

	textControl.addModifyListener(new ModifyListener() {
		public void modifyText(ModifyEvent e) {
			updateActionsEnableState();
		}
	});

	updateActionsEnableState();
}
 
Example #3
Source Project: birt   Author: eclipse   File: DataSetComputedColumnsPage.java    License: Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 
 * @param parent
 * @param index
 */
private void createTextCell( Composite parent, final int index )
{
	firstLabel = ControlProvider.createLabel( parent,
			dialogLabels[index] );
	this.maxWidth = computeMaxWidth( firstLabel );

	txtColumnName = ControlProvider.createText( parent,
			(String) getProperty( getStructureOrHandle( ),
					cellProperties[index] ) );
	txtColumnName.setLayoutData( ControlProvider.getGridDataWithHSpan( 2 ) );
	columnName = txtColumnName.getText( );
	txtColumnName.addModifyListener( new ModifyListener( ) {

		public void modifyText( ModifyEvent e )
		{
			validateSyntax( );
		}
	} );
}
 
Example #4
Source Project: xds-ide   Author: excelsior-oss   File: SdkToolsControlAddDialog.java    License: Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void createControl(Composite parent) {
    initializeDialogUnits(parent);
    Composite container = new Composite(parent, SWT.NULL);
    setControl(container);

    container.setLayout(new GridLayout(2, false));

    SWTFactory.createVerticalSpacer(container, 2.0);
    SWTFactory.createLabel(container, Messages.SdkToolsControlAddDialog_GroupName + ':', 1);
    text = SWTFactory.createSingleText(container,  1);
    text.addModifyListener(new ModifyListener() {
        @Override
        public void modifyText(ModifyEvent e) {
            validatePage();
        }
    });
    
    text.setText(groupName);
    text.setFocus();
    validatePage();
}
 
Example #5
Source Project: cmake4eclipse   Author: 15knots   File: AddCmakeUndefineDialog.java    License: Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Create contents of the dialog.
 *
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
  Composite comp = (Composite) super.createDialogArea(parent);
  ((GridLayout) comp.getLayout()).numColumns = 2;

  Label nameLabel = new Label(comp, SWT.NONE);
  nameLabel.setText("Variable &name:");
  GridData gd_nameLabel = new GridData();
  gd_nameLabel.horizontalAlignment = SWT.LEFT;
  nameLabel.setLayoutData(gd_nameLabel);

  variableName = new Text(comp, SWT.BORDER);
  // disable OK button if variable name is empty..
  variableName.addModifyListener(new ModifyListener() {
    public void modifyText(ModifyEvent e) {
      final boolean enable = ((Text) e.widget).getText().trim().length() > 0;
      final Button button = getButton(IDialogConstants.OK_ID);
      button.setEnabled(enable);
    }
  });
  variableName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

  return comp;
}
 
Example #6
Source Project: pentaho-kettle   Author: pentaho   File: IngresVectorwiseLoaderDialog.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * @param parent
 * @param in
 * @param tr
 * @param sname
 */
public IngresVectorwiseLoaderDialog( Shell parent, Object in, TransMeta tr, String sname ) {
  super( parent, (BaseStepMeta) in, tr, sname );
  input = (IngresVectorwiseLoaderMeta) in;

  lsMod = new ModifyListener() {
    public void modifyText( ModifyEvent e ) {
      input.setChanged();
    }
  };

  lsSelMod = new SelectionAdapter() {
    public void widgetSelected( SelectionEvent arg0 ) {
      input.setChanged();
    }
  };
}
 
Example #7
Source Project: Eclipse-Postfix-Code-Completion   Author: trylimits   File: StringDialogField.java    License: Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Creates or returns the created text control.
 * @param parent The parent composite or <code>null</code> when the widget has
 * already been created.
 * @return the text control
 */
public Text getTextControl(Composite parent) {
	if (fTextControl == null) {
		assertCompositeNotNull(parent);
		fModifyListener= new ModifyListener() {
			public void modifyText(ModifyEvent e) {
				doModifyText();
			}
		};

		fTextControl= createTextControl(parent);
		// moved up due to 1GEUNW2
		fTextControl.setText(fText);
		fTextControl.setFont(parent.getFont());
		fTextControl.addModifyListener(fModifyListener);

		fTextControl.setEnabled(isEnabled());
		if (fContentAssistProcessor != null) {
		    ControlContentAssistHelper.createTextContentAssistant(fTextControl, fContentAssistProcessor);
		}
	}
	return fTextControl;
}
 
Example #8
Source Project: codewind-eclipse   Author: eclipse   File: CodewindPrefsParentPage.java    License: Eclipse Public License 2.0 6 votes vote down vote up
private Text createCWTimeoutEntry(Composite comp, String label, String prefKey) {
    Label timeoutLabel = new Label(comp, SWT.NONE);
    timeoutLabel.setText(label);
    timeoutLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.FILL, false, false));
    
    Text text = new Text(comp, SWT.BORDER);
    text.setText(Integer.toString(prefs.getInt(prefKey)));
    GridData data = new GridData(GridData.BEGINNING, GridData.FILL, false, false);
	data.widthHint = 50;
	text.setLayoutData(data);
	
	text.addModifyListener(new ModifyListener() {
		@Override
		public void modifyText(ModifyEvent arg0) {
			validate();
		}
	});
	
    return text;
}
 
Example #9
Source Project: bonita-studio   Author: bonitasoft   File: ManageJarDialog.java    License: GNU General Public License v2.0 6 votes vote down vote up
private void createSearchText(final Composite composite) {
    searchText = new Text(composite, SWT.SEARCH | SWT.ICON_SEARCH | SWT.BORDER | SWT.CANCEL);
    searchText.setMessage(Messages.search);
    searchText.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());

    searchFilter = new ViewerFilter() {

        @Override
        public boolean select(final Viewer arg0, final Object arg1, final Object element) {
            if (!searchText.getText().isEmpty()) {
                final String searchQuery = searchText.getText().toLowerCase();
                final IRepositoryFileStore file = (IRepositoryFileStore) element;
                return file.getName().toLowerCase().contains(searchQuery);
            }
            return true;
        }
    };

    searchText.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(final ModifyEvent e) {
            tableViewer.refresh();
        }
    });
}
 
Example #10
Source Project: offspring   Author: incentivetoken   File: LoginDialog.java    License: MIT License 6 votes vote down vote up
private void setupControls() {
  buttonBrowse.addSelectionListener(new SelectionAdapter() {

    @Override
    public void widgetSelected(SelectionEvent event) {
      FileDialog fd = new FileDialog(getShell(), SWT.SAVE);
      fd.setText(Messages.LoginDialog_FileDialog_title);
      String path = fd.open();
      if (path != null) {
        updateWalletPath(path);
      }
    };
  });

  ModifyListener listener = new ModifyListener() {

    @Override
    public void modifyText(ModifyEvent e) {
      updateDialogButtons();
    }
  };
  textPassword.addModifyListener(listener);
  textPassword2.addModifyListener(listener);
}
 
Example #11
Source Project: birt   Author: eclipse   File: MeasureDialog.java    License: Eclipse Public License 1.0 6 votes vote down vote up
private void createFilterPart( Composite composite )
{
    new Label( composite, SWT.NONE ).setText( Messages.getString( "MeasureDialog.Label.Filter" ) ); //$NON-NLS-1$
    txtFilter = new Text( composite, SWT.BORDER | SWT.MULTI );
    GridData gd = new GridData( GridData.FILL_HORIZONTAL );
    gd.heightHint = txtFilter.computeSize( SWT.DEFAULT, SWT.DEFAULT ).y - txtFilter.getBorderWidth( ) * 2;
    gd.horizontalSpan = 1;
    txtFilter.setLayoutData( gd );

    txtFilter.addModifyListener( new ModifyListener( ) {

        public void modifyText( ModifyEvent arg0 )
        {
            checkOkButtonStatus( );
        }
    } );
    ExpressionButtonUtil.createExpressionButton( composite,
            txtFilter,
            provider,
            input );        
}
 
Example #12
Source Project: uima-uimaj   Author: apache   File: INSDComponentPage.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Adds the text field.
 *
 * @param parent the parent
 * @param strLabel the str label
 * @param strText the str text
 * @param editable the editable
 * @return the text
 */
public Text addTextField(Composite parent, String strLabel, String strText, boolean editable) {
  Label label = new Label(parent, SWT.NULL);
  label.setText(strLabel);

  Text text = new Text(parent, SWT.BORDER | SWT.SINGLE);
  text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  text.setText(strText);
  text.addModifyListener(new ModifyListener() {
    @Override
    public void modifyText(ModifyEvent e) {
      dialogChanged();
    }
  });
  text.setEditable(editable);
  return text;
}
 
Example #13
Source Project: APICloud-Studio   Author: apicloudcom   File: CommitSetDialog.java    License: GNU General Public License v3.0 6 votes vote down vote up
private void createNameArea(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
layout.marginWidth = 0;
layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
layout.numColumns = 2;
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
composite.setFont(parent.getFont());

Label label = new Label(composite, SWT.NONE);
label.setText(Policy.bind("CommitSetDialog_0")); 
label.setLayoutData(new GridData(GridData.BEGINNING));

nameText = new Text(composite, SWT.BORDER);
nameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
      nameText.addModifyListener(new ModifyListener() {
          public void modifyText(ModifyEvent e) {
              updateEnablements();
          }
      });
  }
 
Example #14
Source Project: n4js   Author: eclipse   File: InstallNpmDependencyDialog.java    License: Eclipse Public License 1.0 6 votes vote down vote up
private void createNameArea(Composite parent, String areaName, Consumer<String> textHandler) {
	final Group area = new Group(parent, SHADOW_ETCHED_IN);
	area.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).create());
	area.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
	area.setText(areaName);

	final Text txtPackageName = getSimpleTextArea(area);
	txtPackageName.addModifyListener(new ModifyListener() {

		@Override
		public void modifyText(ModifyEvent e) {
			Text textWidget = (Text) e.getSource();
			textHandler.accept(textWidget.getText());
		}
	});
}
 
Example #15
Source Project: hop   Author: project-hop   File: ActionDialog.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Adds the connection line for the given parent and previous control, and returns a meta selection manager control
 *
 * @param parent   the parent composite object
 * @param previous the previous control
 * @param
 * @return the combo box UI component
 */
public MetaSelectionLine<DatabaseMeta> addConnectionLine( Composite parent, Control previous, DatabaseMeta selected, ModifyListener lsMod ) {

  final MetaSelectionLine<DatabaseMeta> wConnection = new MetaSelectionLine<>(
    workflowMeta,
    metadataProvider,
    DatabaseMeta.class, parent, SWT.NONE,
    BaseMessages.getString( PKG, "BaseTransformDialog.Connection.Label" ),
    "Select the relational database connection to use" // TODO : i18n
  );
  wConnection.addToConnectionLine( parent, previous, selected, lsMod );
  return wConnection;
}
 
Example #16
Source Project: learning-hadoop   Author: javachen   File: EnterCQLDialog.java    License: Apache License 2.0 5 votes vote down vote up
public EnterCQLDialog(Shell parent, TransMeta transMeta, ModifyListener lsMod, 
    String title, String cql) {
  super(parent, SWT.NONE);
  
  m_parent = parent;
  m_props = PropsUI.getInstance();
  m_title = title;
  m_originalCQL = cql;
  m_transMeta = transMeta;
  m_lsMod = lsMod;
}
 
Example #17
Source Project: hybris-commerce-eclipse-plugin   Author: SAP   File: AttachSourcesPage.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void createControl(Composite parent) 
{
	container = new Composite(parent, SWT.NONE);
	container.setLayout(new GridLayout(2, false));

	this.sourceFileField = new FileFieldEditor("fileSelect", "[y] Source Archive:", container);
	sourceFileField.setFileExtensions( new String[]{"*.zip"} );
	// Set the starting path to the downloads folder or home dir of the current user.
	sourceFileField.setFilterPath( new File(System.getProperty("user.home")) );

	sourceFileField.getTextControl( container ).addModifyListener( new ModifyListener() 
	{
		@Override
		public void modifyText( ModifyEvent e )
		{
			// no validation just yet, as this even gets triggered:
			// (1) copy and paste: once
			// (2) manual typing: once per character entered
			// (3) per change button - selection: once
			// so because of #2: need to do validation when submitting the wizard (in it's performFinish())
			// TODO: there must be a better way, but the FocusListener does not see when the selection is done via the browse button
			
			setErrorMessage(null);
			setPageComplete(true);
			// let the wizard update it's buttons
			getWizard().getContainer().updateButtons();
		}
	} );
			
	// required to avoid an error in the system
	setControl(container);
	// if this is an optional page, we set this page to complete right away.
	setPageComplete(isOptional);
}
 
Example #18
Source Project: goclipse   Author: GoClipse   File: SpinnerNumberField.java    License: Eclipse Public License 1.0 5 votes vote down vote up
public static Spinner createFieldSpinner(FieldWidget<Integer> field, Composite parent, int style) {
	final Spinner spinner = new Spinner(parent, style);
	spinner.addModifyListener(new ModifyListener() {
		@Override
		public void modifyText(ModifyEvent e) {
			field.setFieldValueFromControl(spinner.getSelection());
		}
	});
	return spinner;
}
 
Example #19
Source Project: pentaho-kettle   Author: pentaho   File: ConditionEditor.java    License: Apache License 2.0 5 votes vote down vote up
public void setModified() {
  for ( int i = 0; i < modListeners.size(); i++ ) {
    ModifyListener lsMod = modListeners.get( i );
    if ( lsMod != null ) {
      Event e = new Event();
      e.widget = this;
      lsMod.modifyText( new ModifyEvent( e ) );
    }
  }
}
 
Example #20
Source Project: pentaho-kettle   Author: pentaho   File: CreateDatabaseWizardPageOCI.java    License: Apache License 2.0 5 votes vote down vote up
public void createControl( Composite parent ) {
  int margin = Const.MARGIN;
  int middle = props.getMiddlePct();

  // create the composite to hold the widgets
  Composite composite = new Composite( parent, SWT.NONE );
  props.setLook( composite );

  FormLayout compLayout = new FormLayout();
  compLayout.marginHeight = Const.FORM_MARGIN;
  compLayout.marginWidth = Const.FORM_MARGIN;
  composite.setLayout( compLayout );

  wlTNS = new Label( composite, SWT.RIGHT );
  wlTNS.setText( BaseMessages.getString( PKG, "CreateDatabaseWizardPageOCI.TNS.Label" ) );
  props.setLook( wlTNS );
  fdlTNS = new FormData();
  fdlTNS.left = new FormAttachment( 0, 0 );
  fdlTNS.right = new FormAttachment( middle, 0 );
  wlTNS.setLayoutData( fdlTNS );
  wTNS = new Text( composite, SWT.SINGLE | SWT.BORDER );
  props.setLook( wTNS );
  fdTNS = new FormData();
  fdTNS.left = new FormAttachment( middle, margin );
  fdTNS.right = new FormAttachment( 100, 0 );
  wTNS.setLayoutData( fdTNS );
  wTNS.addModifyListener( new ModifyListener() {
    public void modifyText( ModifyEvent arg0 ) {
      setPageComplete( false );
    }
  } );

  // set the composite as the control for this page
  setControl( composite );
}
 
Example #21
Source Project: Pydev   Author: fabioz   File: WorkingDirectoryBlock.java    License: Eclipse Public License 1.0 5 votes vote down vote up
public WorkingDirectoryBlock(MainModuleTab mainModuleTab) {
    this.mainModuleTab = mainModuleTab;
    this.mainModuleTab.fProjectBlock.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            //project modified
            updateLaunchConfigurationDialog();
        }
    });
}
 
Example #22
Source Project: Eclipse-Postfix-Code-Completion   Author: trylimits   File: ChangeSignatureWizard.java    License: Eclipse Public License 1.0 5 votes vote down vote up
private void createNameControl(Composite parent) {
	Composite name= new Composite(parent, SWT.NONE);
	name.setLayoutData(new GridData(GridData.FILL_BOTH));
	GridLayout layout= new GridLayout(1, false);
	layout.marginHeight= 0;
	layout.marginWidth= 0;
	name.setLayout(layout);

	Label label= new Label(name, SWT.NONE);
	label.setText(RefactoringMessages.ChangeSignatureInputPage_method_name);

	final Text text= new Text(name, SWT.BORDER);
	text.setText(getChangeMethodSignatureProcessor().getMethodName());
	text.setLayoutData((new GridData(GridData.FILL_HORIZONTAL)));
	TextFieldNavigationHandler.install(text);

	if (getChangeMethodSignatureProcessor().canChangeNameAndReturnType()) {
		text.addModifyListener(new ModifyListener(){
			public void modifyText(ModifyEvent e) {
				getChangeMethodSignatureProcessor().setNewMethodName(text.getText());
				update(true);
			}
		});
	} else {
		text.setEnabled(false);
	}
}
 
Example #23
Source Project: depan   Author: google   File: ViewEditor.java    License: Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unused")
private void createDetailsPage() {
  Composite parent = new Composite(getContainer(), SWT.NONE);
  GridLayout layout = new GridLayout();
  layout.numColumns = 3;
  layout.marginTop = 9;
  parent.setLayout(layout);

  Label nameLabel = Widgets.buildCompactLabel(parent, "Description");
  final Text name = Widgets.buildGridBoxedText(parent);

  String descr = Strings.nullToEmpty(viewInfo.getDescription());
  name.setText(descr);

  name.addModifyListener(new ModifyListener() {

    @Override
    public void modifyText(ModifyEvent e) {
      if (viewInfo != null) {
        String newDescription = name.getText();
        viewInfo.setDescription(newDescription);
        markDirty();
      }
    }
  });
  int index = addPage(parent);
  setPageText(index, "Properties");
}
 
Example #24
Source Project: google-cloud-eclipse   Author: GoogleCloudPlatform   File: LabeledTextMapComponent.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Add a modify listener that triggers whenever a text within this component is modified.
 */
public void addModifyListener(ModifyListener listener) {
  textModifyListeners.add(listener);
  for (Text text : texts.values()) {
    text.addModifyListener(listener);
  }
}
 
Example #25
Source Project: birt   Author: eclipse   File: CustomDataSetWizardPage.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Creates custom control for user-defined query text.
 */
private Control createPageControl( Composite parent )
{
    Composite composite = new Composite( parent, SWT.NONE );
    composite.setLayout( new GridLayout( 1, false ) );
    GridData gridData = new GridData( GridData.HORIZONTAL_ALIGN_FILL
            | GridData.VERTICAL_ALIGN_FILL );

    composite.setLayoutData( gridData );

    Label fieldLabel = new Label( composite, SWT.NONE );
    fieldLabel.setText( "&Query Text:" );

    m_queryTextField = new Text( composite, SWT.BORDER
            | SWT.V_SCROLL | SWT.H_SCROLL );
    GridData data = new GridData( GridData.FILL_HORIZONTAL );
    data.heightHint = 100;
    m_queryTextField.setLayoutData( data );
    m_queryTextField.addModifyListener( new ModifyListener( )
    {
        public void modifyText( ModifyEvent e )
        {
            validateData();
        }
    } );

    setPageComplete( false );
    return composite;
}
 
Example #26
Source Project: goclipse   Author: GoClipse   File: TextFieldWidget.java    License: Eclipse Public License 1.0 5 votes vote down vote up
protected void createContents_Text(Composite topControl) {
	text = createText(topControl);
	text.addModifyListener(new ModifyListener() {
		@Override
		public void modifyText(ModifyEvent evt) {
			setFieldValueFromControl(text.getText());
			
			handleFieldValueAndControlChanged();
		}
	});
}
 
Example #27
Source Project: arx   Author: arx-deidentifier   File: DialogComboSelection.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected Control createDialogArea(Composite parent) {
    // create composite
    Composite composite = (Composite) super.createDialogArea(parent);
    // create message
    if (message != null) {
        Label label = new Label(composite, SWT.WRAP);
        label.setText(message);
        GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL |
                                     GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
        data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
        label.setLayoutData(data);
        label.setFont(parent.getFont());
    }
    combo = new Combo(composite, SWT.NONE);
    combo.setItems(choices);
    combo.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
    combo.addModifyListener(new ModifyListener() {
        @Override
        public void modifyText(ModifyEvent e) {
            validateInput();
        }
    });
    errorMessageText = new Text(composite, SWT.READ_ONLY | SWT.WRAP);
    errorMessageText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
    errorMessageText.setBackground(errorMessageText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    // Set the error message text
    // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=66292
    setErrorMessage(errorMessage);

    applyDialogFont(composite);
    return composite;
}
 
Example #28
Source Project: offspring   Author: incentivetoken   File: CancelBuyOrderWizard.java    License: MIT License 5 votes vote down vote up
@Override
public Control createControl(Composite parent) {
  textQuantity = new Text(parent, SWT.BORDER);
  textQuantity.setText("0");
  textQuantity.addModifyListener(new ModifyListener() {

    @Override
    public void modifyText(ModifyEvent e) {
      requestVerification();
    }
  });
  return textQuantity;
}
 
Example #29
Source Project: birt   Author: eclipse   File: ExpressionEditor.java    License: Eclipse Public License 1.0 5 votes vote down vote up
protected Control createDialogArea( Composite parent )
{
	Composite composite = (Composite) super.createDialogArea( parent );

	Composite container = new Composite( composite, SWT.NONE );
	GridLayout layout = new GridLayout( );
	layout.numColumns = 3;
	layout.verticalSpacing = 10;
	container.setLayout( layout );

	new Label( container, SWT.NONE ).setText( Messages.getString( "ExpressionEditor.Label.Expression" ) ); //$NON-NLS-1$
	exprText = new Text( container, SWT.BORDER | SWT.MULTI );
	GridData gd = new GridData( );
	gd.widthHint = 200;
	gd.heightHint = exprText.computeSize( SWT.DEFAULT, SWT.DEFAULT ).y
			- exprText.getBorderWidth( )
			* 2;
	exprText.setLayoutData( gd );
	exprText.addModifyListener( new ModifyListener( ) {

		public void modifyText( ModifyEvent e )
		{
			checkStatus( );
		}

	} );

	ExpressionButtonUtil.createExpressionButton( container,
			exprText,
			provider,
			contextObject,
			allowConstant,
			SWT.PUSH );

	ExpressionButtonUtil.initExpressionButtonControl( exprText, expression );

	UIUtil.bindHelp( parent, IHelpContextIds.EXPRESSION_EDITOR_ID );

	return composite;
}
 
Example #30
Source Project: erflute   Author: dbflute-session   File: ListenerAppender.java    License: Apache License 2.0 5 votes vote down vote up
public static void addModifyListener(final Text text, final AbstractDialog dialog) {
    text.addModifyListener(new ModifyListener() {
        @Override
        public void modifyText(ModifyEvent e) {
            dialog.validate();
        }
    });
}