Example usage for com.vaadin.server FontAwesome UPLOAD

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

Introduction

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

Prototype

FontAwesome UPLOAD

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

Click Source Link

Usage

From source file:org.eclipse.hawkbit.ui.artifacts.UploadArtifactViewMenuItem.java

License:Open Source License

@Override
public Resource getDashboardIcon() {
    return FontAwesome.UPLOAD;
}

From source file:org.eclipse.hawkbit.ui.common.footer.AbstractDeleteActionsLayout.java

License:Open Source License

protected void updateUploadBtnIconToComplete() {
    if (bulkUploadStatusButton == null) {
        return;//from  w  w w  . j  a v a 2 s . c  o  m
    }
    bulkUploadStatusButton.removeStyleName(SPUIStyleDefinitions.UPLOAD_PROGRESS_INDICATOR_STYLE);
    bulkUploadStatusButton.setIcon(FontAwesome.UPLOAD);
}

From source file:org.eclipse.hawkbit.ui.common.table.AbstractTableHeader.java

License:Open Source License

private Button createBulkUploadIcon() {
    final Button button = SPUIComponentProvider.getButton(getBulkUploadIconId(), "",
            i18n.getMessage(UIMessageIdProvider.TOOLTIP_BULK_UPLOAD), null, false, FontAwesome.UPLOAD,
            SPUIButtonStyleNoBorder.class);
    button.addClickListener(this::bulkUpload);
    return button;
}

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

License:Open Source License

protected void populate(MenuBar menuBar) {
    executeAtCursorButton = menuBar.addItem("", FontAwesome.PLAY, new Command() {

        private static final long serialVersionUID = 1L;

        @Override//from w ww.  j  a v  a 2 s.c o  m
        public void menuSelected(MenuItem selectedItem) {
            queryPanel.execute(false);
        }
    });
    executeAtCursorButton.setDescription("Run sql under cursor (CTRL+ENTER)");

    executeScriptButton = menuBar.addItem("", FontAwesome.FORWARD, new Command() {

        private static final long serialVersionUID = 1L;

        @Override
        public void menuSelected(MenuItem selectedItem) {
            queryPanel.execute(true);
        }
    });
    executeScriptButton.setDescription("Run as script");

    commitButton = menuBar.addItem("", FontAwesome.ARROW_CIRCLE_O_RIGHT, new Command() {

        private static final long serialVersionUID = 1L;

        @Override
        public void menuSelected(MenuItem selectedItem) {
            queryPanel.commit();
        }
    });
    commitButton.setStyleName("green");
    commitButton.setDescription("Commit");
    commitButton.setEnabled(false);

    rollbackButton = menuBar.addItem("", FontAwesome.ARROW_CIRCLE_O_LEFT, new Command() {

        private static final long serialVersionUID = 1L;

        @Override
        public void menuSelected(MenuItem selectedItem) {
            queryPanel.rollback();
        }
    });
    rollbackButton.setStyleName("red");
    rollbackButton.setDescription("Rollback");
    rollbackButton.setEnabled(false);

    historyButton = menuBar.addItem("", FontAwesome.SEARCH, new Command() {

        private static final long serialVersionUID = 1L;

        @Override
        public void menuSelected(MenuItem selectedItem) {
            new SqlHistoryDialog(settingsProvider, queryPanel).showAtSize(0.6);
        }
    });
    historyButton.setDescription("Sql History");
    historyButton.setEnabled(true);

    MenuItem optionsButton = menuBar.addItem("", FontAwesome.TASKS, null);
    optionsButton.setDescription("Options");

    importButton = optionsButton.addItem("DB Import", FontAwesome.DOWNLOAD, new Command() {

        private static final long serialVersionUID = 1L;

        @Override
        public void menuSelected(MenuItem selectedItem) {
            new DbImportDialog(db.getPlatform()).showAtSize(0.6);
        }
    });

    exportButton = optionsButton.addItem("DB Export", FontAwesome.UPLOAD, new Command() {

        private static final long serialVersionUID = 1L;

        @Override
        public void menuSelected(MenuItem selectedItem) {
            new DbExportDialog(db.getPlatform(), queryPanel).showAtSize(0.6);
        }
    });

    fillButton = optionsButton.addItem("DB Fill", FontAwesome.BEER, new Command() {

        private static final long serialVersionUID = 1L;

        @Override
        public void menuSelected(MenuItem selectedItem) {
            new DbFillDialog(db.getPlatform(), queryPanel).showAtSize(0.6);
        }
    });

    for (IDbMenuItem item : additionalMenuItems) {
        optionsButton.addItem(item.getCaption(), item.getIcon(), item.getCommand());
    }
}

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//from w  w w.j  a  v  a  2  s  . c o  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;

}

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

License:Open Source License

private void createMenuBar() {
    HorizontalLayout resultBar = new HorizontalLayout();
    resultBar.setWidth(100, Unit.PERCENTAGE);
    resultBar.setMargin(new MarginInfo(false, true, false, true));

    HorizontalLayout leftBar = new HorizontalLayout();
    leftBar.setSpacing(true);/*from  ww w.  j ava2 s  .  c  o  m*/
    resultLabel = new Label("", ContentMode.HTML);
    leftBar.addComponent(resultLabel);

    final Label sqlLabel = new Label("", ContentMode.TEXT);
    sqlLabel.setWidth(800, Unit.PIXELS);
    leftBar.addComponent(sqlLabel);

    resultBar.addComponent(leftBar);
    resultBar.setComponentAlignment(leftBar, Alignment.MIDDLE_LEFT);
    resultBar.setExpandRatio(leftBar, 1);

    MenuBar rightBar = new MenuBar();
    rightBar.addStyleName(ValoTheme.MENUBAR_BORDERLESS);
    rightBar.addStyleName(ValoTheme.MENUBAR_SMALL);

    MenuBar.MenuItem refreshButton = rightBar.addItem("", new Command() {
        private static final long serialVersionUID = 1L;

        @Override
        public void menuSelected(MenuBar.MenuItem selectedItem) {
            listener.reExecute(sql);
        }
    });
    refreshButton.setIcon(FontAwesome.REFRESH);

    MenuBar.MenuItem exportButton = rightBar.addItem("", new Command() {
        private static final long serialVersionUID = 1L;

        @Override
        public void menuSelected(MenuBar.MenuItem selectedItem) {
            new ExportDialog(grid, db.getName(), sql).show();
        }
    });
    exportButton.setIcon(FontAwesome.UPLOAD);

    if (isInQueryGeneralResults) {
        MenuBar.MenuItem keepResultsButton = rightBar.addItem("", new Command() {
            private static final long serialVersionUID = 1L;

            @Override
            public void menuSelected(com.vaadin.ui.MenuBar.MenuItem selectedItem) {
                queryPanel.addResultsTab(refreshWithoutSaveButton(), StringUtils.abbreviate(sql, 20),
                        queryPanel.getGeneralResultsTab().getIcon());
                queryPanel.resetGeneralResultsTab();
            }
        });
        keepResultsButton.setIcon(FontAwesome.CLONE);
        keepResultsButton.setDescription("Save these results to a new tab");
    }

    if (showSql) {
        sqlLabel.setValue(StringUtils.abbreviate(sql, 200));
    }

    resultBar.addComponent(rightBar);
    resultBar.setComponentAlignment(rightBar, Alignment.MIDDLE_RIGHT);

    this.addComponent(resultBar, 0);
}