/* * Copyright (C) 2013 Serdar * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package de.fub.maps.project.detector.wizards.detector; import de.fub.maps.project.detector.model.pipeline.postprocessors.tasks.Task; import de.fub.maps.project.detector.model.process.DetectorProcess; import de.fub.utilsmodule.Collections.ObservableList; import java.util.Collection; import javax.swing.JPanel; import org.openide.util.Lookup; import org.openide.util.NbBundle; @NbBundle.Messages({ "CLT_Postprocessor_Panel_Name=Postprocessors", "CLT_All_Available_Postprocessors=All Postprocessor Tasks", "CLT_Selected_Postprocessors=Selected Postprocessor Tasks" }) public final class PostprocessorSelectionVisualPanel extends JPanel { private static final long serialVersionUID = 1L; /** * Creates new form PostprocessorSelectionVisualPanel */ public PostprocessorSelectionVisualPanel() { initComponents(); init(); } private void init() { selectionComponent1.getAllItemListTitle().setText(Bundle.CLT_All_Available_Postprocessors()); selectionComponent1.getSelectedItemListTitle().setText(Bundle.CLT_Selected_Postprocessors()); Collection<? extends Task> allInstances = Lookup.getDefault().lookupResult(Task.class).allInstances(); getAllTasks().addAll(allInstances); } public ObservableList<DetectorProcess> getAllTasks() { return selectionComponent1.getAllItems(); } public ObservableList<DetectorProcess> getSelectedTasks() { return selectionComponent1.getSelectedItems(); } @Override public String getName() { return Bundle.CLT_Postprocessor_Panel_Name(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { selectionComponent1 = new de.fub.maps.project.detector.ui.SelectionComponent(); setLayout(new java.awt.BorderLayout()); add(selectionComponent1, java.awt.BorderLayout.CENTER); }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables private de.fub.maps.project.detector.ui.SelectionComponent selectionComponent1; // End of variables declaration//GEN-END:variables }