List of usage examples for com.vaadin.server FontAwesome BEER
FontAwesome BEER
To view the source code for com.vaadin.server FontAwesome BEER.
Click Source Link
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/* w w w.j a va 2s. 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 ww 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; }