Example usage for com.vaadin.server FontAwesome CROSSHAIRS

List of usage examples for com.vaadin.server FontAwesome CROSSHAIRS

Introduction

In this page you can find the example usage for com.vaadin.server FontAwesome CROSSHAIRS.

Prototype

FontAwesome CROSSHAIRS

To view the source code for com.vaadin.server FontAwesome CROSSHAIRS.

Click Source Link

Usage

From source file:com.hack23.cia.web.impl.ui.application.views.admin.agentoperations.pagemode.AgentOperationsOverviewPageModContentFactoryImpl.java

License:Apache License

@Secured({ "ROLE_ADMIN" })
@Override/*from  w  w w.  j  a v a2  s.c o m*/
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout content = createPanelContent();

    getMenuItemFactory().createMainPageMenuBar(menuBar);

    LabelFactory.createHeader2Label(content, ADMIN_AGENT_OPERATION);

    final ComboBox targetSelect = new ComboBox(TARGET, Arrays.asList(DataAgentTarget.values()));
    targetSelect.setId(ViewAction.START_AGENT_BUTTON + TARGET2);
    content.addComponent(targetSelect);
    content.setExpandRatio(targetSelect, ContentRatio.SMALL2);

    final ComboBox operationSelect = new ComboBox(OPERATION, Arrays.asList(DataAgentOperation.values()));
    operationSelect.setId(ViewAction.START_AGENT_BUTTON + OPERATION2);
    content.addComponent(operationSelect);
    content.setExpandRatio(operationSelect, ContentRatio.SMALL2);

    final Button startAgentButton = new Button(START,
            new StartAgentClickListener(targetSelect, operationSelect, agentContainer));
    startAgentButton.setId(ViewAction.START_AGENT_BUTTON.name());
    startAgentButton.setIcon(FontAwesome.CROSSHAIRS);
    content.addComponent(startAgentButton);
    content.setExpandRatio(startAgentButton, ContentRatio.SMALL3);

    content.setSizeFull();
    content.setMargin(false);
    content.setSpacing(true);

    content.setWidth(100, Unit.PERCENTAGE);
    content.setHeight(100, Unit.PERCENTAGE);

    return content;
}

From source file:io.github.jikuja.vaadin_yamapa.ui.views.PoiMap.java

License:Creative Commons License

private void setupLocationButton() {
    locate.addStyleName("locatebutton");
    locate.setIcon(FontAwesome.CROSSHAIRS);
    locate.addStyleName(ValoTheme.BUTTON_LARGE);
    locate.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    locate.setDescription("Locate me");
    locate.addClickListener(event -> {
        Notification.show("Attention", "No real geolocation support. Map center is used as coordinates",
                Notification.Type.HUMANIZED_MESSAGE);

        VaadinSession session = VaadinSession.getCurrent();
        session.setAttribute("lat", map.getCenter().getLat());
        session.setAttribute("lon", map.getCenter().getLon());
        MyUI.getInstance().getMenu().updateButtons();
    });/*from  ww w.j av a2 s . co m*/
}

From source file:io.github.jikuja.vaadin_yamapa.ui.views.PoiMap.java

License:Creative Commons License

private void setupCenterCrossHair() {
    Button helper = new Button();
    helper.addStyleName("helper");
    helper.setIcon(FontAwesome.CROSSHAIRS);
    helper.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    helper.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    addComponent(helper);/*from w ww  . j  ava  2 s. c om*/
}

From source file:org.jumpmind.vaadin.ui.sqlexplorer.DbTree.java

License:Open Source License

protected List<DbTreeNode> getTriggerTreeNodes(IDdlReader reader, DbTreeNode parent, String catalogName,
        String schemaName) {//from www.  j  a  v a 2  s  .c om
    List<DbTreeNode> list = new ArrayList<DbTreeNode>();
    List<Trigger> triggers = reader.getTriggers(catalogName, schemaName, parent.getName());
    for (Trigger trigger : triggers) {
        DbTreeNode treeNode = new DbTreeNode(this, trigger.getName(), NODE_TYPE_TRIGGER, FontAwesome.CROSSHAIRS,
                parent);
        if (catalogName != null) {
            treeNode.getProperties().setProperty(PROPERTY_CATALOG_NAME, catalogName);
        }
        if (schemaName != null) {
            treeNode.getProperties().setProperty(PROPERTY_SCHEMA_NAME, schemaName);
        }
        list.add(treeNode);
    }
    return list;
}

