Java Code Examples for org.eclipse.swt.events.ModifyEvent#getSource()

The following examples show how to use org.eclipse.swt.events.ModifyEvent#getSource() . 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 File: SimpleConfigurator.java    From gama with GNU General Public License v3.0 6 votes vote down vote up
public static SelectionEvent selectionEvent(final ModifyEvent e) {
	final Event event = new Event();
	event.widget = e.widget;
	event.data = e.data;
	event.display = e.display;
	event.time = e.time;
	return new SelectionEvent(event) {
		/** <code>serialVersionUID</code> field */
		private static final long serialVersionUID = 6544345585295778029L;

		@Override
		public Object getSource() {
			return e.getSource();
		}
	};
}
 
Example 2
Source File: FormatSpecifierComposite.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
public void modifyText( ModifyEvent e )
{
	Object oSource = e.getSource( );
	bEnableEvents = false;
	if ( oSource.equals( txtDatePattern ) )
	{
		if ( !( formatspecifier instanceof JavaDateFormatSpecifier ) )
		{
			formatspecifier = JavaDateFormatSpecifierImpl.create( "" ); //$NON-NLS-1$
		}
		( (JavaDateFormatSpecifier) formatspecifier ).setPattern( ChartUIUtil.getText( txtDatePattern ) );
	}
	bEnableEvents = true;

	updatePreview( );
}
 
Example 3
Source File: FormatSpecifierComposite.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
void modifyText( ModifyEvent e )
{
	Object oSource = e.getSource( );
	bEnableEvents = false;
	if ( oSource.equals( txtPrefix ) )
	{
		getFormatSpecifier( ).setPrefix( txtPrefix.getText( ) );
	}
	else if ( oSource.equals( txtSuffix ) )
	{
		getFormatSpecifier( ).setSuffix( txtSuffix.getText( ) );
	}
	else if ( oSource.equals( txtDelimiter ) )
	{
		getFormatSpecifier( ).setDelimiter( txtDelimiter.getText( ) );
	}
	bEnableEvents = true;
}
 
Example 4
Source File: DefaultControlFieldProvider.java    From elexis-3-core with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void modifyText(final ModifyEvent e){
	modified = true;
	Text t = (Text) e.getSource();
	String s = t.getText();
	if (!StringTool.leer.equals(s)) {
		if (s.length() == 1) {
			return;
		}
	}
	for (int i = 0; i < lastFiltered.length; i++) {
		lastFiltered[i] = selectors[i].getText();
	}
	fireChangedEvent();
	
}
 
Example 5
Source File: CppStylePropertyPage.java    From CppStyle with MIT License 5 votes vote down vote up
@Override
public void modifyText(ModifyEvent e) {
	if (e.getSource() == projectRootText) {
		if (projectRootText.getText().isEmpty()) {
			setValid(true);
		}
	}
}
 
Example 6
Source File: FormatSpecifierComposite.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public void modifyText( ModifyEvent e )
{
	Object oSource = e.getSource( );
	bEnableEvents = false;
	if ( oSource.equals( txtAdvMultiplier ) )
	{
		if ( !( formatspecifier instanceof JavaNumberFormatSpecifier ) )
		{
			formatspecifier = JavaNumberFormatSpecifierImpl.create( ChartUIUtil.getText( txtNumberPattern ) );
		}
		if ( txtAdvMultiplier.isSetValue( ) )
		{
			( (JavaNumberFormatSpecifier) formatspecifier ).setMultiplier( txtAdvMultiplier.getValue( ) );
		}
		else
		{
			( (JavaNumberFormatSpecifier) formatspecifier ).eUnset( AttributePackage.eINSTANCE.getJavaNumberFormatSpecifier_Multiplier( ) );
		}
	}
	else if ( oSource.equals( txtNumberPattern ) )
	{
		if ( !( formatspecifier instanceof JavaNumberFormatSpecifier ) )
		{
			formatspecifier = JavaNumberFormatSpecifierImpl.create( "" ); //$NON-NLS-1$
		}
		( (JavaNumberFormatSpecifier) formatspecifier ).setPattern( ChartUIUtil.getText( txtNumberPattern ) );
	}
	bEnableEvents = true;

	updatePreview( );
}
 
Example 7
Source File: FormatSpecifierComposite.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public void modifyText( ModifyEvent e )
{
	bEnableEvents = false;
	if ( e.getSource( ) == patternTxt )
	{
		if ( !( formatspecifier instanceof StringFormatSpecifier ) )
		{
			formatspecifier = StringFormatSpecifierImpl.create( );
		}
		( (StringFormatSpecifier) formatspecifier ).setPattern( patternTxt.getText( ) );
	}
	bEnableEvents = true;
	updatePreview( );
}
 
