List<LayoutDescription> descriptions =
LayoutDescriptionHelper.get(GwtExtToolkitDescription.INSTANCE);
for (final LayoutDescription description : descriptions) {
final Class<?> layoutClass = editorLoader.loadClass(description.getLayoutClassName());
final String creationId = description.getCreationId();
ComponentDescription layoutComponentDescription =
ComponentDescriptionHelper.getDescription(editor, layoutClass);
ObjectInfoAction action = new ObjectInfoAction(this) {
@Override
protected void runEx() throws Exception {
description.ensureLibraries(editor.getJavaProject());
LayoutInfo layout =
(LayoutInfo) JavaInfoUtils.createJavaInfo(
getEditor(),
layoutClass,
new ConstructorCreationSupport(creationId, true));
setLayout(layout);
}
};
action.setText(description.getName());
action.setImageDescriptor(new ImageImageDescriptor(layoutComponentDescription.getIcon()));
layoutsManager.add(action);
}
}