nu.zoom.swing.desktop.Workbench类的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(12.5k)|赞(0)|评价(0)|浏览(94)

本文整理了Java中nu.zoom.swing.desktop.Workbench类的一些代码示例,展示了Workbench类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Workbench类的具体详情如下:
包路径:nu.zoom.swing.desktop.Workbench
类名称:Workbench

Workbench介绍

暂无

代码示例

代码示例来源:origin: nu.zoom.svansprogram/svansprogram-gui

@Override
public void initialize() throws Exception {
  // Plug in initialization
  workbench.addWorkBenchListener(this);
}

代码示例来源:origin: nu.zoom/filechooser

public File openFile() {
  log.trace("Creating file open dialog");
  JFileChooser chooser = getChooser();
  chooser.showOpenDialog(workbench.getDialogOwner());
  File file = chooser.getSelectedFile();
  saveLastDirectory(file);
  return file;
}

代码示例来源:origin: nu.zoom.svansprogram/svansprogram-error

@Override
public void reportError(String message, Exception e) {
  workbench.getErrorReporter().reportError(message, e);
}

代码示例来源:origin: nu.zoom/svansprogram

@Override
public void start() {
  workbench.setTitle("Svansprogram \u00a9 2006 Johan Maasing");
  workbench.setIcon(Svansprogram.getTailIcon());
}

代码示例来源:origin: nu.zoom/svansprogram

private void run() {
  log.trace("Starting application");
  // Splashscreen
  JFrame splashFrame = new JFrame("Svansprogram");
  splashFrame.setUndecorated(true);
  URL splashURL = this.getClass().getResource("/images/splash.png");
  ImageIcon splashImageIcon = new ImageIcon(splashURL);
  splashImageIcon = new ImageIcon(splashURL);
  splashFrame.getContentPane().add(new JLabel(splashImageIcon));
  splashFrame.pack();
  Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
  splashFrame.setLocation(screenSize.width / 2 - splashFrame.getWidth()
      / 2, screenSize.height / 2 - splashFrame.getHeight() / 2);
  log.trace("Showing splash screen");
  splashFrame.setVisible(true);
  log.trace("Building Gaderian registry");
  Registry registry = RegistryBuilder.constructDefaultRegistry();
  workbench = (Workbench) registry.getService(
      "nu.zoom.swing.desktop.Workbench", Workbench.class);
  workbench.addWorkBenchListener(this);
  log.trace("Starting workbench");
  workbench.start();
  splashFrame.dispose();
}

代码示例来源:origin: nu.zoom/svansprogram

@Override
public void start() {
  final ShowStyleRulesAction showStyleRulesAction = new ShowStyleRulesAction(messages,
      "nu.zoom.catonine.configurations");
  final WorkbenchMenuBar menuBar = workbench.getMenuBar();
  menuBar.addToApplicationMenu(showStyleRulesAction.getControl());
  try {
    menuBar.addToApplicationMenu(new JMenuItem(new SaveStyleRulesManagerAsAction(this, localizedResources)));
    menuBar.addToApplicationMenu(new JMenuItem(new OpenStyleRulesManagerAction(this, localizedResources)));
    menuBar.addToApplicationMenu(new JMenuItem(new ImportStyleRulesManagerAction(this, localizedResources)));
  } catch (LocalizedResources.ResourceNotFoundException resourceNotFoundException) {
    workbench.getErrorReporter().reportError(resourceNotFoundException);
  }
  workbench.addCloseVetoListener(this);
  workbench.registerKeyboardAction(
      showStyleRulesAction,
      KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_DOWN_MASK),
      JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
  try {
    if (!loadManager()) {
      manager = new StyleRulesManager();
      manager.add(SampleStyleRulesFactory.getLog4JStyleRules());
      manager.add(SampleStyleRulesFactory.getSyslogStyleRules());
    }
  } catch (InvalidDataTypeException invalidDataTypeException) {
    workbench.getErrorReporter().reportError(invalidDataTypeException);
  } catch (BackendException backendException) {
    workbench.getErrorReporter().reportError(backendException);
  }
}

代码示例来源:origin: nu.zoom/svansprogram

