Exemplo n.º 1
0
  /** Construct a ToDo tab for the property panel. */
  public TabToDo() {
    super("tab.todo-item");
    setIcon(new LeftArrowIcon());

    String position = Configuration.getString(Configuration.makeKey("layout", "tabtodo"));
    setOrientation(
        ((position.equals("West") || position.equals("East"))
            ? Vertical.getInstance()
            : Horizontal.getInstance()));

    setLayout(new BorderLayout());

    Object[] actions = {actionNewToDoItem, actionResolve, actionSnooze};
    ToolBarFactory factory = new ToolBarFactory(actions);
    factory.setRollover(true);
    factory.setFloatable(false);
    factory.setOrientation(SwingConstants.VERTICAL);
    JToolBar toolBar = factory.createToolBar();
    toolBar.setName(getTitle());
    add(toolBar, BorderLayout.WEST);

    splitPane = new BorderSplitPane();
    add(splitPane, BorderLayout.CENTER);
    setTarget(null);

    addComponentListener(this);

    // TODO: Register listener for target ToDo item changes
    // and for new showStep() requests
  }
Exemplo n.º 2
0
 /** @param tdp the todo pane */
 public void setTree(ToDoPane tdp) {
   if (getOrientation().equals(Horizontal.getInstance())) {
     splitPane.add(tdp, BorderSplitPane.WEST);
   } else {
     splitPane.add(tdp, BorderSplitPane.NORTH);
   }
 }