org.eclipse.swt.widgets.Text#getData ( )源码实例Demo

下面列出了org.eclipse.swt.widgets.Text#getData ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: hadoop-gpu   文件: HadoopLocationWizard.java
public void modifyText(ModifyEvent e) {
  final Text text = (Text) e.widget;
  Object hProp = text.getData("hProp");
  final ConfProp prop = (hProp != null) ? (ConfProp) hProp : null;
  Object hPropName = text.getData("hPropName");
  final String propName =
      (hPropName != null) ? (String) hPropName : null;

  Display.getDefault().syncExec(new Runnable() {
    public void run() {
      if (prop != null)
        mediator.notifyChange(TabAdvanced.this, prop, text.getText());
      else
        mediator
            .notifyChange(TabAdvanced.this, propName, text.getText());
    }
  });
}
 
源代码2 项目: birt   文件: OptionsConfigurationBlock.java
protected void updateText( Text curr )
{
	Key key = (Key) curr.getData( );

	String currValue = getValue( key );
	if ( currValue != null )
	{
		curr.setText( currValue );
	}

	if ( fProject != null )
	{
		if ( ignoreKeys != null
				&& Arrays.asList( ignoreKeys ).contains( key ) )
		{
			ControlEnableState.disable( curr );
			Control label = (Control) fLabels.get( curr );
			if ( label != null )
				ControlEnableState.disable( label );
		}
	}
}
 
源代码3 项目: birt   文件: ResourceConfigurationBlock.java
protected void textChanged( Text textControl )
{
	Key key = (Key) textControl.getData( );
	String path = textControl.getText( );

	if ( path != null && textControl == resourceText )
	{
		if ( path.startsWith( DEFAULT_RESOURCE_FOLDER_DISPLAY ) )
		{
			path = path.replaceFirst( DEFAULT_RESOURCE_FOLDER_DISPLAY,
					PREF_RESOURCE.getDefaultValue( fPref ) );
		}
	}

	String oldValue = setValue( key, path );

	validateSettings( key, oldValue, path );
}
 
源代码4 项目: RDFS   文件: HadoopLocationWizard.java
public void modifyText(ModifyEvent e) {
  final Text text = (Text) e.widget;
  Object hProp = text.getData("hProp");
  final ConfProp prop = (hProp != null) ? (ConfProp) hProp : null;
  Object hPropName = text.getData("hPropName");
  final String propName =
      (hPropName != null) ? (String) hPropName : null;

  Display.getDefault().syncExec(new Runnable() {
    public void run() {
      if (prop != null)
        mediator.notifyChange(TabAdvanced.this, prop, text.getText());
      else
        mediator
            .notifyChange(TabAdvanced.this, propName, text.getText());
    }
  });
}
 
源代码5 项目: xtext-eclipse   文件: OptionsConfigurationBlock.java
protected void updateText(Text curr) {
	String key = (String) curr.getData();
	String currValue = getValue(key);
	if (currValue != null) {
		curr.setText(currValue);
	}
}
 
protected void textChanged(Text textControl) {
	Key key = (Key) textControl.getData();
	String number = textControl.getText();
	String oldValue = setValue(key, number);
	reconcileControls();
	validateSettings(key, oldValue, number);
}
 
protected Text getTextControl(Key key) {
	for (int i = fTextBoxes.size() - 1; i >= 0; i--) {
		Text curr = (Text) fTextBoxes.get(i);
		ControlData data = (ControlData) curr.getData();
		if (key.equals(data.getKey())) {
			return curr;
		}
	}
	return null;
}
 
protected void updateText(Text curr) {
	Key key= (Key) curr.getData();

	String currValue= getValue(key);
	if (currValue != null) {
		curr.setText(currValue);
	}
}
 
protected Text getTextControl(Key key) {
	for (int i= fTextBoxes.size() - 1; i >= 0; i--) {
		Text curr= fTextBoxes.get(i);
		Key data= (Key)curr.getData();
		if (key.equals(data)) {
			return curr;
		}
	}
	return null;
}
 
源代码10 项目: birt   文件: OptionsConfigurationBlock.java
protected void textChanged( Text textControl )
{
	Key key = (Key) textControl.getData( );
	String number = textControl.getText( );
	String oldValue = setValue( key, number );
	validateSettings( key, oldValue, number );
}
 
源代码11 项目: birt   文件: OptionsConfigurationBlock.java
protected Text getTextControl( Key key )
{
	for ( int i = fTextBoxes.size( ) - 1; i >= 0; i-- )
	{
		Text curr = (Text) fTextBoxes.get( i );
		ControlData data = (ControlData) curr.getData( );
		if ( key.equals( data.getKey( ) ) )
		{
			return curr;
		}
	}
	return null;
}
 