fileOpener);
  WorkbenchMenuBar menuBar = workbench.getMenuBar();
  menuBar.addToApplicationMenu(new JMenuItem(openAction));
  String recentFilesName = messages.getMessage("nu.zoom.catonine.recent");
  menuBar.addToApplicationMenu(recentJMenu);
  workbench.registerKeyboardAction(
      openAction,
      KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_DOWN_MASK),
} catch (ResourceNotFoundException ex) {
  log.error(ex);
  workbench.getErrorReporter().reportError(ex);

代码示例来源:origin: nu.zoom/portunis

error = false;
int retval = chooser.showOpenDialog(plugin.getWorkbench()
    .getDialogOwner());
      String message = messages
          .getMessage("keystore.load.unknown");
      workbench.getErrorReporter().reportError(message, exc);
      error = true;
    } catch (NoSuchAlgorithmException exc) {
      String message = messages
          .getMessage("keystore.load.unknown");
      workbench.getErrorReporter().reportError(message, exc);
      error = true;
    } catch (CertificateException exc) {
      String message = messages
          .getMessage("keystore.load.unknown");
      workbench.getErrorReporter().reportError(message, exc);
      error = true;
    } catch (FileNotFoundException exc) {
      String message = messages
          .getMessage("keystore.load.unknown");
      workbench.getErrorReporter().reportError(message, exc);
      error = true;
    } catch (IOException exc) {
      String message = messages
          .getMessage("keystore.load.unknown");
      workbench.getErrorReporter().reportError(message, exc);
      error = true;

代码示例来源:origin: nu.zoom/eon2

@Override
  protected WorkbenchFrame createFrame() {
    WorkbenchFrame frame = workbench.createWorkbenchFrame(
        "findadservers",
        new FindServersPanel(messages, operationManager, workbench, resolver),
        enabled,
        enabled);
    frame.setTitle(messages.getMessage("connection.dns.menu"));
    return frame;
  }
}

代码示例来源:origin: nu.zoom/svansprogram

log.trace("Creating workbench frame");
  final String prefskey = "Svansprogram.file." + file.getName();
  WorkbenchFrame frame = workbench.createWorkbenchFrame(
      prefskey, pane, true, true);
  frame.addFrameListener(new TailerStopper(pane));
    pane.setPreferredConfiguration(configurationUUID);
  workbench.setStatusbarMessage(localizedResources.format(
      "nu.zoom.catonine.opened", file.getAbsolutePath()));
} catch (Exception e1) {
  log.error("Unable to create tail pane", e1);
  String message = localizedResources.getMessage("nu.zoom.catonine.open.fail");
  workbench.getErrorReporter().reportError(message, e1);

代码示例来源:origin: nu.zoom/eon2

public void actionPerformed(ActionEvent e) {
  ConnectionEditor editor = connectionFactory.getEditor();
  if (editor == null) {
    workbench.getErrorReporter().reportError(
        messages.getMessage("connection.error.noeditor"));
  } else {
    JComponent editorComponent = editor.editConnection(connection);
    if (editorComponent == null) {
      workbench.getErrorReporter().reportError(
          messages.getMessage("connection.error.noeditor"));
    } else {
      WorkbenchFrame frame = workbench.createWorkbenchFrame(this
          .getClass().getName(), editorComponent, true, true);
      frame.setTitle(messages.getMessage("connection.edit.title"));
      frame.setVisible(true);
    }
  }
}

代码示例来源:origin: nu.zoom/eon2

/**
   * Do not call this method directly. This method is called by the operation
   * manager.
   *
   * @see nu.zoom.ldap.eon.operation.OperationManager#runOperation(Operation)
   *
   */
  public void execute() {
    try {
      workbench.startWorkIndicator();
      workbench.setStatusbarMessage(messages.format(
          "connection.connecting", connection.getDescription()));
      final InitialLdapContext iCtx = connection.getConnection();
      if (iCtx != null) {
        EventQueue.invokeLater(new Runnable() {

          public void run() {
            workbench.stopWorkIndicator();
            componentFactory.showNewConnection(iCtx, connection);

          }
        });
      }
    } catch (BackendException e) {
      workbench.stopWorkIndicator();
      workbench.getErrorReporter().reportError(
          messages.format("connection.connect.error", connection.getDescription()), e);
    }
  }
}

代码示例来源:origin: nu.zoom.svansprogram/svansprogram-gui

