@Target(ElementType.TYPE)
public @interface AcceptCriterion {
/**
- * @return the fully qualified class name of the server side counterpart for
- * the annotated criterion
+ * @return the class of the server side counterpart for the annotated
+ * criterion
*/
- String value();
+ Class<?> value();
}
*/
package com.vaadin.terminal.gwt.client.ui.dd;
+import com.vaadin.event.dd.acceptcriteria.AcceptAll;
import com.vaadin.terminal.gwt.client.UIDL;
-@AcceptCriterion("com.vaadin.event.dd.acceptcriteria.AcceptAll")
+@AcceptCriterion(AcceptAll.class)
final public class VAcceptAll extends VAcceptCriterion {
@Override
*/
package com.vaadin.terminal.gwt.client.ui.dd;
+import com.vaadin.event.dd.acceptcriteria.And;
import com.vaadin.terminal.gwt.client.UIDL;
-@AcceptCriterion("com.vaadin.event.dd.acceptcriteria.And")
+@AcceptCriterion(And.class)
final public class VAnd extends VAcceptCriterion implements VAcceptCallback {
private boolean b1;
*/
package com.vaadin.terminal.gwt.client.ui.dd;
+import com.vaadin.event.dd.acceptcriteria.ContainsDataFlavor;
import com.vaadin.terminal.gwt.client.UIDL;
-@AcceptCriterion("com.vaadin.event.dd.acceptcriteria.ContainsDataFlavor")
+@AcceptCriterion(ContainsDataFlavor.class)
final public class VContainsDataFlavor extends VAcceptCriterion {
@Override
*/
package com.vaadin.terminal.gwt.client.ui.dd;
+import com.vaadin.event.dd.acceptcriteria.SourceIs;
import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.UIDL;
*
* @since 6.3
*/
-@AcceptCriterion("com.vaadin.event.dd.acceptcriteria.SourceIs")
+@AcceptCriterion(SourceIs.class)
final public class VDragSourceIs extends VAcceptCriterion {
@Override
import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.ui.AbstractSelect;
-@AcceptCriterion("com.vaadin.ui.AbstractSelect.TargetItemIs")
+@AcceptCriterion(AbstractSelect.TargetItemIs.class)
final public class VIsOverId extends VAcceptCriterion {
@Override
import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.ui.AbstractSelect;
-@AcceptCriterion("com.vaadin.ui.AbstractSelect.AcceptItem")
+@AcceptCriterion(AbstractSelect.AcceptItem.class)
final public class VItemIdIs extends VAcceptCriterion {
@Override
import java.util.HashSet;
import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.Tree;
/**
*
private HashSet<String> hashSet;
private VDragEvent lastDragEvent;
- @AcceptCriterion("com.vaadin.ui.Table.TableDropCriterion")
+ @AcceptCriterion(Table.TableDropCriterion.class)
final public static class VTableLazyInitItemIdentifiers extends
VLazyInitItemIdentifiers {
// all logic in superclass
}
- @AcceptCriterion("com.vaadin.ui.Tree.TreeDropCriterion")
+ @AcceptCriterion(Tree.TreeDropCriterion.class)
final public static class VTreeLazyInitItemIdentifiers extends
VLazyInitItemIdentifiers {
// all logic in superclass
*/
package com.vaadin.terminal.gwt.client.ui.dd;
+import com.vaadin.event.dd.acceptcriteria.Not;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.VConsole;
* TODO implementation could now be simplified/optimized
*
*/
-@AcceptCriterion("com.vaadin.event.dd.acceptcriteria.Not")
+@AcceptCriterion(Not.class)
final public class VNot extends VAcceptCriterion {
private boolean b1;
private VAcceptCriterion crit1;
*/
package com.vaadin.terminal.gwt.client.ui.dd;
+import com.vaadin.event.dd.acceptcriteria.Or;
import com.vaadin.terminal.gwt.client.UIDL;
/**
*
*/
-@AcceptCriterion("com.vaadin.event.dd.acceptcriteria.Or")
+@AcceptCriterion(Or.class)
final public class VOr extends VAcceptCriterion implements VAcceptCallback {
private boolean accepted;
*/
package com.vaadin.terminal.gwt.client.ui.dd;
+import com.vaadin.event.dd.acceptcriteria.ServerSideCriterion;
import com.vaadin.terminal.gwt.client.UIDL;
-@AcceptCriterion("com.vaadin.event.dd.acceptcriteria.ServerSideCriterion")
+@AcceptCriterion(ServerSideCriterion.class)
final public class VServerAccept extends VAcceptCriterion {
@Override
public void accept(final VDragEvent drag, UIDL configuration,
*/
package com.vaadin.terminal.gwt.client.ui.dd;
+import com.vaadin.event.dd.acceptcriteria.SourceIsTarget;
import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.UIDL;
-@AcceptCriterion("com.vaadin.event.dd.acceptcriteria.SourceIsTarget")
+@AcceptCriterion(SourceIsTarget.class)
final public class VSourceIsTarget extends VAcceptCriterion {
@Override
*/
package com.vaadin.terminal.gwt.client.ui.dd;
+import com.vaadin.event.dd.acceptcriteria.TargetDetailIs;
import com.vaadin.terminal.gwt.client.UIDL;
-@AcceptCriterion("com.vaadin.event.dd.acceptcriteria.TargetDetailIs")
+@AcceptCriterion(TargetDetailIs.class)
final public class VTargetDetailIs extends VAcceptCriterion {
@Override
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.ui.tree.VTree;
import com.vaadin.terminal.gwt.client.ui.tree.VTree.TreeNode;
+import com.vaadin.ui.Tree;
-@AcceptCriterion("com.vaadin.ui.Tree.TargetInSubtree")
+@AcceptCriterion(Tree.TargetInSubtree.class)
final public class VTargetInSubtree extends VAcceptCriterion {
@Override
.getAnnotation(AcceptCriterion.class);
if (annotation != null) {
String clientClassName = clientClass.getQualifiedSourceName();
- String serverClassName = clientClass.getAnnotation(
+ Class<?> serverClass = clientClass.getAnnotation(
AcceptCriterion.class).value();
+ String serverClassName = serverClass.getCanonicalName();
logger.log(Type.INFO, "creating mapping for " + serverClassName);
sourceWriter.print("if (\"");
sourceWriter.print(serverClassName);
sourceWriter.outdent();
sourceWriter.println("}");
}
-
}