Skip to content

Commit

Permalink
New attempt to fix a NPE when adding IvyIDEA facet with IntelliJ 13.1…
Browse files Browse the repository at this point in the history
… (fixes issue 132)
  • Loading branch information
maartenc committed Mar 26, 2014
1 parent 38b559f commit dbf5638
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
8 changes: 6 additions & 2 deletions src/main/java/META-INF/plugin.xml
Expand Up @@ -4,7 +4,7 @@
<description><![CDATA[Resolves module dependencies through Ivy
<p>Features:
<ul>
<li>Apache Ivy integration (up to v2.3.0); no need for external ant build scripts to be called</li>
<li>Apache Ivy integration (up to v2.4.0-rc1); no need for external ant build scripts to be called</li>
<li>Automatic ivy configuration of modules using facets (for modules containing an ivy.xml file)</li>
<li>Detection of dependencies that are really other intellij modules in the same project; these are added as module references</li>
<li>Detect source/document/jar type ivy artifacts in dependencies and add them as such to the module</li>
Expand All @@ -16,6 +16,10 @@
</description>
<change-notes><![CDATA[
<p>
<strong>1.0.10</strong>
<ul>
<li>Fixed compatibility issue with IntelliJ 13.1</li>
</ul>
<strong>1.0.9</strong>
<ul>
<li>Added an extra configuration option to always attach the source/javadoc artifacts, even when
Expand Down Expand Up @@ -95,7 +99,7 @@
</ul>
</p>]]>
</change-notes>
<version>1.0.9</version>
<version>1.0.10</version>
<vendor email="guy.mahieu@gmail.com" url="http://www.clarent.org" logo="/ivyidea16.png">Guy Mahieu</vendor>
<idea-version since-build="3000"/>
<application-components>
Expand Down
Expand Up @@ -126,7 +126,7 @@ private void updateIvySettingsFileTextfield() {
}

private void updateConfigurationsTable() {
tblConfigurationSelection.setEnabled(chkOnlyResolveSpecificConfigs.isSelected());
tblConfigurationSelection.setConfigurationsEnabled(chkOnlyResolveSpecificConfigs.isSelected());
}

private void updateIvySettingsUIState() {
Expand Down Expand Up @@ -274,7 +274,7 @@ public void reset() {
} else {
tblConfigurationSelection.setModel(new ConfigurationSelectionTableModel());
selectedConfigurations = new HashSet<Configuration>();
tblConfigurationSelection.setEnabled(false);
tblConfigurationSelection.setConfigurationsEnabled(false);
}
updateUI();
}
Expand Down
Expand Up @@ -19,7 +19,6 @@
import com.intellij.ui.BooleanTableCellEditor;
import com.intellij.ui.BooleanTableCellRenderer;
import com.intellij.util.ui.Table;
import com.intellij.util.ui.UIUtil;
import org.apache.ivy.core.module.descriptor.Configuration;

import javax.swing.*;
Expand All @@ -39,9 +38,10 @@

public class ConfigurationSelectionTable extends Table {

private boolean configurationsEnabled = true;

public ConfigurationSelectionTable() {
super(new ConfigurationSelectionTableModel());
setForeground(UIUtil.getTableForeground());
initComponents();
}

Expand All @@ -50,6 +50,10 @@ public void setModel(TableModel dataModel) {
initComponents();
}

public void setConfigurationsEnabled(boolean configurationsEnabled) {
this.configurationsEnabled = configurationsEnabled;
}

public Set<Configuration> getSelectedConfigurations() {
return ((ConfigurationSelectionTableModel) getModel()).getSelectedConfigurations();
}
Expand All @@ -71,7 +75,7 @@ private void initComponents() {
getColumnModel().getColumn(0).setCellRenderer(new BooleanTableCellRenderer() {
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
final Component rendererComponent = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
rendererComponent.setEnabled(table.isEnabled());
rendererComponent.setEnabled(configurationsEnabled);
return rendererComponent;
}
});
Expand Down Expand Up @@ -103,7 +107,7 @@ public Component getTableCellRendererComponent(JTable table, Object value, boole
setToolTipText(null);
rendererComponent.setFont(regularFont);
}
rendererComponent.setEnabled(table.isEnabled());
rendererComponent.setEnabled(configurationsEnabled);
return rendererComponent;
}
});
Expand All @@ -112,7 +116,7 @@ public Component getTableCellRendererComponent(JTable table, Object value, boole
getColumnModel().getColumn(2).setCellRenderer(new DefaultTableCellRenderer() {
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
final Component rendererComponent = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
rendererComponent.setEnabled(table.isEnabled());
rendererComponent.setEnabled(configurationsEnabled);
return rendererComponent;
}
});
Expand Down

0 comments on commit dbf5638

Please sign in to comment.