use of org.osmorc.frameworkintegration.FrameworkInstanceDefinition in project intellij-plugins by JetBrains.
the class OsgiRunConfigurationEditor method onAddClick.
private void onAddClick() {
FrameworkInstanceDefinition instance = (FrameworkInstanceDefinition) myFrameworkInstances.getSelectedItem();
BundleSelector selector = new BundleSelector(myProject, instance, getBundlesToRun());
if (selector.showAndGet()) {
RunConfigurationTableModel model = getTableModel();
for (SelectedBundle aModule : selector.getSelectedBundles()) {
model.addBundle(aModule);
}
}
}
use of org.osmorc.frameworkintegration.FrameworkInstanceDefinition in project intellij-plugins by JetBrains.
the class OsgiRunConfigurationEditor method onFrameworkChange.
/**
* Called when the framework is changed. This will create a new editor for framework properties and will also remove
* any framework bundles from the list, as they are no longer in classpath.
*/
private void onFrameworkChange() {
if (myFrameworkInstances.getSelectedItem() != null) {
FrameworkInstanceDefinition instance = (FrameworkInstanceDefinition) myFrameworkInstances.getSelectedItem();
FrameworkIntegrator integrator = FrameworkIntegratorRegistry.getInstance().findIntegratorByInstanceDefinition(instance);
assert integrator != null : instance;
// clear the panel
myAdditionalPropertiesPanel.removeAll();
// create and install a new editor (if present)
myCurrentRunPropertiesEditor = integrator.createRunPropertiesEditor();
if (myCurrentRunPropertiesEditor != null) {
myAdditionalPropertiesPanel.removeAll();
myAdditionalPropertiesPanel.add(myCurrentRunPropertiesEditor.getUI(), BorderLayout.CENTER);
if (myRunConfiguration != null) {
myCurrentRunPropertiesEditor.resetEditorFrom(myRunConfiguration);
OsgiRunConfigurationChecker checker = null;
if (integrator instanceof OsgiRunConfigurationCheckerProvider) {
checker = ((OsgiRunConfigurationCheckerProvider) integrator).getOsgiRunConfigurationChecker();
}
myRunConfiguration.setAdditionalChecker(checker);
}
}
// remove all framework bundles from the list
RunConfigurationTableModel model = getTableModel();
model.removeAllOfType(SelectedBundle.BundleType.FrameworkBundle);
}
}
use of org.osmorc.frameworkintegration.FrameworkInstanceDefinition in project intellij-plugins by JetBrains.
the class ProjectSettingsEditorComponent method refreshFrameworkInstanceCombobox.
private void refreshFrameworkInstanceCombobox() {
myFrameworkInstance.removeAllItems();
myFrameworkInstance.addItem(null);
List<FrameworkInstanceDefinition> instanceDefinitions = ApplicationSettings.getInstance().getActiveFrameworkInstanceDefinitions();
String frameworkInstanceName = mySettings.getFrameworkInstanceName();
FrameworkInstanceDefinition projectFrameworkInstance = null;
for (FrameworkInstanceDefinition instanceDefinition : instanceDefinitions) {
myFrameworkInstance.addItem(instanceDefinition);
if (instanceDefinition.getName().equals(frameworkInstanceName)) {
projectFrameworkInstance = instanceDefinition;
}
}
// add it, but it will be marked red.
if (projectFrameworkInstance == null && frameworkInstanceName != null) {
projectFrameworkInstance = new FrameworkInstanceDefinition();
projectFrameworkInstance.setName(frameworkInstanceName);
myFrameworkInstance.addItem(projectFrameworkInstance);
}
myFrameworkInstance.setSelectedItem(projectFrameworkInstance);
}
use of org.osmorc.frameworkintegration.FrameworkInstanceDefinition in project intellij-plugins by JetBrains.
the class FrameworkDefinitionsEditorComponent method addFrameworkInstance.
private void addFrameworkInstance(FrameworkIntegrator integrator) {
FrameworkInstanceDefinition instance = new FrameworkInstanceDefinition();
instance.setFrameworkIntegratorName(integrator.getDisplayName());
CreateFrameworkInstanceDialog dialog = new CreateFrameworkInstanceDialog(instance, myModel);
dialog.pack();
if (dialog.showAndGet()) {
instance = dialog.createDefinition();
myModel.addElement(instance);
myFrameworkInstances.setSelectedIndex(myModel.getSize() - 1);
myModified.add(Pair.create(null, instance));
}
}
use of org.osmorc.frameworkintegration.FrameworkInstanceDefinition in project intellij-plugins by JetBrains.
the class FrameworkDefinitionsEditorComponent method editFrameworkInstance.
private void editFrameworkInstance() {
int index = myFrameworkInstances.getSelectedIndex();
if (index != -1) {
FrameworkInstanceDefinition instance = myModel.get(index);
CreateFrameworkInstanceDialog dialog = new CreateFrameworkInstanceDialog(instance, myModel);
dialog.pack();
if (dialog.showAndGet()) {
FrameworkInstanceDefinition newInstance = dialog.createDefinition();
myModel.set(index, newInstance);
myModified.add(Pair.create(instance, newInstance));
}
}
}
Aggregations