Hi!
I want to make small widgetset including UI, VerticalLayout, Label, Button only. How to do it?
Thank you in advance…
I solved this:
- Configure WidgetSet.gwt.xml to use our loader class
package.WSF
instead of Vaadin
ConnectorBundleLoader
:
- In
package.WSF
class override protected
Collection getConnectorsForWidgetset(…)
method to return our necessary connectors:
[code]
@Override
protected Collection getConnectorsForWidgetset(TreeLogger logger, TypeOracle typeOracle) throws UnableToCompleteException {
// Proof code
List whiteList = new ArrayList();
whiteList.add(“com.vaadin.client.ui.ui.UIConnector”);
whiteList.add(“com.vaadin.client.ui.orderedlayout.VerticalLayoutConnector”);
whiteList.add(“com.vaadin.client.ui.label.LabelConnector”);
whiteList.add(“com.vaadin.client.ui.button.ButtonConnector”);
whiteList.add(“ru.rlisystems.web.platform.addons.dynamichtml.client.DynamicHTMLConnector”);
Collection<JClassType> list = new ArrayList<JClassType>();
System.out.println("getConnectorsForWidgetset() called: typeOracle=" + String.valueOf(typeOracle.getJavaLangObject() ));
for (JClassType ct : super.getConnectorsForWidgetset(logger, typeOracle)) {
String log = ct.getParameterizedQualifiedSourceName();
if (whiteList.contains(ct.getParameterizedQualifiedSourceName())) {
list.add(ct);
log += " [OK]
";
} else
log += " [EXCLUDE]
";
System.out.println(log);
}
return list;
}
[/code]So, our widgetset contains widgets with connector names, specified in whiteList collectiob, and widgetset .js file decreased from 12 to 6 Mbytes