Commits

Kevin Poalses  committed e5efd7e

NEW: Added view persons tool command

  • Participants
  • Parent commits fde3680
  • Branches editing

Comments (0)

Files changed (8)

File build.gradle

 dependencies {
 
     // JavaFX2 - although in JRE libs, gradle doesn't find it - rather odd
-    javafxCompile files("${System.properties['java.home']}/lib/jfxrt.jar")
+//    javafxCompile files("${System.properties['java.home']}/lib/jfxrt.jar")
+    compile files("${System.properties['java.home']}/lib/jfxrt.jar")
 
     // Common
     compile group: 'net.poalsoft.common', name: 'poalsoft-common', version: '1.0.3-SNAPSHOT'
     compile group: 'com.beust', name: 'jcommander', version: '1.31-SNAPSHOT'
 }
 
-compileJava {
-    //add required JavaFX libs to compile classpath
-    sourceSets.main.compileClasspath += configurations.javafxCompile
-}
+//compileJava {
+//    //add required JavaFX libs to compile classpath
+//    sourceSets.main.compileClasspath += configurations.javafxCompile
+//}
+//
+//compileTestJava {
+//    //add required JavaFX libs to test compile classpath
+//    sourceSets.test.compileClasspath += configurations.javafxCompile
+//}
+//
+//test {
+//    //add required JavaFX libs to test runtime classpath
+//    classpath += configurations.javafxCompile
+//}
+//
 
