pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccp999 <ccp...@hotmail.com>
Subject Re: Thread issue
Date Tue, 13 Mar 2012 03:37:18 GMT
Hi Lukas,

But I believe I use TaskAdapter.  My code:

public void setNewTag(long id, String path) {

		GetAvailableCollaboratorsTask contacttask = new
GetAvailableCollaboratorsTask(
				id, path);

		TaskListener<List&lt;Collaborator>> taskListener = new
TaskListener<List&lt;Collaborator>>() {

			@Override
			public void taskExecuted(
					Task<List&lt;Collaborator>> task) {
				cardPane.setSelectedIndex(1);
				activityIndicator.setActive(false);
				if (task.getResult() != null) {
					collaborators = task.getResult();
					submitButton.setEnabled(true);
				}
			}

			@Override
			public void executeFailed(
					Task<List&lt;Collaborator>> task) {
				cardPane.setSelectedIndex(1);
				submitButton.setEnabled(false);
				activityIndicator.setActive(false);
				errorLabel.setText("Failed to load collaborators! "
						+ task.getFault());
				System.err.println(task.getFault());
			}

		};

		contacttask
				.execute(new TaskAdapter<List&lt;Collaborator>>(
						taskListener));

	}

Do you agree?

Brendan

--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Thread-issue-tp3819808p3821224.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Mime
View raw message