import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.HashMap; | import java.util.HashMap; | ||||
import java.util.HashSet; | import java.util.HashSet; | ||||
import java.util.List; | |||||
import java.util.Map; | import java.util.Map; | ||||
import java.util.Map.Entry; | import java.util.Map.Entry; | ||||
import java.util.Set; | import java.util.Set; | ||||
return false; | return false; | ||||
} | } | ||||
protected void showInitProblem(ArrayList<String> attemptedNames) { | |||||
protected void showInitProblem(List<String> attemptedNames) { | |||||
// Default does nothing | // Default does nothing | ||||
} | } | ||||
*/ | */ | ||||
package com.vaadin.client.ui; | package com.vaadin.client.ui; | ||||
import java.util.List; | |||||
import com.google.gwt.user.client.ui.Widget; | import com.google.gwt.user.client.ui.Widget; | ||||
import com.vaadin.client.JavaScriptConnectorHelper; | import com.vaadin.client.JavaScriptConnectorHelper; | ||||
import com.vaadin.client.communication.HasJavaScriptConnectorHelper; | import com.vaadin.client.communication.HasJavaScriptConnectorHelper; | ||||
this) { | this) { | ||||
@Override | @Override | ||||
protected void showInitProblem( | protected void showInitProblem( | ||||
java.util.ArrayList<String> attemptedNames) { | |||||
List<String> attemptedNames) { | |||||
getWidget().showNoInitFound(attemptedNames); | getWidget().showNoInitFound(attemptedNames); | ||||
} | } | ||||
}; | }; |
*/ | */ | ||||
package com.vaadin.client.ui; | package com.vaadin.client.ui; | ||||
import java.util.ArrayList; | |||||
import java.util.List; | |||||
import com.google.gwt.dom.client.Document; | import com.google.gwt.dom.client.Document; | ||||
import com.google.gwt.user.client.ui.Widget; | import com.google.gwt.user.client.ui.Widget; | ||||
public class JavaScriptWidget extends Widget { | public class JavaScriptWidget extends Widget { | ||||
/** | /** | ||||
* Creats a JavaScriptWidget based on a <div> element | |||||
* Creates a JavaScriptWidget based on a <div> element | |||||
*/ | */ | ||||
public JavaScriptWidget() { | public JavaScriptWidget() { | ||||
this("div"); | this("div"); | ||||
setElement(Document.get().createElement(tagName)); | setElement(Document.get().createElement(tagName)); | ||||
} | } | ||||
public void showNoInitFound(ArrayList<String> attemptedNames) { | |||||
public void showNoInitFound(List<String> attemptedNames) { | |||||
String message = "Could not initialize JavaScriptConnector because no JavaScript init function was found. Make sure one of these functions are defined: <ul>"; | String message = "Could not initialize JavaScriptConnector because no JavaScript init function was found. Make sure one of these functions are defined: <ul>"; | ||||
for (String name : attemptedNames) { | for (String name : attemptedNames) { | ||||
message += "<li>" + name + "</li>"; | message += "<li>" + name + "</li>"; |
package com.vaadin.client.ui; | package com.vaadin.client.ui; | ||||
import java.util.ArrayList; | |||||
import java.util.List; | |||||
import com.google.gwt.core.client.Scheduler.ScheduledCommand; | import com.google.gwt.core.client.Scheduler.ScheduledCommand; | ||||
import com.google.gwt.dom.client.Element; | import com.google.gwt.dom.client.Element; | ||||
connection.flushActiveConnector(); | connection.flushActiveConnector(); | ||||
} | } | ||||
private native static void loadAppIdListFromDOM(ArrayList<String> list) | |||||
private native static void loadAppIdListFromDOM(List<String> list) | |||||
/*-{ | /*-{ | ||||
var j; | var j; | ||||
for(j in $wnd.vaadin.vaadinConfigurations) { | for(j in $wnd.vaadin.vaadinConfigurations) { |
fireOrderEvent(list); | fireOrderEvent(list); | ||||
} | } | ||||
private static void fireOrderEvent(ArrayList<VWindow> windows) { | |||||
private static void fireOrderEvent(List<VWindow> windows) { | |||||
WINDOW_ORDER_HANDLER | WINDOW_ORDER_HANDLER | ||||
.fireEvent(new WindowOrderEvent(new ArrayList<>(windows))); | .fireEvent(new WindowOrderEvent(new ArrayList<>(windows))); | ||||
} | } |
*/ | */ | ||||
package com.vaadin.client.ui.window; | package com.vaadin.client.ui.window; | ||||
import java.util.ArrayList; | |||||
import java.util.List; | |||||
import com.google.gwt.event.shared.GwtEvent; | import com.google.gwt.event.shared.GwtEvent; | ||||
import com.vaadin.client.ui.VWindow; | import com.vaadin.client.ui.VWindow; | ||||
private static final Type<WindowOrderHandler> TYPE = new Type<>(); | private static final Type<WindowOrderHandler> TYPE = new Type<>(); | ||||
private final ArrayList<VWindow> windows; | |||||
private final List<VWindow> windows; | |||||
/** | /** | ||||
* Creates a new event with the given order. | * Creates a new event with the given order. | ||||
* @param windows | * @param windows | ||||
* The new order position for the VWindow | * The new order position for the VWindow | ||||
*/ | */ | ||||
public WindowOrderEvent(ArrayList<VWindow> windows) { | |||||
public WindowOrderEvent(List<VWindow> windows) { | |||||
this.windows = windows; | this.windows = windows; | ||||
} | } | ||||
@Override | @Override | ||||
public void windowOrderChanged( | public void windowOrderChanged( | ||||
HashMap<Integer, Connector> windowOrders) { | |||||
Map<Integer, Connector> windowOrders) { | |||||
Map<Integer, Window> orders = new LinkedHashMap<>(); | Map<Integer, Window> orders = new LinkedHashMap<>(); | ||||
for (Entry<Integer, Connector> entry : windowOrders.entrySet()) { | for (Entry<Integer, Connector> entry : windowOrders.entrySet()) { | ||||
if (entry.getValue() instanceof Window) { | if (entry.getValue() instanceof Window) { |
*/ | */ | ||||
package com.vaadin.shared.ui; | package com.vaadin.shared.ui; | ||||
import java.util.HashMap; | |||||
import java.util.Map; | |||||
import com.vaadin.shared.Connector; | import com.vaadin.shared.Connector; | ||||
import com.vaadin.shared.communication.ServerRpc; | import com.vaadin.shared.communication.ServerRpc; | ||||
* @param windowOrders | * @param windowOrders | ||||
* new windows order | * new windows order | ||||
*/ | */ | ||||
void windowOrderChanged(HashMap<Integer, Connector> windowOrders); | |||||
void windowOrderChanged(Map<Integer, Connector> windowOrders); | |||||
} | } |