Search in sources :

Example 1 with AntJavaCompiler

use of com.kyj.fx.voeditor.visual.framework.jdt.compiler.AntJavaCompiler in project Gargoyle by callakrsos.

the class AntRunConfigView method initialize.

@FXML
public void initialize() {
    c = new AntJavaCompiler(this.buildFile.getParentFile(), this.buildFile) {

        @Override
        protected BuildListener getBuildListener() {
            return progressListener;
        }
    };
    c.parse();
    this.txtBuildFileLocation.setText(this.buildFile.getAbsolutePath());
    this.txtProjectName.setText(c.getProjectName());
    //		tcTargetName.setCellFactory(value);
    tcChkTarget.setCellFactory(CheckBoxTableCell.forTableColumn(tcChkTarget));
    tcChkTarget.setCellValueFactory(param -> param.getValue().chkProperty());
    tcTargetName.setCellFactory(TextFieldTableCell.forTableColumn());
    tcTargetName.setCellValueFactory(param -> param.getValue().targetNameProperty());
    tcTargetDesc.setCellFactory(TextFieldTableCell.forTableColumn());
    tcTargetDesc.setCellValueFactory(param -> param.getValue().targetDescProperty());
    List<AntRunConfigItem> collect = c.getTargets().entrySet().stream().map(ent -> {
        String key = ent.getKey();
        if (ValueUtil.isEmpty(key))
            return null;
        String desc = ent.getValue().getDescription() == null ? "" : ent.getValue().getDescription();
        AntRunConfigItem item = new AntRunConfigItem(key, desc);
        item.chkProperty().addListener(new ChangeListenerImpl(item));
        boolean equals = key.equals(c.getDefaultTarget());
        item.setChk(equals);
        if (equals)
            item.setTargetDesc("[default]  ".concat(desc));
        return item;
    }).filter(v -> v != null).collect(Collectors.toList());
    tbTargets.getItems().addAll(collect);
    tbTargets.setEditable(true);
    tcChkTarget.setEditable(true);
    tcTargetName.setEditable(false);
    tcTargetDesc.setEditable(false);
//		Platform.runLater(()->{
//
//		});
}
Also used : Button(javafx.scene.control.Button) TextArea(javafx.scene.control.TextArea) LoggerFactory(org.slf4j.LoggerFactory) AntJavaCompiler(com.kyj.fx.voeditor.visual.framework.jdt.compiler.AntJavaCompiler) FXCollections(javafx.collections.FXCollections) TextFieldTableCell(javafx.scene.control.cell.TextFieldTableCell) TableColumn(javafx.scene.control.TableColumn) HashSet(java.util.HashSet) Task(javafx.concurrent.Task) TabPane(javafx.scene.control.TabPane) FileUtil(com.kyj.fx.voeditor.visual.util.FileUtil) TableView(javafx.scene.control.TableView) OutputStream(java.io.OutputStream) ObservableSet(javafx.collections.ObservableSet) TextField(javafx.scene.control.TextField) Logger(org.slf4j.Logger) BuildListener(org.apache.tools.ant.BuildListener) BuildEvent(org.apache.tools.ant.BuildEvent) ByteArrayOutputStream(org.apache.commons.io.output.ByteArrayOutputStream) FXMLController(com.kyj.fx.voeditor.visual.framework.annotation.FXMLController) IOException(java.io.IOException) ValueUtil(com.kyj.fx.voeditor.visual.util.ValueUtil) Collectors(java.util.stream.Collectors) File(java.io.File) FxPostInitialize(com.kyj.fx.voeditor.visual.framework.annotation.FxPostInitialize) Platform(javafx.application.Platform) FXML(javafx.fxml.FXML) FxUtil(com.kyj.fx.voeditor.visual.util.FxUtil) List(java.util.List) SystemConsole(com.kyj.fx.voeditor.visual.component.console.SystemConsole) Stage(javafx.stage.Stage) Tab(javafx.scene.control.Tab) CheckBoxTableCell(javafx.scene.control.cell.CheckBoxTableCell) ObservableValue(javafx.beans.value.ObservableValue) AntRunConfigItem(com.kyj.fx.voeditor.visual.component.config.model.AntRunConfigItem) BorderPane(javafx.scene.layout.BorderPane) ChangeListener(javafx.beans.value.ChangeListener) InputStream(java.io.InputStream) AntJavaCompiler(com.kyj.fx.voeditor.visual.framework.jdt.compiler.AntJavaCompiler) BuildListener(org.apache.tools.ant.BuildListener) AntRunConfigItem(com.kyj.fx.voeditor.visual.component.config.model.AntRunConfigItem) FXML(javafx.fxml.FXML)

Aggregations

AntRunConfigItem (com.kyj.fx.voeditor.visual.component.config.model.AntRunConfigItem)1 SystemConsole (com.kyj.fx.voeditor.visual.component.console.SystemConsole)1 FXMLController (com.kyj.fx.voeditor.visual.framework.annotation.FXMLController)1 FxPostInitialize (com.kyj.fx.voeditor.visual.framework.annotation.FxPostInitialize)1 AntJavaCompiler (com.kyj.fx.voeditor.visual.framework.jdt.compiler.AntJavaCompiler)1 FileUtil (com.kyj.fx.voeditor.visual.util.FileUtil)1 FxUtil (com.kyj.fx.voeditor.visual.util.FxUtil)1 ValueUtil (com.kyj.fx.voeditor.visual.util.ValueUtil)1 File (java.io.File)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 OutputStream (java.io.OutputStream)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Platform (javafx.application.Platform)1 ChangeListener (javafx.beans.value.ChangeListener)1 ObservableValue (javafx.beans.value.ObservableValue)1 FXCollections (javafx.collections.FXCollections)1 ObservableSet (javafx.collections.ObservableSet)1