mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
+24
-13
@@ -33,6 +33,7 @@ import com.intellij.ui.treeStructure.*;
|
||||
import com.intellij.util.PathUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import gnu.trove.THashMap;
|
||||
import gnu.trove.THashSet;
|
||||
import icons.MavenIcons;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -64,6 +65,7 @@ public class MavenProjectsStructure extends SimpleTreeStructure {
|
||||
private static final Collection<String> PHASES = MavenConstants.PHASES;
|
||||
|
||||
private static final Comparator<MavenSimpleNode> NODE_COMPARATOR = new Comparator<MavenSimpleNode>() {
|
||||
@Override
|
||||
public int compare(MavenSimpleNode o1, MavenSimpleNode o2) {
|
||||
return StringUtil.compare(o1.getName(), o2.getName(), true);
|
||||
}
|
||||
@@ -106,6 +108,7 @@ public class MavenProjectsStructure extends SimpleTreeStructure {
|
||||
tree.setShowsRootHandles(true);
|
||||
|
||||
MavenUIUtil.installCheckboxRenderer(tree, new MavenUIUtil.CheckboxHandler() {
|
||||
@Override
|
||||
public void toggle(TreePath treePath, InputEvent e) {
|
||||
SimpleNode node = tree.getNodeFor(treePath);
|
||||
if (node != null) {
|
||||
@@ -113,10 +116,12 @@ public class MavenProjectsStructure extends SimpleTreeStructure {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisible(Object userObject) {
|
||||
return userObject instanceof ProfileNode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MavenUIUtil.CheckBoxState getState(Object userObject) {
|
||||
MavenProfileKind state = ((ProfileNode)userObject).getState();
|
||||
switch (state) {
|
||||
@@ -133,6 +138,7 @@ public class MavenProjectsStructure extends SimpleTreeStructure {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public RootNode getRootElement() {
|
||||
return myRoot;
|
||||
}
|
||||
@@ -449,13 +455,13 @@ public class MavenProjectsStructure extends SimpleTreeStructure {
|
||||
}
|
||||
}
|
||||
|
||||
protected void setNameAndTooltip(String name, @Nullable String tooltip, SimpleTextAttributes attribs) {
|
||||
protected void setNameAndTooltip(String name, @Nullable String tooltip, SimpleTextAttributes attributes) {
|
||||
clearColoredText();
|
||||
addColoredFragment(name, prepareAttribs(attribs));
|
||||
addColoredFragment(name, prepareAttributes(attributes));
|
||||
getTemplatePresentation().setTooltip(tooltip);
|
||||
}
|
||||
|
||||
private SimpleTextAttributes prepareAttribs(SimpleTextAttributes from) {
|
||||
private SimpleTextAttributes prepareAttributes(SimpleTextAttributes from) {
|
||||
ErrorLevel level = getTotalErrorLevel();
|
||||
Color waveColor = level == ErrorLevel.NONE ? null : JBColor.RED;
|
||||
int style = from.getStyle();
|
||||
@@ -485,6 +491,7 @@ public class MavenProjectsStructure extends SimpleTreeStructure {
|
||||
return MavenNavigationUtil.createNavigatableForPom(getProject(), getVirtualFile());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleDoubleClickOrEnter(SimpleTree tree, InputEvent inputEvent) {
|
||||
String actionId = getActionId();
|
||||
if (actionId != null) {
|
||||
@@ -587,6 +594,7 @@ public class MavenProjectsStructure extends SimpleTreeStructure {
|
||||
setUniformIcon(MavenIcons.ProfilesClosed);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<? extends MavenSimpleNode> doGetChildren() {
|
||||
return myProfileNodes;
|
||||
}
|
||||
@@ -645,6 +653,7 @@ public class MavenProjectsStructure extends SimpleTreeStructure {
|
||||
myState = state;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
@NonNls
|
||||
protected String getActionId() {
|
||||
@@ -839,13 +848,14 @@ public class MavenProjectsStructure extends SimpleTreeStructure {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setNameAndTooltip(String name, @Nullable String tooltip, SimpleTextAttributes attribs) {
|
||||
super.setNameAndTooltip(name, tooltip, attribs);
|
||||
protected void setNameAndTooltip(String name, @Nullable String tooltip, SimpleTextAttributes attributes) {
|
||||
super.setNameAndTooltip(name, tooltip, attributes);
|
||||
if (myProjectsNavigator.getShowVersions()) {
|
||||
addColoredFragment(":" + myMavenProject.getMavenId().getVersion(), new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, JBColor.GRAY));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
@NonNls
|
||||
protected String getMenuId() {
|
||||
@@ -872,6 +882,7 @@ public class MavenProjectsStructure extends SimpleTreeStructure {
|
||||
super(parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<? extends MavenSimpleNode> doGetChildren() {
|
||||
return myGoalNodes;
|
||||
}
|
||||
@@ -943,12 +954,14 @@ public class MavenProjectsStructure extends SimpleTreeStructure {
|
||||
return original;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
@NonNls
|
||||
protected String getActionId() {
|
||||
return "Maven.RunBuild";
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
@NonNls
|
||||
protected String getMenuId() {
|
||||
@@ -1001,6 +1014,7 @@ public class MavenProjectsStructure extends SimpleTreeStructure {
|
||||
return message("view.node.plugins");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<? extends MavenSimpleNode> doGetChildren() {
|
||||
return myPluginNodes;
|
||||
}
|
||||
@@ -1269,15 +1283,13 @@ public class MavenProjectsStructure extends SimpleTreeStructure {
|
||||
public void updateRunConfigurations(MavenProject mavenProject) {
|
||||
boolean childChanged = false;
|
||||
|
||||
List<RunnerAndConfigurationSettings>
|
||||
list = RunManager.getInstance(myProject).getConfigurationSettingsList(MavenRunConfigurationType.getInstance());
|
||||
|
||||
Set<RunnerAndConfigurationSettings> cfgs = new HashSet<RunnerAndConfigurationSettings>(((Collection<RunnerAndConfigurationSettings>)((Collection)list)));
|
||||
Set<RunnerAndConfigurationSettings> settings = new THashSet<RunnerAndConfigurationSettings>(
|
||||
RunManager.getInstance(myProject).getConfigurationSettingsList(MavenRunConfigurationType.getInstance()));
|
||||
|
||||
for (Iterator<RunConfigurationNode> itr = myChildren.iterator(); itr.hasNext(); ) {
|
||||
RunConfigurationNode node = itr.next();
|
||||
|
||||
if (cfgs.remove(node.getSettings())) {
|
||||
if (settings.remove(node.getSettings())) {
|
||||
node.updateRunConfiguration();
|
||||
}
|
||||
else {
|
||||
@@ -1290,7 +1302,7 @@ public class MavenProjectsStructure extends SimpleTreeStructure {
|
||||
|
||||
int oldSize = myChildren.size();
|
||||
|
||||
for (RunnerAndConfigurationSettings cfg : cfgs) {
|
||||
for (RunnerAndConfigurationSettings cfg : settings) {
|
||||
MavenRunConfiguration mavenRunConfiguration = (MavenRunConfiguration)cfg.getConfiguration();
|
||||
|
||||
if (directory.equals(PathUtil.getCanonicalPath(mavenRunConfiguration.getRunnerParameters().getWorkingDirPath()))) {
|
||||
@@ -1310,8 +1322,7 @@ public class MavenProjectsStructure extends SimpleTreeStructure {
|
||||
}
|
||||
|
||||
public class RunConfigurationNode extends MavenSimpleNode {
|
||||
|
||||
private RunnerAndConfigurationSettings mySettings;
|
||||
private final RunnerAndConfigurationSettings mySettings;
|
||||
|
||||
public RunConfigurationNode(RunConfigurationsNode parent, RunnerAndConfigurationSettings settings) {
|
||||
super(parent);
|
||||
|
||||
Reference in New Issue
Block a user