Java Code Examples for org.eclipse.swt.graphics.Cursor#dispose()

The following examples show how to use org.eclipse.swt.graphics.Cursor#dispose() . 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: ValidatorDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
private void getFields() {
  Cursor busy = new Cursor( shell.getDisplay(), SWT.CURSOR_WAIT );
  shell.setCursor( busy );

  try {
    String sourceTransformName = wSourceTransform.getText();
    if ( !Utils.isEmpty( sourceTransformName ) ) {
      String fieldName = wSourceField.getText();
      IRowMeta r = pipelineMeta.getTransformFields( sourceTransformName );
      if ( r != null ) {
        wSourceField.setItems( r.getFieldNames() );
      }
      wSourceField.setText( fieldName );
    }
    shell.setCursor( null );
    busy.dispose();
  } catch ( HopException ke ) {
    shell.setCursor( null );
    busy.dispose();
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "ValidatorDialog.FailedToGetFields.DialogTitle" ), BaseMessages
      .getString( PKG, "ValidatorDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
Example 2
Source File: ValidatorDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void getFields() {
  Cursor busy = new Cursor( shell.getDisplay(), SWT.CURSOR_WAIT );
  shell.setCursor( busy );

  try {
    String sourceStepName = wSourceStep.getText();
    if ( !Utils.isEmpty( sourceStepName ) ) {
      String fieldName = wSourceField.getText();
      RowMetaInterface r = transMeta.getStepFields( sourceStepName );
      if ( r != null ) {
        wSourceField.setItems( r.getFieldNames() );
      }
      wSourceField.setText( fieldName );
    }
    shell.setCursor( null );
    busy.dispose();
  } catch ( KettleException ke ) {
    shell.setCursor( null );
    busy.dispose();
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "ValidatorDialog.FailedToGetFields.DialogTitle" ), BaseMessages
        .getString( PKG, "ValidatorDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
Example 3
Source File: SWTResourceManager.java    From developer-studio with Apache License 2.0 5 votes vote down vote up
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors() {
	for (Cursor cursor : m_idToCursorMap.values()) {
		cursor.dispose();
	}
	m_idToCursorMap.clear();
}
 
Example 4
Source File: ValidatorDialog.java    From hop with Apache License 2.0 5 votes vote down vote up
private void getTransforms() {
  Cursor busy = new Cursor( shell.getDisplay(), SWT.CURSOR_WAIT );
  shell.setCursor( busy );

  String fieldTransform = wSourceTransform.getText();

  wSourceTransform.removeAll();
  wSourceTransform.setItems( pipelineMeta.getPrevTransformNames( transformMeta ) );

  wSourceTransform.setText( fieldTransform );

  shell.setCursor( null );
  busy.dispose();
}
 
Example 5
Source File: ValidatorDialog.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
private void getSteps() {
  Cursor busy = new Cursor( shell.getDisplay(), SWT.CURSOR_WAIT );
  shell.setCursor( busy );

  String fieldStep = wSourceStep.getText();

  wSourceStep.removeAll();
  wSourceStep.setItems( transMeta.getPrevStepNames( stepMeta ) );

  wSourceStep.setText( fieldStep );

  shell.setCursor( null );
  busy.dispose();
}
 
Example 6
Source File: SWTResourceManager.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors() {
	for (Cursor cursor : m_idToCursorMap.values()) {
		cursor.dispose();
	}
	m_idToCursorMap.clear();
}
 
Example 7
Source File: SWTResourceManager.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors(){
	for (Cursor cursor : m_idToCursorMap.values()) {
		cursor.dispose();
	}
	m_idToCursorMap.clear();
}
 
Example 8
Source File: SWTResourceManager.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors() {
	for (Cursor cursor : m_idToCursorMap.values()) {
		cursor.dispose();
	}
	m_idToCursorMap.clear();
}
 
Example 9
Source File: SWTResourceManager.java    From ColorMixer with MIT License 5 votes vote down vote up
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors() {
	for (Cursor cursor : m_idToCursorMap.values()) {
		cursor.dispose();
	}
	m_idToCursorMap.clear();
}
 
Example 10
Source File: SWTResourceManager.java    From Flashtool with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors() {
	for (Cursor cursor : m_idToCursorMap.values()) {
		cursor.dispose();
	}
	m_idToCursorMap.clear();
}
 
Example 11
Source File: SWTResourceManager.java    From Rel with Apache License 2.0 5 votes vote down vote up
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors() {
	for (Cursor cursor : m_idToCursorMap.values()) {
		cursor.dispose();
	}
	m_idToCursorMap.clear();
}
 
Example 12
Source File: SWTResourceManager.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors() {
	for (Cursor cursor : m_idToCursorMap.values()) {
		cursor.dispose();
	}
	m_idToCursorMap.clear();
}
 
Example 13
Source File: SWTResourceManager.java    From ldparteditor with MIT License 5 votes vote down vote up
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors() {
    for (Cursor cursor : m_idToCursorMap.values()) {
        cursor.dispose();
    }
    m_idToCursorMap.clear();
}
 
Example 14
Source File: SWTResourceManager.java    From JReFrameworker with MIT License 5 votes vote down vote up
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors() {
	for (Cursor cursor : m_idToCursorMap.values()) {
		cursor.dispose();
	}
	m_idToCursorMap.clear();
}
 
Example 15
Source File: SWTResourceManager.java    From AndroidRobot with Apache License 2.0 5 votes vote down vote up
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors() {
	for (Cursor cursor : m_idToCursorMap.values()) {
		cursor.dispose();
	}
	m_idToCursorMap.clear();
}
 
Example 16
Source File: SalesforceUpsertDialog.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
private String[] getModuleFields() throws KettleException {
  if ( moduleFields != null ) {
    return moduleFields;
  } else if ( skipFetchModules() || Utils.isEmpty( wModule.getText() ) ) {
    getModulesListError = false;
    return new String[0];
  }

  getModulesListError = true;
  SalesforceUpsertMeta meta = new SalesforceUpsertMeta();
  getInfo( meta );
  String url = transMeta.environmentSubstitute( meta.getTargetURL() );
  String selectedModule = transMeta.environmentSubstitute( meta.getModule() );
  // Define a new Salesforce connection
  SalesforceConnection connection =
    new SalesforceConnection( log, url, transMeta.environmentSubstitute( meta.getUsername() ),
            Utils.resolvePassword( transMeta, meta.getPassword() ) );
  int realTimeOut = Const.toInt( transMeta.environmentSubstitute( meta.getTimeout() ), 0 );
  connection.setTimeOut( realTimeOut );
  Cursor busy = new Cursor( shell.getDisplay(), SWT.CURSOR_WAIT );
  try {
    shell.setCursor( busy );

    // connect to Salesforce
    connection.connect();
    moduleFields = connection.getFields( selectedModule, excludeNonUpdatableFields );
    getModulesListError = false;
    return moduleFields;
  } finally {
    if ( connection != null ) {
      try {
        connection.close();
      } catch ( Exception e ) { /* Ignore */
      }
    }
    shell.setCursor( null );
    busy.dispose();
  }
}
 
Example 17
Source File: SWTResourceManager.java    From WebpifyYourAndroidApp with Apache License 2.0 5 votes vote down vote up
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors() {
	for (Cursor cursor : m_idToCursorMap.values()) {
		cursor.dispose();
	}
	m_idToCursorMap.clear();
}
 
Example 18
Source File: SWTResourceManager.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors() {
	for (Cursor cursor : m_idToCursorMap.values()) {
		cursor.dispose();
	}
	m_idToCursorMap.clear();
}
 
Example 19
Source File: XYGraphMediaFactory.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
public void disposeResources() {

		if (cursorRegistry != null) {
			for (Cursor cursor : cursorRegistry.values()) {
				if (cursor != null && !cursor.isDisposed())
					cursor.dispose();
			}
			cursorRegistry.clear();
		}

	}
 
Example 20
Source File: BeamJobConfigDialog.java    From kettle-beam with Apache License 2.0 4 votes vote down vote up
private void buildFatJar( Event event ) {
  try {
    VariableSpace space = Variables.getADefaultVariableSpace();

    BeamJobConfig jobConfig = new BeamJobConfig();
    getInfo( jobConfig );

    FileDialog dialog = new FileDialog( shell, SWT.SAVE );
    dialog.setText( "Select the location of the Kettle+Beam+Plugins fat jar" );
    dialog.setFilterNames( new String[] { "Jar files (*.jar)", "All Files (*.*)" } );
    dialog.setFilterExtensions( new String[] { "*.jar", "*.*" } ); // Windows
    if ( StringUtils.isNotEmpty( jobConfig.getFatJar() ) ) {
      dialog.setFileName( space.environmentSubstitute( jobConfig.getFatJar() ) );
    }
    String filename = dialog.open();
    if ( StringUtils.isEmpty( filename ) ) {
      return;
    }

    List<String> files = BeamConst.findLibraryFilesToStage( null, jobConfig.getPluginsToStage(), true, true );
    files.removeIf( s -> s.contains( "commons-logging" ) || s.startsWith( "log4j" ) || s.contains( "xml-apis" ) );

    // Find the plugin classes for the specified plugins...
    //
    String stepPluginClasses = findPluginClasses( Step.class.getName() );
    if (StringUtils.isNotEmpty(jobConfig.getStepPluginClasses())) {
      if (StringUtils.isEmpty( stepPluginClasses )) {
        stepPluginClasses="";
      } else {
        stepPluginClasses+=",";
      }
      stepPluginClasses+=jobConfig.getStepPluginClasses();
    }
    String xpPluginClasses = findPluginClasses( ExtensionPoint.class.getName() );
    if (StringUtils.isNotEmpty(jobConfig.getXpPluginClasses())) {
      if (StringUtils.isEmpty( xpPluginClasses )) {
        xpPluginClasses="";
      } else {
        xpPluginClasses+=",";
      }
      xpPluginClasses+=jobConfig.getStepPluginClasses();
    }


    FatJarBuilder fatJarBuilder = new FatJarBuilder( filename, files );
    fatJarBuilder.setExtraStepPluginClasses( stepPluginClasses );
    fatJarBuilder.setExtraXpPluginClasses( xpPluginClasses );
    Cursor waitCursor = new Cursor( shell.getDisplay(), SWT.CURSOR_WAIT );
    Cursor regularCursor = shell.getCursor();

    try {
      shell.setCursor( waitCursor );
      fatJarBuilder.buildTargetJar();
    } finally {
      shell.setCursor( regularCursor );
      waitCursor.dispose();
    }

    // All went well, insert the filename...
    //
    wFatJar.setText( filename );

  } catch ( Exception e ) {
    new ErrorDialog( shell, "Error", "Error building fat jar: " + e.getMessage(), e );
  }
}