}
//TODO: move it to separate class
private Menu packageNewMenu() {
Menu m = new Menu();
m.addItem(new Item(constants.NewPackage1(), new BaseItemListenerAdapter() {
public void onClick(BaseItem item, EventObject e) {
NewPackageWizard wiz = new NewPackageWizard(new Command() {
public void execute() {
refreshPackageTree();
}
});
wiz.show();
}
}, "images/new_package.gif")); //NON-NLS
//SubPackage are currently not used.
// m.addItem(new Item(constants.NewSubPackage(), new BaseItemListenerAdapter() {
// public void onClick(BaseItem item, EventObject e) {
// NewSubPackageWizard wiz = new NewSubPackageWizard(new Command() {
// public void execute() {
// refreshPackageTree();
// }
// });
// wiz.show();
// }
// }, "images/new_package.gif")); //NON-NLS
m.addItem(new Item(constants.NewWorkingSet(), new BaseItemListenerAdapter() {
public void onClick(BaseItem item, EventObject e) {
launchWizard(AssetFormats.WORKING_SET, constants.NewWorkingSet(), false);
}
}, "images/new_package.gif")); //NON-NLS
m.addItem(new Item(constants.NewRule(), new BaseItemListenerAdapter() {
public void onClick(BaseItem item, EventObject e) {
launchWizard(null, constants.NewRule(), true);
}
}, "images/rule_asset.gif")); //NON-NLS
m.addItem(new Item(constants.UploadPOJOModelJar(), new BaseItemListenerAdapter() {
public void onClick(BaseItem item, EventObject e) {
launchWizard(AssetFormats.MODEL, constants.NewModelArchiveJar(), false);
}
}, "images/model_asset.gif")); //NON-NLS
m.addItem(new Item(constants.NewDeclarativeModel(), new BaseItemListenerAdapter() {
public void onClick(BaseItem item, EventObject e) {
launchWizard(AssetFormats.DRL_MODEL, constants.NewDeclarativeModelUsingGuidedEditor(), false);
}
}, "images/model_asset.gif")); //NON-NLS
if (Preferences.getBooleanPref("flex-bpel-editor")) {
m.addItem(new Item(constants.NewBPELPackage(),
new BaseItemListenerAdapter() {
public void onClick(BaseItem item, EventObject e) {
launchWizard(AssetFormats.BPEL_PACKAGE, constants
.CreateANewBPELPackage(), false);
}
}, "images/model_asset.gif")); // NON-NLS
}
m.addItem(new Item(constants.NewFunction(), new BaseItemListenerAdapter() {
public void onClick(BaseItem item, EventObject e) {
launchWizard(AssetFormats.FUNCTION, constants.CreateANewFunction(), false);
}
}, "images/function_assets.gif")); //NON-NLS
m.addItem(new Item(constants.NewDSL(), new BaseItemListenerAdapter() {
public void onClick(BaseItem item, EventObject e) {
launchWizard(AssetFormats.DSL, constants.CreateANewDSLConfiguration(), false);
}
}, "images/dsl.gif")); //NON-NLS
m.addItem(new Item(constants.NewRuleFlow(), new BaseItemListenerAdapter() {
public void onClick(BaseItem item, EventObject e) {
launchWizard(AssetFormats.RULE_FLOW_RF, constants.CreateANewRuleFlow(), false);
}
}, "images/ruleflow_small.gif")); //NON-NLS
m.addItem(new Item(constants.NewEnumeration(), new BaseItemListenerAdapter() {
public void onClick(BaseItem item, EventObject e) {
launchWizard(AssetFormats.ENUMERATION, constants.CreateANewEnumerationDropDownMapping(), false);
}
}, "images/new_enumeration.gif")); //NON-NLS
m.addItem(new Item(constants.NewTestScenario(), new BaseItemListenerAdapter() {
public void onClick(BaseItem item, EventObject e) {
launchWizard(AssetFormats.TEST_SCENARIO, constants.CreateATestScenario(), false);
}
}, "images/test_manager.gif")); //NON-NLS
m.addItem(new Item(constants.NewFile(), new BaseItemListenerAdapter() {
public void onClick(BaseItem item, EventObject e) {
launchWizard("*", constants.CreateAFile(), false);
}
}, "images/new_file.gif")); //NON-NLS
m.addItem(new Item(constants.RebuildAllPackageBinariesQ(), new BaseItemListenerAdapter() {
public void onClick(BaseItem item, EventObject e) {
if (Window.confirm(constants.RebuildConfirmWarning())) {
LoadingPopup.showMessage(constants.RebuildingPackageBinaries());
RepositoryServiceFactory.getService().rebuildPackages(new GenericCallback<Void>() {
public void onSuccess(Void data) {
LoadingPopup.close();
}
});
}
}
}, "images/refresh.gif")); //NON-NLS
m.addItem(new Item(constants.NewRuleTemplate(), new BaseItemListenerAdapter() {
@Override
public void onClick(BaseItem item, EventObject e) {
launchWizard(AssetFormats.RULE_TEMPLATE, constants.NewRuleTemplate(), true);
}
}, "images/new_template.gif")); //NON-NLS