errorReporter, preferences);
  WorkbenchMenuBar menuBar = workbench.getMenuBar();
  menuBar.addToApplicationMenu(new JMenuItem(openAction));
  StringMenu<File> recentMenu = menuFactory.getMenu(File.class, RECENT_FILES_MENU_KEY);
  menuBar.addToApplicationMenu(recentJMenu);
  workbench.registerKeyboardAction(openAction,
      KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_DOWN_MASK),
      JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
  workbench.getStatusbar().addComponent(Box.createHorizontalGlue());
  memStatComponent =
      new MemStatComponent(messages.getMessage("nu.zoom.catonine.memstat.free"),
          messages.getMessage("nu.zoom.catonine.memstat.max"));
  memStatComponent.setAlignmentX(Component.RIGHT_ALIGNMENT);
  workbench.getStatusbar().addComponent(memStatComponent);
} catch (ResourceNotFoundException ex) {
  log.error(ex);

代码示例来源:origin: nu.zoom/eon2

@Override
public void start() {
  if (connectionsMenu == null) {
    connectionsMenu = new JMenu(messages.getMessage("connection.menu"));
    connectionsMenu.add(new FindServersMenuItem(messages, workbench, operationManager, resolver));
    if (connectionFactories.size() > 0) {
      for (ConnectionFactory factory : connectionFactories) {
        ConnectionMenuChangeHandler menuHandler = new ConnectionMenuChangeHandler(
            workbench, messages, componentFactory,
            operationManager, factory);
        connectionsMenu.add(menuHandler.getMenu());
      }
    }
  }
  workbench.getMenuBar().addMenu("connectionsmenu", connectionsMenu);
}

代码示例来源:origin: nu.zoom/eon2

public void actionPerformed(ActionEvent e) {
  try {
    connectionFactory.removeConnection(connection);
    workbench.setStatusbarMessage(messages.format("connection.deleted",
        connection.getDescription()));
  } catch (BackendException exc) {
    workbench.getErrorReporter().reportError(
        messages.format("connection.error.backend", exc
            .getLocalizedMessage()));
  }
}

代码示例来源:origin: nu.zoom/eon2

@Override
protected WorkbenchFrame createFrame() {
  workbench.setStatusbarMessage(messages.getMessage("about.copyright"));
  VerticalPanel copyPanel = new VerticalPanel();
  copyPanel.addRow(new JLabel(messages.getMessage("about.copyright")));
  WorkbenchFrame frame = workbench.createWorkbenchFrame(this.getClass().getName(), mainPanel, true, true);
  frame.setTitle(messages.getMessage("about.menuitem"));
  frame.setFrameIcon(MessagesUtil.getIconFromMessages(messages,

代码示例来源:origin: nu.zoom.svansprogram/svansprogram-gui-rules

showStyleRulesAction = new ShowStyleRulesAction(
    messages.getMessage("nu.zoom.catonine.configurations"));
final WorkbenchMenuBar menuBar = workbench.getMenuBar();
menuBar.addToApplicationMenu(showStyleRulesAction.getControl());
menuBar.addToApplicationMenu(new JMenuItem(
    new ImportStyleRulesManagerAction(this, messages,
        errorReporter)));
workbench.registerKeyboardAction(showStyleRulesAction, KeyStroke
    .getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_DOWN_MASK),
    JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);

代码示例来源:origin: nu.zoom.svansprogram/svansprogram-gui

case Detached:
  log.debug("Preferences say to force frame to detach");
  frame = workbench.createWorkbenchFrame(prefskey, pane, null,
      true, true, true);
  break;
case Attached:
  log.debug("Preferences say to force frame to attach");
  frame = workbench.createWorkbenchFrame(prefskey, pane, null,
      true, true, false);
  break;
default:
  log.debug("Preferences say to use remembered/default attach/detach mode");
  frame = workbench.createWorkbenchFrame(prefskey, pane, null,
      true, true);
  break;
workbench.getStatusbar().setMessage(
    messages.format("nu.zoom.catonine.opened",
        file.getAbsolutePath()));

代码示例来源:origin: nu.zoom/portunis

private void run() {
  // Splashscreen
  JFrame splashFrame = new JFrame("Portunis");
  splashFrame.setUndecorated(true);
  URL splashURL = getClass().getResource(
      "/nu/zoom/swing/desktop/plugin/keystore/resources/splash.png");
  ImageIcon splashImageIcon = new ImageIcon(splashURL);
  splashImageIcon = new ImageIcon(splashURL);
  splashFrame.getContentPane().add(new JLabel(splashImageIcon));
  splashFrame.pack();
  Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
  splashFrame.setLocation(screenSize.width / 2 - splashFrame.getWidth()
      / 2, screenSize.height / 2 - splashFrame.getHeight() / 2);
  splashFrame.setVisible(true);
  Registry registry = RegistryBuilder.constructDefaultRegistry();
  workbench = (Workbench) registry.getService(
      "nu.zoom.swing.desktop.Workbench", Workbench.class);
  workbench.addWorkBenchListener(this);
  workbench.start();
  splashFrame.dispose();
}

代码示例来源:origin: nu.zoom/portunis

chooser.setToolTipText(messages.getMessage("keystore.import.cert.tooltip"));
chooser.setDialogTitle(messages.getMessage("keystore.import.cert"));
int option = chooser.showOpenDialog(workbench.getDialogOwner());
if (option == JFileChooser.APPROVE_OPTION) {
  File certFile = chooser.getSelectedFile();
      ImportCertificateDialog confirmDlg = new ImportCertificateDialog(
          workbench, messages, cert, store);
      Point location = workbench.getDialogOwner().getLocation() ;
      location.x += 16 ;
      location.y += 16 ;
      confirmDlg.setLocation(location);
      confirmDlg.pack();
      if (confirmDlg.getHeight() > workbench.getDialogOwner().getHeight()) {
        confirmDlg.setSize(
            confirmDlg.getWidth(),
            workbench.getDialogOwner().getHeight()-16);
      workbench.getErrorReporter().reportError(
          messages.getMessage("keystore.import.cert.error"),
          exc);
    } catch (CertificateException exc) {
      workbench.getErrorReporter().reportError(
          messages.getMessage("keystore.import.cert.error"),
          exc);
    } catch (FileNotFoundException exc) {
      workbench.getErrorReporter().reportError(
          messages.getMessage("keystore.import.cert.error"),

相关文章