auxClassPath UI
This commit is contained in:
@ -23,6 +23,7 @@ import net.sourceforge.pmd.lang.LanguageVersion;
|
||||
import net.sourceforge.pmd.lang.ast.Node;
|
||||
import net.sourceforge.pmd.lang.symboltable.NameDeclaration;
|
||||
import net.sourceforge.pmd.lang.symboltable.NameOccurrence;
|
||||
import net.sourceforge.pmd.util.fxdesigner.util.AuxClassPathController;
|
||||
import net.sourceforge.pmd.util.fxdesigner.util.DesignerUtil;
|
||||
import net.sourceforge.pmd.util.fxdesigner.util.LimitedSizeStack;
|
||||
import net.sourceforge.pmd.util.fxdesigner.util.beans.SettingsOwner;
|
||||
@ -73,8 +74,11 @@ public class MainDesignerController implements Initializable, SettingsOwner {
|
||||
*/
|
||||
private final DesignerRoot designerRoot;
|
||||
|
||||
|
||||
/* Menu bar */
|
||||
@FXML
|
||||
private MenuItem pmdconfig;
|
||||
@FXML
|
||||
private MenuItem openFileMenuItem;
|
||||
@FXML
|
||||
private MenuItem licenseMenuItem;
|
||||
@ -111,6 +115,8 @@ public class MainDesignerController implements Initializable, SettingsOwner {
|
||||
private SourceEditorController sourceEditorController;
|
||||
@FXML
|
||||
private EventLogController eventLogPanelController;
|
||||
@FXML
|
||||
private AuxClassPathController auxClassPathController;
|
||||
|
||||
// Other fields
|
||||
private Stack<File> recentFiles = new LimitedSizeStack<>(5);
|
||||
@ -161,6 +167,16 @@ public class MainDesignerController implements Initializable, SettingsOwner {
|
||||
}
|
||||
});
|
||||
|
||||
pmdconfig.setOnAction(e -> {
|
||||
try {
|
||||
auxClassPathController.showAuxPathWizard();
|
||||
} catch (Exception e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
sourceEditorController.refreshAST();
|
||||
xpathPanelController.evaluateXPath(sourceEditorController.getCompilationUnit(),
|
||||
getLanguageVersion());
|
||||
|
@ -0,0 +1,83 @@
|
||||
/**
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
|
||||
|
||||
package net.sourceforge.pmd.util.fxdesigner.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import net.sourceforge.pmd.util.fxdesigner.DesignerRoot;
|
||||
import net.sourceforge.pmd.util.fxdesigner.MainDesignerController;
|
||||
import net.sourceforge.pmd.util.fxdesigner.util.beans.SettingsOwner;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.stage.FileChooser;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class AuxClassPathController implements Initializable, SettingsOwner {
|
||||
|
||||
private final DesignerRoot designerRoot;
|
||||
|
||||
@FXML
|
||||
private Button removeFiles;
|
||||
|
||||
@FXML
|
||||
private TableView fileTable;
|
||||
|
||||
@FXML
|
||||
private Button selectFile;
|
||||
|
||||
@FXML
|
||||
private TableColumn fileList;
|
||||
|
||||
@FXML
|
||||
private TableColumn fileAdd;
|
||||
|
||||
@FXML
|
||||
private final MainDesignerController parent;
|
||||
|
||||
|
||||
public AuxClassPathController(DesignerRoot designerRoot, MainDesignerController parent) {
|
||||
this.designerRoot = designerRoot;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void initialize(URL location, ResourceBundle resources) {
|
||||
|
||||
selectFile.setOnAction(e -> fileSeleced());
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void fileSeleced() {
|
||||
FileChooser chooser = new FileChooser();
|
||||
chooser.setTitle("Load source from file");
|
||||
File file = chooser.showOpenDialog(designerRoot.getMainStage());
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void showAuxPathWizard() throws Exception {
|
||||
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("fxml/aux-controller.fxml"));
|
||||
Parent root1 = (Parent) fxmlLoader.load();
|
||||
Stage stage = new Stage();
|
||||
stage.setScene(new Scene(root1));
|
||||
stage.show();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.TableColumn?>
|
||||
<?import javafx.scene.control.TableView?>
|
||||
<?import javafx.scene.control.TitledPane?>
|
||||
<?import javafx.scene.effect.Blend?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.BorderPane?>
|
||||
<?import javafx.scene.layout.Pane?>
|
||||
<AnchorPane prefHeight="444.0" prefWidth="594.0" xmlns="http://javafx.com/javafx/9.0.1"
|
||||
xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="net.sourceforge.pmd.util.fxdesigner.util.AuxClassPathController">
|
||||
<children>
|
||||
<BorderPane layoutX="14.0" layoutY="14.0" prefHeight="374.0" prefWidth="571.0">
|
||||
<top>
|
||||
<TitledPane animated="false" prefHeight="420.0" prefWidth="571.0" text="PMD Configure"
|
||||
textAlignment="CENTER" BorderPane.alignment="CENTER">
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="542.0" prefWidth="569.0">
|
||||
<children>
|
||||
<Pane layoutX="17.0" layoutY="95.0" prefHeight="260.0" prefWidth="536.0">
|
||||
<children>
|
||||
<TableView id="fileSelected" layoutX="34.0" layoutY="30.0" prefHeight="200.0"
|
||||
prefWidth="172.0">
|
||||
<columns>
|
||||
<TableColumn fx:id="fileList" prefWidth="171.0" text="Files Selected"/>
|
||||
</columns>
|
||||
</TableView>
|
||||
<TableView fx:id="fileTable" id="fileTable" layoutX="247.0" layoutY="30.0"
|
||||
prefHeight="200.0" prefWidth="200.0">
|
||||
<columns>
|
||||
<TableColumn fx:id="fileAdd" prefWidth="199.0"
|
||||
text="Files to be Added"/>
|
||||
</columns>
|
||||
</TableView>
|
||||
<Button fx:id="removeFiles" layoutX="463.0" layoutY="98.0"
|
||||
mnemonicParsing="false" text="Remove"/>
|
||||
</children>
|
||||
</Pane>
|
||||
<Label layoutX="47.0" layoutY="78.0" prefHeight="17.0" prefWidth="58.0"
|
||||
text="Classpath">
|
||||
<effect>
|
||||
<Blend/>
|
||||
</effect>
|
||||
</Label>
|
||||
<Button fx:id="selectFile" layoutX="39.0" layoutY="32.0" mnemonicParsing="false"
|
||||
text="Select Files"/>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
</TitledPane>
|
||||
</top>
|
||||
</BorderPane>
|
||||
</children>
|
||||
</AnchorPane>
|
@ -18,14 +18,16 @@
|
||||
<?import javafx.scene.layout.BorderPane?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.Pane?>
|
||||
|
||||
<AnchorPane prefHeight="750.0" prefWidth="1200.0" stylesheets="@../css/designer.css" xmlns="http://javafx.com/javafx/9" xmlns:fx="http://javafx.com/fxml/1" fx:controller="net.sourceforge.pmd.util.fxdesigner.MainDesignerController">
|
||||
<AnchorPane prefHeight="750.0" prefWidth="1200.0" stylesheets="@../css/designer.css"
|
||||
xmlns="http://javafx.com/javafx/8.0.121" xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="net.sourceforge.pmd.util.fxdesigner.MainDesignerController">
|
||||
<children>
|
||||
<BorderPane prefHeight="600.0" prefWidth="900.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<top>
|
||||
<AnchorPane>
|
||||
<children>
|
||||
<MenuBar maxHeight="20.0" prefHeight="20.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<MenuBar layoutX="-11.0" maxHeight="20.0" prefHeight="20.0" AnchorPane.bottomAnchor="0.0"
|
||||
AnchorPane.leftAnchor="-11.0" AnchorPane.rightAnchor="11.0" AnchorPane.topAnchor="0.0">
|
||||
<menus>
|
||||
<Menu fx:id="fileMenu" mnemonicParsing="false" text="File">
|
||||
<items>
|
||||
@ -42,6 +44,12 @@
|
||||
<MenuItem fx:id="licenseMenuItem" mnemonicParsing="false" text="License" />
|
||||
</items>
|
||||
</Menu>
|
||||
<Menu mnemonicParsing="false" text="PMD Configuration">
|
||||
<items>
|
||||
<MenuItem fx:id="pmdconfig" mnemonicParsing="false" text="AuxClassPath SetUp"/>
|
||||
</items>
|
||||
</Menu>
|
||||
|
||||
</menus>
|
||||
</MenuBar>
|
||||
</children>
|
||||
|
Reference in New Issue
Block a user