源代码12 项目: birt   文件: ResourceConfigurationBlock.java
protected void updateText( Text curr )
{
	Key key = (Key) curr.getData( );

	String currValue = getValue( key );
	curr.setText( currValue );
	if ( currValue != null )
	{
		if ( curr == resourceText )
		{
			String text = curr.getText( ).trim( );
			if ( text.equals( ReportPlugin.getDefault( )
					.getDefaultResourcePreference( ) ) )
			{
				curr.setText( DEFAULT_RESOURCE_FOLDER_DISPLAY );
			}
			else
			{
				File file = new File( text );
				if ( !file.isAbsolute( ) )
				{
					curr.setText( processString( text ) );
				}
			}
		}

	}
}
 
源代码13 项目: birt   文件: BindingDialogHelper.java
protected void initTextField( Text txtParam, IParameterDefn param )
{
	if ( paramsValueMap.containsKey( param.getName( ) ) )
	{
		txtParam.setText( paramsValueMap.get( param.getName( ) )[0] );
		txtParam.setData( ExpressionButtonUtil.EXPR_TYPE,
				paramsValueMap.get( param.getName( ) )[1] );
		ExpressionButton button = (ExpressionButton) txtParam.getData( ExpressionButtonUtil.EXPR_BUTTON );
		if ( button != null )
			button.refresh( );
		return;
	}
	if ( binding != null )
	{
		for ( Iterator iterator = binding.argumentsIterator( ); iterator.hasNext( ); )
		{
			AggregationArgumentHandle arg = (AggregationArgumentHandle) iterator.next( );
			if ( arg.getName( ).equals( param.getName( ) ) )
			{
				ExpressionButtonUtil.initExpressionButtonControl( txtParam,
						arg,
						AggregationArgument.VALUE_MEMBER );
				return;
			}
		}
	}
}
 
源代码14 项目: RDFS   文件: HadoopLocationWizard.java
public void modifyText(ModifyEvent e) {
  final Text text = (Text) e.widget;
  final ConfProp prop = (ConfProp) text.getData("hProp");
  Display.getDefault().syncExec(new Runnable() {
    public void run() {
      mediator.notifyChange(TabMain.this, prop, text.getText());
    }
  });
}
 
源代码15 项目: elexis-3-core   文件: ScriptView.java
@Override
protected void okPressed(){
	StringBuilder sb = new StringBuilder();
	for (Text text : inputs) {
		String varname = (String) text.getData("varname");
		String varcontents = text.getText();
		sb.append(varname).append("=").append(varcontents).append(",");
	}
	sb.deleteCharAt(sb.length() - 1);
	result = sb.toString();
	super.okPressed();
}
 
源代码16 项目: hadoop-gpu   文件: HadoopLocationWizard.java
public void modifyText(ModifyEvent e) {
  final Text text = (Text) e.widget;
  final ConfProp prop = (ConfProp) text.getData("hProp");
  Display.getDefault().syncExec(new Runnable() {
    public void run() {
      mediator.notifyChange(TabMain.this, prop, text.getText());
    }
  });
}
 
源代码17 项目: xtext-eclipse   文件: OptionsConfigurationBlock.java
protected void textChanged(Text textControl) {
	String key = (String) textControl.getData();
	String number = textControl.getText();
	String oldValue = setValue(key, number);
	validateSettings(key, oldValue, number);
}
 
protected void textChanged(Text textControl) {
	Key key= (Key) textControl.getData();
	String number= textControl.getText();
	String oldValue= setValue(key, number);
	validateSettings(key, oldValue, number);
}
 
源代码19 项目: birt   文件: PropertyBindingPage.java
public boolean performOk( )
{
	for ( int i = 0; i < propList.size( ); i++ )
	{
		try
		{
			String value = null;
			Text propertyText = (Text) propertyTextList.get( i );
			
			if ( !propertyText.isDisposed( )
					&& propertyText.getText( ) != null
					&& propertyText.getText( ).trim( ).length( ) > 0 )
			{
				value = propertyText.getText( ).trim( );
			}
			Expression expr = new Expression( value,
					(String) propertyText.getData( DataUIConstants.EXPR_TYPE ) );
			
			if ( ds instanceof DesignElementHandle )
			{
				if ( propList.get( i ) instanceof String[] )
				{
					( (DesignElementHandle) ds ).setPropertyBinding( ( (String[]) propList.get( i ) )[0],
							expr );
				}
				else if ( propList.get( i ) instanceof Property )
				{
					( (DesignElementHandle) ds ).setPropertyBinding( ( (Property) propList.get( i ) ).getName( ),
							expr );
				}
			}
		}
		catch ( Exception e )
		{
			logger.log( Level.FINE, e.getMessage( ), e );
			ExceptionHandler.handle( e );
			return true;
		}
	}
	return super.performOk( );
}
 
源代码20 项目: elexis-3-core   文件: AutoCompleteTextUtil.java
public static Object getData(Text text){
	return text.getData(PROPOSAL_RET_OBJ);
}