Search in sources :

Example 6 with FrameworkInstanceDefinition

use of org.osmorc.frameworkintegration.FrameworkInstanceDefinition in project intellij-plugins by JetBrains.

the class FrameworkDefinitionsEditorComponent method resetTo.

public void resetTo(@NotNull ApplicationSettings settings) {
    myModel.clear();
    for (FrameworkInstanceDefinition instance : settings.getActiveFrameworkInstanceDefinitions()) {
        myModel.addElement(instance);
    }
    myModified.clear();
}
Also used : FrameworkInstanceDefinition(org.osmorc.frameworkintegration.FrameworkInstanceDefinition)

Example 7 with FrameworkInstanceDefinition

use of org.osmorc.frameworkintegration.FrameworkInstanceDefinition in project intellij-plugins by JetBrains.

the class OsgiRunConfiguration method getInstanceToUse.

@Nullable
public FrameworkInstanceDefinition getInstanceToUse() {
    if (instanceToUse != null)
        return instanceToUse;
    String projectInstanceName = ProjectSettings.getInstance(getProject()).getFrameworkInstanceName();
    FrameworkInstanceDefinition projectInstance = ApplicationSettings.getInstance().getFrameworkInstance(projectInstanceName);
    if (projectInstance != null)
        return projectInstance;
    return null;
}
Also used : FrameworkInstanceDefinition(org.osmorc.frameworkintegration.FrameworkInstanceDefinition) Nullable(org.jetbrains.annotations.Nullable)

Example 8 with FrameworkInstanceDefinition

use of org.osmorc.frameworkintegration.FrameworkInstanceDefinition in project intellij-plugins by JetBrains.

the class ApplicationSettings method getActiveFrameworkInstanceDefinitions.

@NotNull
public List<FrameworkInstanceDefinition> getActiveFrameworkInstanceDefinitions() {
    if (myActiveInstances == null) {
        final FrameworkIntegratorRegistry registry = FrameworkIntegratorRegistry.getInstance();
        myActiveInstances = ContainerUtil.filter(myInstances, definition -> registry.findIntegratorByInstanceDefinition(definition) != null);
    }
    return myActiveInstances;
}
Also used : Storage(com.intellij.openapi.components.Storage) FrameworkInstanceDefinition(org.osmorc.frameworkintegration.FrameworkInstanceDefinition) PersistentStateComponent(com.intellij.openapi.components.PersistentStateComponent) FrameworkIntegratorRegistry(org.osmorc.frameworkintegration.FrameworkIntegratorRegistry) ContainerUtil(com.intellij.util.containers.ContainerUtil) LibraryBundlificationRule(org.jetbrains.osgi.jps.model.LibraryBundlificationRule) AbstractCollection(com.intellij.util.xmlb.annotations.AbstractCollection) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) ServiceManager(com.intellij.openapi.components.ServiceManager) XmlSerializerUtil(com.intellij.util.xmlb.XmlSerializerUtil) State(com.intellij.openapi.components.State) NotNull(org.jetbrains.annotations.NotNull) Condition(com.intellij.openapi.util.Condition) FrameworkIntegratorRegistry(org.osmorc.frameworkintegration.FrameworkIntegratorRegistry) NotNull(org.jetbrains.annotations.NotNull)

Example 9 with FrameworkInstanceDefinition

use of org.osmorc.frameworkintegration.FrameworkInstanceDefinition in project intellij-plugins by JetBrains.

the class FrameworkDefinitionsEditorComponent method removeFrameworkInstance.

private void removeFrameworkInstance() {
    int index = myFrameworkInstances.getSelectedIndex();
    if (index != -1) {
        FrameworkInstanceDefinition instance = myModel.get(index);
        myModel.remove(index);
        myFrameworkInstances.setSelectedIndex(0);
        myModified.add(Pair.create(instance, null));
    }
}
Also used : FrameworkInstanceDefinition(org.osmorc.frameworkintegration.FrameworkInstanceDefinition)

Example 10 with FrameworkInstanceDefinition

use of org.osmorc.frameworkintegration.FrameworkInstanceDefinition in project intellij-plugins by JetBrains.

the class ProjectSettingsEditorComponent method applyTo.

public void applyTo(ProjectSettings settings) {
    String fileLocation = (String) myDefaultManifestFileLocation.getSelectedItem();
    if (fileLocation != null) {
        settings.setDefaultManifestFileLocation(fileLocation);
    }
    FrameworkInstanceDefinition instance = (FrameworkInstanceDefinition) myFrameworkInstance.getSelectedItem();
    settings.setFrameworkInstanceName(instance != null ? instance.getName() : null);
    String outputPath = myBundleOutputPath.getText();
    settings.setBundlesOutputPath(!StringUtil.isEmptyOrSpaces(outputPath) ? outputPath : null);
    settings.setBndAutoImport(myBndAutoImport.isSelected());
    myModified = false;
}
Also used : FrameworkInstanceDefinition(org.osmorc.frameworkintegration.FrameworkInstanceDefinition)

Aggregations

FrameworkInstanceDefinition (org.osmorc.frameworkintegration.FrameworkInstanceDefinition)10 Nullable (org.jetbrains.annotations.Nullable)2 PersistentStateComponent (com.intellij.openapi.components.PersistentStateComponent)1 ServiceManager (com.intellij.openapi.components.ServiceManager)1 State (com.intellij.openapi.components.State)1 Storage (com.intellij.openapi.components.Storage)1 Condition (com.intellij.openapi.util.Condition)1 ContainerUtil (com.intellij.util.containers.ContainerUtil)1 XmlSerializerUtil (com.intellij.util.xmlb.XmlSerializerUtil)1 AbstractCollection (com.intellij.util.xmlb.annotations.AbstractCollection)1 List (java.util.List)1 NotNull (org.jetbrains.annotations.NotNull)1 LibraryBundlificationRule (org.jetbrains.osgi.jps.model.LibraryBundlificationRule)1 FrameworkIntegrator (org.osmorc.frameworkintegration.FrameworkIntegrator)1 FrameworkIntegratorRegistry (org.osmorc.frameworkintegration.FrameworkIntegratorRegistry)1 OsgiRunConfigurationChecker (org.osmorc.run.OsgiRunConfigurationChecker)1 OsgiRunConfigurationCheckerProvider (org.osmorc.run.OsgiRunConfigurationCheckerProvider)1