Cleaned up PMD - LogWindow interaction

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@1672 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Tom Copeland
2003-04-01 17:11:30 +00:00
parent 4f15353d24
commit a74b1957b2
2 changed files with 7 additions and 4 deletions

View File

@ -55,6 +55,7 @@ public class Plugin implements Addin, Controller, ContextMenuListener {
Ide.getEditorManager().getContextMenu().addContextMenuListener(this, null);
IdeSettings.registerUI(new Navigable(TITLE, SettingsPanel.class, new Navigable[] {}));
Ide.getVersionInfo().addComponent(TITLE, " JDeveloper Extension " + getVersion());
rvPage = new RuleViolationPage();
}
public void shutdown() {
@ -120,16 +121,14 @@ public class Plugin implements Addin, Controller, ContextMenuListener {
* TODO investigate CompilerPage as a replacement for RuleViolationPage; or could perhaps subclass it instead.
*/
private void render(RuleContext ctx) {
if (rvPage == null) {
rvPage = new RuleViolationPage();
}
if (!rvPage.isVisible()) {
rvPage.show();
}
rvPage.clearAll();
if (ctx.getReport().isEmpty()) {
JOptionPane.showMessageDialog(null, "No problems found", TITLE, JOptionPane.INFORMATION_MESSAGE);
rvPage.close();
rvPage.movePMDToBack();
} else {
for (Iterator i = ctx.getReport().iterator(); i.hasNext();) {
rvPage.add((RuleViolation)i.next());

View File

@ -32,6 +32,10 @@ public class RuleViolationPage extends AbstractLogPage {
return scrollPane;
}
public void movePMDToBack() {
Ide.getLogManager().getLogWindow().getPage().show();
}
public void clearAll() {
model.clear();
}