Example 8
Source File: SeriesXSheetImpl.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public void modifyText( ModifyEvent e )
{
	if ( e.getSource( ) == txtMinSlice )
	{
		if ( !TextEditorComposite.TEXT_RESET_MODEL.equals( e.data ))
		{
			( (ChartWithoutAxes) getChart( ) ).setMinSlice( txtMinSlice.getValue( ) );
			txtLabel.setEnabled( ( (ChartWithoutAxes) getChart( ) ).isSetMinSlice( )
					&& ( (ChartWithoutAxes) getChart( ) ).getMinSlice( ) != 0 );
		}
		updateUIState( );
	}
}
 
Example 9
Source File: WorkingDirectoryBlock.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void modifyText(ModifyEvent e) {
    if (e.getSource() == fOtherWorkingText) {

        File file = new File(fOtherWorkingText.getText());
        if (!file.exists()) {
            setErrorMessage("The directory in the Base Directory does not exist.");
        }
        if (!file.isDirectory()) {
            setErrorMessage("The directory in the location is not actually a directory.");
        }
    }
    updateLaunchConfigurationDialog();
}
 
Example 10
Source File: CompilerWorkingDirectoryBlock.java    From xds-ide with Eclipse Public License 1.0 4 votes vote down vote up
public void modifyText(ModifyEvent e) {
    if (e.getSource() == fOtherDirText && actionListener != null && !otherIsEdited) {
        actionListener.actionPerformed(null);
    }
}
 
Example 11
Source File: FormatSpecifierComposite.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
public void modifyText( ModifyEvent e )
{
	Object oSource = e.getSource( );
	bEnableEvents = false;
	if ( oSource.equals( txtPrefix ) )
	{
		if ( !( formatspecifier instanceof NumberFormatSpecifier ) )
		{
			formatspecifier = NumberFormatSpecifierImpl.create( );
			( (NumberFormatSpecifier) formatspecifier ).setSuffix( txtSuffix.getText( ) );
			( (NumberFormatSpecifier) formatspecifier ).setFractionDigits( iscFractionDigits.getSelection( ) );

			if ( txtMultiplier.isSetValue( ) )
			{
				( (NumberFormatSpecifier) formatspecifier ).setMultiplier( txtMultiplier.getValue( ) );
			}
			else
			{
				( (NumberFormatSpecifier) formatspecifier ).eUnset( AttributePackage.eINSTANCE.getNumberFormatSpecifier_Multiplier( ) );
			}
		}
		( (NumberFormatSpecifier) formatspecifier ).setPrefix( txtPrefix.getText( ) );
	}
	else if ( oSource.equals( txtSuffix ) )
	{
		if ( !( formatspecifier instanceof NumberFormatSpecifier ) )
		{
			formatspecifier = NumberFormatSpecifierImpl.create( );
			( (NumberFormatSpecifier) formatspecifier ).setPrefix( txtPrefix.getText( ) );
			( (NumberFormatSpecifier) formatspecifier ).setFractionDigits( iscFractionDigits.getSelection( ) );
			if ( txtMultiplier.isSetValue( ) )
			{
				( (NumberFormatSpecifier) formatspecifier ).setMultiplier( txtMultiplier.getValue( ) );
			}
			else
			{
				( (NumberFormatSpecifier) formatspecifier ).eUnset( AttributePackage.eINSTANCE.getNumberFormatSpecifier_Multiplier( ) );
			}
		}
		( (NumberFormatSpecifier) formatspecifier ).setSuffix( txtSuffix.getText( ) );
	}
	else if ( oSource.equals( txtMultiplier ) )
	{
		if ( !( formatspecifier instanceof NumberFormatSpecifier ) )
		{
			formatspecifier = NumberFormatSpecifierImpl.create( );
			( (NumberFormatSpecifier) formatspecifier ).setPrefix( txtPrefix.getText( ) );
			( (NumberFormatSpecifier) formatspecifier ).setSuffix( txtSuffix.getText( ) );
			( (NumberFormatSpecifier) formatspecifier ).setFractionDigits( iscFractionDigits.getSelection( ) );
		}
		if ( txtMultiplier.isSetValue( ) )
		{
			( (NumberFormatSpecifier) formatspecifier ).setMultiplier( txtMultiplier.getValue( ) );
		}
		else
		{
			( (NumberFormatSpecifier) formatspecifier ).eUnset( AttributePackage.eINSTANCE.getNumberFormatSpecifier_Multiplier( ) );
		}
	}
	bEnableEvents = true;
	updatePreview( );
}