// Show the associated widget in the deck panel
public void onSelection(SelectionEvent<TreeItem> event) {
TreeItem node = event.getSelectedItem();
Object userObject = node.getUserObject();
TabOpener opener = TabOpener.getInstance();
if ( userObject != null ) {
if ( userObject instanceof PackageConfigData && !((PackageConfigData) userObject).isGlobal() ) {
PackageConfigData pc = (PackageConfigData) userObject;
RulePackageSelector.currentlySelectedPackage = pc.name;
String uuid = pc.uuid;
opener.openPackageEditor( uuid,
new Command() {
public void execute() {
// refresh the package tree.
refreshTree();
}
} );
} else if ( userObject instanceof String[] ) {
final String[] formats = (String[]) userObject;
final PackageConfigData packageConfigData = (PackageConfigData) node.getParentItem().getUserObject();
RulePackageSelector.currentlySelectedPackage = packageConfigData.name;
String key = key( formats,
packageConfigData );
opener.openPackageViewAssets( packageConfigData.uuid,
packageConfigData.name,
key,
formats.length == 0 ? null : Arrays.asList( formats ),
formats.length == 0 ? Boolean.TRUE : null,
node.getText() );