Merge branch 'gwt' of ssh://kielweek.web4sap.com/home/trac/git into gwt

This commit is contained in:
Marcus Kammer committed 2012-02-02 12:29:51 +01:00
commit fbc014bd16
10 files changed
+97 -5

No files matched your search

@@ -21,5 +21,5 @@
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-war &quot;${project_loc:com.sap.sailing.gwt.ui}&quot; -noserver -remoteUI &quot;${gwt_remote_ui_server_port}:${unique_id}&quot; -logLevel INFO -codeServerPort 9997 -startupUrl /gwt/AdminConsole.html com.sap.sailing.gwt.ui.AdminConsole -startupUrl /gwt/LeaderboardEditing.html com.sap.sailing.gwt.ui.LeaderboardEditing -startupUrl /gwt/UserManagement.html com.sap.sailing.gwt.ui.UserManagement -startupUrl /gwt/Leaderboard.html com.sap.sailing.gwt.ui.Leaderboard -startupUrl /gwt/Spectator.html com.sap.sailing.gwt.ui.Spectator -startupUrl /gwt/RaceBoard.html com.sap.sailing.gwt.ui.RaceBoard"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.gwt.ui"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx512m"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx1024m"/>
</launchConfiguration>
@@ -134,10 +134,12 @@ public class WindChart implements Component<WindChartSettings>, RaceSelectionCha
plot.addHoverListener(new PlotHoverListener() {
public void onPlotHover(Plot plot, PlotPosition position, PlotItem item) {
if (item != null) {
SeriesHandler seriesHandler = seriesHandlersInOrder.get(item.getSeriesIndex());
WindSource windSource = getWindSource(seriesHandler);
selectedPointLabel.setText(windSource.name()+": "+position.getY().intValue());
selectedPointLabel.setVisible(true);
if (item.getSeriesIndex() < seriesHandlersInOrder.size()) {
SeriesHandler seriesHandler = seriesHandlersInOrder.get(item.getSeriesIndex());
WindSource windSource = getWindSource(seriesHandler);
selectedPointLabel.setText(windSource.name() + ": " + position.getY().intValue());
selectedPointLabel.setVisible(true);
}
} else {
selectedPointLabel.setVisible(false);
}
@@ -0,0 +1,47 @@
package com.sap.sailing.gwt.ui.client;
import com.google.gwt.user.client.rpc.AsyncCallback;
/**
* The class is used together with the #{ParallelExecutionHolder} when two or more asynchronous service calls should run in parallel
* and only in case all of them has been executed successfully the next action makes sense.
*/
public class ParallelExecutionCallback<T> implements AsyncCallback<T> {
/** The data returned from the service call. */
private T data;
/** A reference to the execution holder of the parallel callbacks */
private ParallelExecutionHolder parallelExecutionHolder;
/**
* The success method, which is called when the service call completes.
*/
@Override
public void onSuccess(T t) {
this.data = t;
parallelExecutionHolder.done();
}
/**
* Gets the data returned from the async service call.
*/
public T getData() {
return data;
}
/**
* Called by the execution holder to inject a reference to itself into the child.
*/
protected void setExecutionHolder(ParallelExecutionHolder parallelExecutionHolder) {
this.parallelExecutionHolder = parallelExecutionHolder;
}
/**
* Handle method for a failure.
*/
@Override
public void onFailure(Throwable t) {
this.parallelExecutionHolder.handleFailure(t);
}
}
@@ -0,0 +1,43 @@
package com.sap.sailing.gwt.ui.client;
public abstract class ParallelExecutionHolder {
/** The number of successfully completed services */
private int doneCount = 0;
private ParallelExecutionCallback<?> asyncCallbacks[];
protected ParallelExecutionHolder(ParallelExecutionCallback<?>... callbacks) {
if (callbacks == null || callbacks.length == 0) {
throw new RuntimeException("No callbacks passed to execution holder");
}
this.asyncCallbacks = callbacks;
for (ParallelExecutionCallback<?> callback : callbacks) {
callback.setExecutionHolder(this);
}
}
/**
* Called by each async service call on completion. Only when all calls have been completed
* the handleSuccess() is called.
*/
protected synchronized void done() {
doneCount++;
if (doneCount == asyncCallbacks.length) {
handleSuccess();
}
}
/**
* Called only when all parallel callbacks have been completed.
*/
protected abstract void handleSuccess();
/**
* Called when one of the parallel callbacks has returned with a failure.
*/
protected abstract void handleFailure(Throwable t);
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB