EclipseRCPで常駐アプリを作る方法

「EclipseRCPで常駐アプリを作る方法」の編集履歴(バックアップ)一覧に戻る

EclipseRCPで常駐アプリを作る方法 - (2009/05/14 (木) 14:00:53) の編集履歴(バックアップ)


public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
・・・
 public void preWindowOpen() {
  IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
  configurer.setInitialSize(new Point(10, 10));
  configurer.setShowCoolBar(false);
  configurer.setShowStatusLine(false);
  configurer.setShellStyle(SWT.NONE);
 }
 public void postWindowOpen() {
   super.postWindowOpen();
   window = getWindowConfigurer().getWindow();
   Shell shell = window.getShell();
   shell.setMinimized(true);
   shell.setVisible(false);
   initTrayItem();
 }
 private TrayItem initTaskItem() {
  Tray tray = window.getShell().getDisplay().getSystemTray();
  TrayItem trayItem = new TrayItem(tray, SWT.NONE);
  trayItem.setImage(image);
  trayItem.setToolTipText(toolTip);
  MenuManager trayMenu = new MenuManager();
  Menu menu = trayMenu.createContextMenu(shell);
  trayMenu.add(new Action() {
   {
    setText("設定");
   }
   public void run() {
   }
  }
  trayMenu.add(ActionFactory.QUIT.create(window));
  trayItem.addMenuDetectListener(new MenuDetectListener() {
   public void menuDetected(MenuDetectEvent e) {
    menu.setVisible(true);
   }
  });
}
ツールボックス

下から選んでください:

新しいページを作成する
ヘルプ / FAQ もご覧ください。