This repository has been archived by the owner on Sep 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mark invalid configurations in the PMD property page with an icon
Invalid configurations are marked with a warning icon (when they are not activated) or an error icon (when they are activated). A tool tip shows the actual absolute path of the configuration to help the user resolve the problem. This is the second part of resolving issue #20.
- Loading branch information
Showing
21 changed files
with
572 additions
and
138 deletions.
There are no files selected for viewing
260 changes: 205 additions & 55 deletions
260
ch.acanda.eclipse.pmd.core.tests/src/ch/acanda/eclipse/pmd/builder/LocationResolverTest.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
ch.acanda.eclipse.pmd.core/src/ch/acanda/eclipse/pmd/properties/LocationLabelProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// ===================================================================== | ||
// | ||
// Copyright (C) 2012 - 2015, Philip Graf | ||
// | ||
// All rights reserved. This program and the accompanying materials | ||
// are made available under the terms of the Eclipse Public License v1.0 | ||
// which accompanies this distribution, and is available at | ||
// http://www.eclipse.org/legal/epl-v10.html | ||
// | ||
// ===================================================================== | ||
|
||
package ch.acanda.eclipse.pmd.properties; | ||
|
||
import org.eclipse.swt.graphics.Image; | ||
|
||
import ch.acanda.eclipse.pmd.properties.PMDPropertyPageViewModel.RuleSetViewModel; | ||
|
||
/** | ||
* Provides the label and tool tip for the location column. | ||
* | ||
* @author Philip Graf | ||
*/ | ||
final class LocationLabelProvider extends RuleSetConfigurationLabelProvider { | ||
|
||
protected LocationLabelProvider(final PMDPropertyPageViewModel model) { | ||
super(model); | ||
} | ||
|
||
@Override | ||
protected String getText(final RuleSetViewModel ruleSet) { | ||
return ruleSet.getLocation(); | ||
} | ||
|
||
@Override | ||
public String getToolTipText(final Object element) { | ||
final RuleSetViewModel ruleSet = toRuleSet(element); | ||
if (ruleSet.isLocationValid()) { | ||
return ruleSet.getLocationToolTip(); | ||
} | ||
return getErrorMessage(ruleSet); | ||
} | ||
|
||
@Override | ||
public Image getToolTipImage(final Object element) { | ||
return getImage(toRuleSet(element)); | ||
} | ||
|
||
} |
53 changes: 53 additions & 0 deletions
53
ch.acanda.eclipse.pmd.core/src/ch/acanda/eclipse/pmd/properties/NameLabelProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// ===================================================================== | ||
// | ||
// Copyright (C) 2012 - 2015, Philip Graf | ||
// | ||
// All rights reserved. This program and the accompanying materials | ||
// are made available under the terms of the Eclipse Public License v1.0 | ||
// which accompanies this distribution, and is available at | ||
// http://www.eclipse.org/legal/epl-v10.html | ||
// | ||
// ===================================================================== | ||
|
||
package ch.acanda.eclipse.pmd.properties; | ||
|
||
import org.eclipse.swt.graphics.Image; | ||
|
||
import ch.acanda.eclipse.pmd.properties.PMDPropertyPageViewModel.RuleSetViewModel; | ||
|
||
/** | ||
* Provides the label, image and tool tip for the name column. | ||
* | ||
* @author Philip Graf | ||
*/ | ||
final class NameLabelProvider extends RuleSetConfigurationLabelProvider { | ||
|
||
protected NameLabelProvider(final PMDPropertyPageViewModel model) { | ||
super(model); | ||
} | ||
|
||
@Override | ||
protected String getText(final RuleSetViewModel ruleSet) { | ||
return ruleSet.getName(); | ||
} | ||
|
||
@Override | ||
public Image getImage(final Object element) { | ||
return getImage(toRuleSet(element)); | ||
} | ||
|
||
@Override | ||
public String getToolTipText(final Object element) { | ||
final RuleSetViewModel ruleSet = toRuleSet(element); | ||
if (!ruleSet.isLocationValid()) { | ||
return getErrorMessage(ruleSet); | ||
} | ||
return null; | ||
} | ||
|
||
@Override | ||
public Image getToolTipImage(final Object element) { | ||
return getImage(element); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.