-compileTestJava {
-    //add required JavaFX libs to test compile classpath
-    sourceSets.test.compileClasspath += configurations.javafxCompile
-}
-
-test {
-    //add required JavaFX libs to test runtime classpath
-    classpath += configurations.javafxCompile
-}
-
-javadoc {
-    //add required JavaFX libs to javadoc classpath
-    classpath += configurations.javafxCompile
-}
+//javadoc {
+//    //add required JavaFX libs to javadoc classpath
+//    classpath += configurations.javafxCompile
+//}
 
 // Build a JAR of our sources
 task sourcesJar(type: Jar, dependsOn: classes) {
 task dependenciesJar(type: Jar, dependsOn: classes) {
     classifier = 'dependencies'
     from {
-        configurations.runtime.findAll { !it.name.contains('jfxrt.jar') }.collect {
+        configurations.runtime.collect {
                     it.isDirectory() ? it : zipTree(it)
         }
     }

File src/main/java/net/poalsoft/dossier/contacts/tool/internal/ViewPersonsApplication.java

+/*
+ * Copyright (c) 2010-2013. Kevin Poalses <kevinp@poalsoft.net>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * 1) Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package net.poalsoft.dossier.contacts.tool.internal;
+
+import javafx.application.Application;
+import javafx.collections.ObservableList;
+import javafx.geometry.Insets;
+import javafx.scene.Group;
+import javafx.scene.Scene;
+import javafx.scene.control.Label;
+import javafx.scene.control.TableView;
+import javafx.scene.layout.VBox;
+import javafx.scene.text.Font;
+import javafx.stage.Stage;
+import net.poalsoft.dossier.contacts.ui.model.VisualPerson;
+import net.poalsoft.dossier.contacts.ui.view.VisualEntityTableViewBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.context.ApplicationContext;
+
+/**
+ * JavaFX view persons application.
+ *
+* @author Kevin Poalses
+*/
+public class ViewPersonsApplication extends Application {
+
+    public ViewPersonsApplication() {
+        super();
+    }
+
+    @Override
+    public void init() throws Exception {
+        super.init();
+        logger.debug("Finding persons...");
+        ViewPersonsModel viewPersonsModel = applicationContext.getBean(ViewPersonsModel.class);
+
+        ObservableList<VisualPerson> persons =
+        viewPersonsModel.getVisualPersons();
+
+        VisualEntityTableViewBuilder<VisualPerson> personTableViewBuilder =
+                applicationContext.getBean("visualPersonTableViewBuilder", VisualEntityTableViewBuilder.class);
+
+        this.tableView = personTableViewBuilder
+                        .withDefaultColumns()
+                        .withDefaultPreferredWidth()
+                        .withItems(persons)
+                        .build();
+    }
+
+    @Override
+    public void start(Stage stage) throws Exception {
+
+        Scene scene = new Scene(new Group());
+        stage.setTitle("Person View Sample");
+        stage.setWidth(850);
+        stage.setHeight(500);
+
+        final Label label = new Label("Persons");
+        label.setFont(new Font("Arial", 20));
+
+
+        final VBox vbox = new VBox();
+        vbox.setSpacing(5);
+        vbox.setPadding(new Insets(10, 0, 0, 10));
+        vbox.getChildren()
+            .addAll(label, tableView);
+
+        ((Group) scene.getRoot()).getChildren()
+                                 .addAll(vbox);
+
+        stage.setScene(scene);
+        stage.show();
+    }
+
+    public static void setApplicationContext(ApplicationContext applicationContext) {
+        ViewPersonsApplication.applicationContext = applicationContext;
+    }
+
+    private TableView<VisualPerson> tableView;
+
+    private static ApplicationContext applicationContext;
+    private static final Logger logger = LoggerFactory.getLogger(ViewPersonsApplication.class);
+}

File src/main/java/net/poalsoft/dossier/contacts/tool/internal/ViewPersonsImpl.java

+/*
+ * Copyright (c) 2010-2013. Kevin Poalses <kevinp@poalsoft.net>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * 1) Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package net.poalsoft.dossier.contacts.tool.internal;
+
+import com.beust.jcommander.Parameters;
+import net.poalsoft.dossier.contacts.persistence.PersonRepository;
+import net.poalsoft.dossier.contacts.tool.ToolCommand;
+import net.poalsoft.dossier.contacts.tool.ToolException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.Scope;
+import org.springframework.context.annotation.ScopedProxyMode;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * Dossier tool command to view known persons.
+ *
+ * @author Kevin Poalses
+ */
+@Component("viewPersonsToolCommand")
+@Scope(value = BeanDefinition.SCOPE_SINGLETON,
+       proxyMode = ScopedProxyMode.TARGET_CLASS)
+@Parameters(commandNames = {"viewPersons"}, commandDescription = "View person contacts")
+public class ViewPersonsImpl implements ToolCommand {
+
+    public ViewPersonsImpl() {
+        super();
+    }
+
+    @Override
+    @Transactional
+    public Integer call() {
+
+        try {
+
+            ViewPersonsApplication.setApplicationContext(this.applicationContext);
+            ViewPersonsApplication.launch(ViewPersonsApplication.class);
+
+            return 0;
+        } catch (ToolException e) {
+            throw e;
+        } catch (Exception e) {
+            logger.error("Failed to view persons", e);
+            return -1;
+        }
+    }
+
+    @Autowired
+    private ApplicationContext applicationContext;
+
+    private static final Logger logger = LoggerFactory.getLogger(ViewPersonsImpl.class);
+}

File src/main/java/net/poalsoft/dossier/contacts/tool/internal/ViewPersonsModel.java

+/*
+ * Copyright (c) 2010-2013. Kevin Poalses <kevinp@poalsoft.net>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * 1) Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package net.poalsoft.dossier.contacts.tool.internal;
+
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import net.poalsoft.dossier.contacts.base.Person;
+import net.poalsoft.dossier.contacts.persistence.PersonRepository;
+import net.poalsoft.dossier.contacts.ui.model.VisualEntityProxyBuilder;
+import net.poalsoft.dossier.contacts.ui.model.VisualPerson;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * View persons model.
+ *
+ * @author Kevin Poalses
+ */
+@Component("viewPersonsModel")
+@Scope(value = BeanDefinition.SCOPE_PROTOTYPE)
+public class ViewPersonsModel {
+
+    public ViewPersonsModel() {
+        super();
+    }
+
+    @Transactional
+    public ObservableList<VisualPerson> getVisualPersons() {
+
+        ObservableList<VisualPerson> persons = FXCollections.observableArrayList();
+
+        visualPersonProxyBuilder.withVisualType(VisualPerson.class);
+
+        for (Person person : this.personRepository.findAll()) {
+            logger.trace("Adding person [{}] to visual persons list",
+                         person.getDerivedDisplayName());
+            persons.add(visualPersonProxyBuilder
+                                .withWrappedEntity(person)
+                                .<VisualPerson>build());
+        }
+
+        return persons;
+    }
+
+    @Autowired
+    private VisualEntityProxyBuilder<VisualPerson, Person> visualPersonProxyBuilder;
+
+    @Autowired
+    private PersonRepository personRepository;
+    private static final Logger logger = LoggerFactory.getLogger(ViewPersonsModel.class);
+}

File src/main/java/net/poalsoft/dossier/contacts/ui/model/internal/VisualEntityProxyInvocationHandler.java

         }
 
         // Invoke method on wrapped entity instead
-        logger.trace("Invoking method [{}] on wrapped entity [{}]",
-                     method,
-                     this.wrappedEntity);
-
         return method.invoke(this.wrappedEntity, args);
     }
 

File src/main/java/net/poalsoft/dossier/contacts/ui/view/internal/VisualOrganizationTableViewBuilderImpl.java

+/*
+ * Copyright (c) 2010-2013. Kevin Poalses <kevinp@poalsoft.net>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * 1) Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package net.poalsoft.dossier.contacts.ui.view.internal;
+
+import javafx.scene.control.TableColumn;
+import javafx.scene.control.TableColumnBuilder;
+import javafx.scene.control.cell.PropertyValueFactoryBuilder;
+import net.poalsoft.dossier.contacts.ui.model.VisualOrganization;
+import net.poalsoft.dossier.contacts.ui.view.VisualEntityTableViewBuilder;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.concurrent.ThreadSafe;
+
+/**
+ * A builder for creating organization table views.
+ *
+ * @author Kevin Poalses
+ */
+@ThreadSafe
+@Component("visualOrganizationTableViewBuilder")
+@Scope(value = BeanDefinition.SCOPE_PROTOTYPE)
+public class VisualOrganizationTableViewBuilderImpl extends AbstractVisualContactTableViewBuilder<VisualOrganization> {
+
+    public VisualOrganizationTableViewBuilderImpl() {
+        super();
+    }
+
+    @Override
+    public VisualEntityTableViewBuilder<VisualOrganization> withDefaultColumns() {
+
+        super.withDefaultColumns();
+
+        TableColumn<VisualOrganization, String> nameCol =
+                TableColumnBuilder
+                        .<VisualOrganization, String>create()
+                        .text("Organization Name")
+                        .cellValueFactory(PropertyValueFactoryBuilder.<VisualOrganization, String>create()
+                                                                     .property("name")
+                                                                     .build())
+                        .build();
+        withDefaultTableColumn(nameCol);
+
+        return this;
+    }
+
+    @Override
+    public VisualEntityTableViewBuilder<VisualOrganization> withDefaultPreferredWidth() {
+        return withPreferredWidth(400);
+    }
+
+}

File src/main/java/net/poalsoft/dossier/contacts/ui/view/internal/VisualPersonTableViewBuilderImpl.java

 
         super.withDefaultColumns();
 
-        TableColumn<VisualPerson, String> displayNameCol =
-                TableColumnBuilder
-                        .<VisualPerson, String>create()
-                        .text("Display Name")
-                        .cellValueFactory(PropertyValueFactoryBuilder.<VisualPerson, String>create()
-                                                                     .property("derivedDisplayName")
-                                                                     .build())
-                        .build();
-        withDefaultTableColumn(displayNameCol);
-
         TableColumn<VisualPerson, String> firstNameCol =
                 TableColumnBuilder
                         .<VisualPerson, String>create()

File src/test/java/net/poalsoft/dossier/contacts/ui/demo/ShowOrganizations.java

+/*
+ * Copyright (c) 2010-2013. Kevin Poalses <kevinp@poalsoft.net>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * 1) Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package net.poalsoft.dossier.contacts.ui.demo;
+
+import javafx.application.Application;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.geometry.Insets;
+import javafx.scene.Group;
+import javafx.scene.Scene;
+import javafx.scene.control.Label;
+import javafx.scene.control.TableView;
+import javafx.scene.layout.VBox;
+import javafx.scene.text.Font;
+import javafx.stage.Stage;
+import net.poalsoft.dossier.contacts.base.ContactsBaseConfig;
+import net.poalsoft.dossier.contacts.base.Organization;
+import net.poalsoft.dossier.contacts.testing.TestContactsBuilder;
+import net.poalsoft.dossier.contacts.testing.TestContactsBuilderImpl;
+import net.poalsoft.dossier.contacts.ui.ContactsUiConfig;
+import net.poalsoft.dossier.contacts.ui.model.VisualEntityProxyBuilder;
+import net.poalsoft.dossier.contacts.ui.model.VisualOrganization;
+import net.poalsoft.dossier.contacts.ui.view.VisualEntityTableViewBuilder;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.AnnotationConfigApplicationContext;
+
+/**
+ * Simple demonstration of displaying persons.
+ *
+ * @author Kevin Poalses
+ */
+public class ShowOrganizations extends Application {
+
+    @SuppressWarnings("unchecked")
+    public ShowOrganizations() {
+        super();
+
+        System.setProperty("spring.profiles.active", "testing");
+        ApplicationContext applicationContext =
+                new AnnotationConfigApplicationContext(ContactsBaseConfig.class,
+                                                       ContactsUiConfig.class,
+                                                       TestContactsBuilderImpl.class);
+
+        TestContactsBuilder testContactsBuilder
+                = applicationContext.getBean(TestContactsBuilder.class);
+
+        VisualEntityProxyBuilder
+                visualEntityProxyBuilder = applicationContext.getBean(VisualEntityProxyBuilder.class);
+        visualEntityProxyBuilder.withVisualType(VisualOrganization.class);
+
+        ObservableList<VisualOrganization> persons = FXCollections.observableArrayList();
+        for (Organization organization : testContactsBuilder.buildTestOrganizations()) {
+            persons.add(
+                    (VisualOrganization)
+                            visualEntityProxyBuilder
+                                    .withWrappedEntity(organization)
+                                    .build());
+        }
+
+        VisualEntityTableViewBuilder<VisualOrganization> personTableViewBuilder =
+                applicationContext.getBean("visualOrganizationTableViewBuilder", VisualEntityTableViewBuilder.class);
+
+        tableView = personTableViewBuilder
+                        .withDefaultColumns()
+                        .withDefaultPreferredWidth()
+                        .withItems(persons)
+                        .build();
+
+        System.out
+              .println("Table view editable? " + tableView.isEditable());
+    }
+
+    public static void main(String[] args) {
+        launch(args);
+    }
+
+    @Override
+    public void start(Stage stage) throws Exception {
+
+
+        //noinspection unchecked
+
+        Scene scene = new Scene(new Group());
+        stage.setTitle("Organization View Sample");
+        stage.setWidth(500);
+        stage.setHeight(500);
+
+        final Label label = new Label("Organizations");
+        label.setFont(new Font("Arial", 20));
+
+
+        final VBox vbox = new VBox();
+        vbox.setSpacing(5);
+        vbox.setPadding(new Insets(10, 0, 0, 10));
+        vbox.getChildren()
+            .addAll(label, tableView);
+
+        ((Group) scene.getRoot()).getChildren()
+                                 .addAll(vbox);
+
+        stage.setScene(scene);
+        stage.show();
+    }
+
+    private final TableView<VisualOrganization> tableView;
+}