From source file:org.jumpmind.vaadin.ui.sqlexplorer.SqlExplorer.java

License:Open Source License

protected DbTree buildDbTree() {

    final DbTree tree = new DbTree(databaseProvider, settingsProvider);
    tree.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        @Override//  ww  w.  jav a2 s . co  m
        public void valueChange(ValueChangeEvent event) {
            Set<DbTreeNode> nodes = dbTree.getSelected();
            if (nodes != null) {
                for (DbTreeNode treeNode : nodes) {
                    IDb db = dbTree.getDbForNode(treeNode);
                    QueryPanel panel = getQueryPanelForDb(db);
                    if (panel == null && db != null) {
                        openQueryWindow(db);
                    }
                }

                String selectedTabCaption = null;
                for (IInfoPanel panel : infoTabs) {
                    selectedTabCaption = panel.getSelectedTabCaption();
                    contentTabs.removeComponent(panel);
                }
                infoTabs.clear();

                if (nodes.size() > 0) {
                    DbTreeNode treeNode = nodes.iterator().next();
                    if (treeNode != null && treeNode.getType().equals(DbTree.NODE_TYPE_DATABASE)) {
                        IDb db = dbTree.getDbForNode(treeNode);
                        DatabaseInfoPanel databaseInfoTab = new DatabaseInfoPanel(db, settingsProvider.get(),
                                selectedTabCaption);
                        Tab tab = contentTabs.addTab(databaseInfoTab, db.getName(), FontAwesome.DATABASE, 0);
                        tab.setClosable(true);
                        selectContentTab(databaseInfoTab);
                        infoTabs.add(databaseInfoTab);
                    }
                    if (treeNode != null && treeNode.getType().equals(DbTree.NODE_TYPE_TABLE)) {
                        Table table = treeNode.getTableFor();
                        if (table != null) {
                            IDb db = dbTree.getDbForNode(treeNode);
                            TableInfoPanel tableInfoTab = new TableInfoPanel(table, user, db,
                                    settingsProvider.get(), SqlExplorer.this, selectedTabCaption);
                            Tab tab = contentTabs.addTab(tableInfoTab, table.getFullyQualifiedTableName(),
                                    FontAwesome.TABLE, 0);
                            tab.setClosable(true);
                            selectContentTab(tableInfoTab);
                            infoTabs.add(tableInfoTab);
                        }
                    } else if (treeNode != null && treeNode.getType().equals(DbTree.NODE_TYPE_TRIGGER)) {
                        Table table = treeNode.getParent().getTableFor();
                        IDdlReader reader = dbTree.getDbForNode(treeNode).getPlatform().getDdlReader();
                        Trigger trigger = reader.getTriggerFor(table, treeNode.getName());
                        if (trigger != null) {
                            IDb db = dbTree.getDbForNode(treeNode);
                            TriggerInfoPanel triggerInfoTab = new TriggerInfoPanel(trigger, db,
                                    settingsProvider.get(), selectedTabCaption);
                            Tab tab = contentTabs.addTab(triggerInfoTab, trigger.getName(),
                                    FontAwesome.CROSSHAIRS, 0);
                            tab.setClosable(true);
                            selectContentTab(triggerInfoTab);
                            infoTabs.add(triggerInfoTab);
                        }
                    }
                }
            }
        }
    });
    tree.registerAction(new DbTreeAction("Query", QUERY_ICON) {
        private static final long serialVersionUID = 1L;

        @Override
        public void handle(Set<DbTreeNode> nodes) {
            openQueryWindow(nodes);
        }
    }, DbTree.NODE_TYPE_DATABASE, DbTree.NODE_TYPE_CATALOG, DbTree.NODE_TYPE_SCHEMA, DbTree.NODE_TYPE_TABLE);

    tree.registerAction(new DbTreeAction("Select", QUERY_ICON) {
        private static final long serialVersionUID = 1L;

        @Override
        public void handle(Set<DbTreeNode> nodes) {
            generateSelectForSelectedTables();
        }
    }, DbTree.NODE_TYPE_TABLE);

    tree.registerAction(new DbTreeAction("Insert", QUERY_ICON) {
        private static final long serialVersionUID = 1L;

        @Override
        public void handle(Set<DbTreeNode> nodes) {
            generateDmlForSelectedTables(DmlType.INSERT);
        }
    }, DbTree.NODE_TYPE_TABLE);

    tree.registerAction(new DbTreeAction("Update", QUERY_ICON) {
        private static final long serialVersionUID = 1L;

        @Override
        public void handle(Set<DbTreeNode> nodes) {
            generateDmlForSelectedTables(DmlType.UPDATE);
        }
    }, DbTree.NODE_TYPE_TABLE);

    tree.registerAction(new DbTreeAction("Delete", QUERY_ICON) {
        private static final long serialVersionUID = 1L;

        @Override
        public void handle(Set<DbTreeNode> nodes) {
            generateDmlForSelectedTables(DmlType.DELETE);
        }
    }, DbTree.NODE_TYPE_TABLE);

    tree.registerAction(new DbTreeAction("Drop", FontAwesome.ARROW_DOWN) {
        private static final long serialVersionUID = 1L;

        @Override
        public void handle(Set<DbTreeNode> nodes) {
            dropSelectedTables();
        }
    }, DbTree.NODE_TYPE_TABLE);

    tree.registerAction(new DbTreeAction("Import", FontAwesome.DOWNLOAD) {
        private static final long serialVersionUID = 1L;

        @Override
        public void handle(Set<DbTreeNode> nodes) {
            if (nodes.size() > 0) {
                IDb db = dbTree.getDbForNode(nodes.iterator().next());
                new DbImportDialog(db.getPlatform(), dbTree.getSelectedTables()).showAtSize(0.6);
            }
        }
    }, DbTree.NODE_TYPE_TABLE);

    tree.registerAction(new DbTreeAction("Export", FontAwesome.UPLOAD) {
        private static final long serialVersionUID = 1L;

        @Override
        public void handle(Set<DbTreeNode> nodes) {
            if (nodes.size() > 0) {
                IDb db = dbTree.getDbForNode(nodes.iterator().next());
                new DbExportDialog(db.getPlatform(), dbTree.getSelectedTables(), findQueryPanelForDb(db))
                        .showAtSize(0.6);
            }
        }
    }, DbTree.NODE_TYPE_TABLE, DbTree.NODE_TYPE_TRIGGER);

    tree.registerAction(new DbTreeAction("Fill", FontAwesome.BEER) {
        private static final long serialVersionUID = 1L;

        @Override
        public void handle(Set<DbTreeNode> nodes) {
            if (nodes.size() > 0) {
                IDb db = dbTree.getDbForNode(nodes.iterator().next());
                new DbFillDialog(db.getPlatform(), dbTree.getSelectedTables(), findQueryPanelForDb(db))
                        .showAtSize(0.6);
            }

        }
    }, DbTree.NODE_TYPE_TABLE);

    tree.registerAction(new DbTreeAction("Copy Name", FontAwesome.COPY) {
        private static final long serialVersionUID = 1L;

        @Override
        public void handle(Set<DbTreeNode> nodes) {

            for (DbTreeNode treeNode : nodes) {
                IDb db = dbTree.getDbForNode(nodes.iterator().next());
                DatabaseInfo dbInfo = db.getPlatform().getDatabaseInfo();
                final String quote = dbInfo.getDelimiterToken();
                final String catalogSeparator = dbInfo.getCatalogSeparator();
                final String schemaSeparator = dbInfo.getSchemaSeparator();

                Table table = treeNode.getTableFor();
                if (table != null) {
                    QueryPanel panel = findQueryPanelForDb(db);
                    panel.appendSql(table.getQualifiedTableName(quote, catalogSeparator, schemaSeparator));
                    contentTabs.setSelectedTab(panel);
                }
            }
        }
    }, DbTree.NODE_TYPE_TABLE);

    return tree;

}