Exemplo n.º 1
0
 private JMenu createFileMenu() {
   ActionMap actionMap = context.getActionMap(this);
   final JMenu file = new JMenu("File");
   file.setMnemonic('f');
   file.add(actionMap.get("openProject"));
   final JMenu fileRecent = new JMenu("Recent Projects");
   fileRecent.setIcon(new ImageIcon("/resources/icons/open.png"));
   fileRecent.addMenuListener(new RecentProjectsMenuManager(application, projectService));
   file.add(fileRecent);
   file.addSeparator();
   final JMenu fileExport = new JMenu("Export To");
   fileExport.setIcon(new ImageIcon("/resources/icons/exportTo.png"));
   fileExport.add(application.getAction(ExportToHtml.COMMAND));
   fileExport.add(application.getAction(ExportToRecordBundle.COMMAND));
   file.add(fileExport);
   final JMenu fileImport = new JMenu("Import From");
   fileExport.setIcon(new ImageIcon("/resources/icons/import.png"));
   fileImport.add(application.getAction(ImportFromRecordBundle.COMMAND));
   file.add(fileImport);
   file.addSeparator();
   file.add(application.getAction(NewRvConnection.COMMAND));
   final JMenu connRecent = new JMenu("Recent Connections");
   connRecent.addMenuListener(new RecentConnectionsMenuManager(application));
   file.add(connRecent);
   return file;
 }
Exemplo n.º 2
0
 private JMenu createViewMenu(RecordLedgerTable table) {
   final JMenu view = new JMenu("View");
   view.setMnemonic('v');
   view.add(application.getAction(SelectAllRecords.COMMAND));
   view.add(application.getAction(ShowAllColumns.COMMAND));
   view.addSeparator();
   view.add(application.getAction(Filter.COMMAND));
   view.add(application.getAction(FilterBySelection.COMMAND));
   view.addSeparator();
   final JMenu viewColumns = new JMenu("Columns");
   viewColumns.setIcon(new ImageIcon("/resources/icons/filter_columns.png"));
   viewColumns.addMenuListener(new VisibleColumnsMenuManager(table.getTableFormat()));
   view.add(viewColumns);
   final JMenu viewTypes = new JMenu("Types");
   viewTypes.setIcon(new ImageIcon("/resources/icons/editRecordTypes.png"));
   viewTypes.addMenuListener(new RecordTypesMenuManager(application));
   view.add(viewTypes);
   return view;
 }
Exemplo n.º 3
0
 private JToolBar createToolBar() {
   ActionMap actionMap = context.getActionMap(this);
   final JToolBar toolbar = new JToolBar();
   toolbar.setFloatable(false);
   toolbar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY));
   toolbar.setRollover(true);
   toolbar.add(actionMap.get("openProject"));
   toolbar.addSeparator();
   toolbar.add(application.getAction(NewRvConnection.COMMAND));
   toolbar.addSeparator();
   toolbar.add(application.getAction(ClearLedger.COMMAND));
   toolbar.addSeparator();
   toolbar.add(application.getAction(PauseAllConnections.COMMAND));
   final Component[] components = toolbar.getComponents();
   for (int i = 0, imax = components.length; i < imax; ++i) {
     Component component = components[i];
     if (component instanceof AbstractButton) {
       ((AbstractButton) component).setBorderPainted(false);
       ((AbstractButton) component).setOpaque(false);
     }
   }
   return toolbar;
 }
Exemplo n.º 4
0
 private JMenu createEditMenu() {
   final JMenu edit = new JMenu("Edit");
   edit.setMnemonic('e');
   edit.add(application.getAction(Cut.COMMAND));
   edit.add(application.getAction(Copy.COMMAND));
   edit.add(application.getAction(Paste.COMMAND));
   edit.addSeparator();
   edit.add(application.getAction(Search.COMMAND));
   edit.add(application.getAction(SearchBySelection.COMMAND));
   edit.addSeparator();
   edit.add(application.getAction(Republish.COMMAND));
   edit.addSeparator();
   edit.add(application.getAction(PruneEmptySubjects.COMMAND));
   edit.addSeparator();
   edit.add(application.getAction(Delete.COMMAND));
   return edit;
 }