use of org.osmorc.facet.OsmorcFacetConfiguration in project intellij-plugins by JetBrains.
the class OsmorcFacetManifestGenerationEditorTab method reset.
@Override
public void reset() {
OsmorcFacetConfiguration configuration = (OsmorcFacetConfiguration) myEditorContext.getFacet().getConfiguration();
myBundleActivator.setText(configuration.getBundleActivator());
myBundleSymbolicName.setText(configuration.getBundleSymbolicName());
myBundleVersion.setText(configuration.getBundleVersion());
myAdditionalPropertiesEditor.setText(configuration.getAdditionalProperties());
updateGui();
}
use of org.osmorc.facet.OsmorcFacetConfiguration in project intellij-plugins by JetBrains.
the class OsmorcFacetManifestGenerationEditorTab method apply.
@Override
public void apply() {
OsmorcFacetConfiguration configuration = (OsmorcFacetConfiguration) myEditorContext.getFacet().getConfiguration();
configuration.setBundleActivator(myBundleActivator.getText());
configuration.setBundleSymbolicName(myBundleSymbolicName.getText());
configuration.setBundleVersion(myBundleVersion.getText());
configuration.setAdditionalProperties(myAdditionalPropertiesEditor.getText());
}
use of org.osmorc.facet.OsmorcFacetConfiguration in project intellij-plugins by JetBrains.
the class OsmorcFacetGeneralEditorTab method reset.
@Override
public void reset() {
OsmorcFacetConfiguration configuration = (OsmorcFacetConfiguration) myEditorContext.getFacet().getConfiguration();
if (configuration.isUseBndFile()) {
myUseBndFileRadioButton.setSelected(true);
} else if (configuration.isUseBundlorFile()) {
myUseBundlorFileRadioButton.setSelected(true);
} else if (configuration.isOsmorcControlsManifest()) {
myControlledByOsmorcRadioButton.setSelected(true);
} else {
myManuallyEditedRadioButton.setSelected(true);
}
myManifestFileChooser.setText(FileUtil.toSystemDependentName(configuration.getManifestLocation()));
if (configuration.isUseProjectDefaultManifestFileLocation()) {
myUseProjectDefaultManifestFileLocation.setSelected(true);
} else {
myUseModuleSpecificManifestFileLocation.setSelected(true);
}
myBndFile.setText(FileUtil.toSystemDependentName(configuration.getBndFileLocation()));
myBundlorFile.setText(FileUtil.toSystemDependentName(configuration.getBundlorFileLocation()));
myDoNotSynchronizeFacetCheckBox.setSelected(configuration.isDoNotSynchronizeWithMaven());
updateGui();
myModified = false;
}
use of org.osmorc.facet.OsmorcFacetConfiguration in project intellij-plugins by JetBrains.
the class OsmorcFacetJAREditorTab method apply.
@Override
public void apply() throws ConfigurationException {
String jarFileName = myJarFileTextField.getText();
if (StringUtil.isEmptyOrSpaces(jarFileName)) {
throw new ConfigurationException(OsmorcBundle.message("facet.editor.jar.empty.jar.name"));
}
OsmorcFacetConfiguration configuration = (OsmorcFacetConfiguration) myEditorContext.getFacet().getConfiguration();
OutputPathType pathType = getSelectedOutputPathType();
if (pathType == SpecificOutputPath) {
String location = myJarOutputPathChooser.getText();
if (StringUtil.isEmptyOrSpaces(location)) {
throw new ConfigurationException(OsmorcBundle.message("facet.editor.jar.empty.output.path"));
}
String completeOutputPath = new File(location, jarFileName).getPath();
configuration.setJarFileLocation(completeOutputPath, pathType);
} else {
configuration.setJarFileLocation(jarFileName, pathType);
}
configuration.setIgnoreFilePattern(myIgnoreFilePatternTextField.getText());
configuration.setAlwaysRebuildBundleJAR(myAlwaysRebuildBundleJARCheckBox.isSelected());
configuration.setAdditionalJARContents(myAdditionalJARContentsTableModel.getAdditionalContents());
myModified = false;
}
use of org.osmorc.facet.OsmorcFacetConfiguration in project intellij-plugins by JetBrains.
the class AdditionalJARContentsWatcherManager method updateWatcherSetup.
public void updateWatcherSetup() {
OsmorcFacet osmorcFacet = OsmorcFacet.getInstance(myModule);
if (osmorcFacet != null) {
List<VirtualFile> newAdditionalJARContents = new ArrayList<>();
OsmorcFacetConfiguration osmorcFacetConfiguration = osmorcFacet.getConfiguration();
List<Pair<String, String>> jarContents = osmorcFacetConfiguration.getAdditionalJARContents();
for (Pair<String, String> jarContent : jarContents) {
VirtualFile file = myFileSystem.findFileByPath(jarContent.getFirst());
if (file != null) {
newAdditionalJARContents.add(file);
}
}
List<LocalFileSystem.WatchRequest> toRemove = new ArrayList<>();
for (Iterator<VirtualFile> jarContentsIterator = myAdditionalBundleJARContents.iterator(); jarContentsIterator.hasNext(); ) {
VirtualFile file = jarContentsIterator.next();
if (!newAdditionalJARContents.contains(file)) {
jarContentsIterator.remove();
for (Iterator<LocalFileSystem.WatchRequest> watchIterator = myWatchRequests.iterator(); watchIterator.hasNext(); ) {
LocalFileSystem.WatchRequest watchRequest = watchIterator.next();
if (Comparing.strEqual(file.getPath(), watchRequest.getRootPath())) {
toRemove.add(watchRequest);
watchIterator.remove();
}
}
}
}
List<String> toAdd = new ArrayList<>();
for (VirtualFile newAdditionalJARContent : newAdditionalJARContents) {
if (!myAdditionalBundleJARContents.contains(newAdditionalJARContent)) {
toAdd.add(newAdditionalJARContent.getPath());
myAdditionalBundleJARContents.add(newAdditionalJARContent);
}
}
Set<LocalFileSystem.WatchRequest> requests = myFileSystem.replaceWatchedRoots(toRemove, toAdd, null);
myWatchRequests.addAll(requests);
} else {
cleanup();
}
}
Aggregations