示例#1
0
文件: Editor.java 项目: TouK/soapuii
  public void release() {
    for (EditorView<T> view : views) {
      view.release();
      view.removePropertyChangeListener(this);
    }

    views.clear();

    inputTabs.removeChangeListener(inputTabsChangeListener);
    inputTabs.removeAll();

    inspectorPanel.release();
    document.release();
  }
示例#2
0
文件: Editor.java 项目: TouK/soapuii
  public Editor(T document) {
    super(new BorderLayout());
    this.document = document;

    setBackground(Color.LIGHT_GRAY);
    inputTabs = new JTabbedPane(JTabbedPane.LEFT, JTabbedPane.SCROLL_TAB_LAYOUT);
    inputTabs.setUI(new VerticalTabbedPaneUI());

    inputTabs.setFont(inputTabs.getFont().deriveFont(8));
    inputTabsChangeListener = new InputTabsChangeListener();
    inputTabs.addChangeListener(inputTabsChangeListener);

    inspectorPanel = JInspectorPanelFactory.build(inputTabs);
    add(inspectorPanel.getComponent(), BorderLayout.CENTER);
  }
示例#3
0
文件: Editor.java 项目: TouK/soapuii
 public void selectView(String viewId) {
   for (int c = 0; c < views.size(); c++) {
     if (views.get(c).getViewId().equals(viewId)) {
       inputTabs.setSelectedIndex(c);
       return;
     }
   }
 }
示例#4
0
文件: Editor.java 项目: TouK/soapuii
  public void propertyChange(PropertyChangeEvent evt) {
    if (evt.getPropertyName().equals(EditorView.TITLE_PROPERTY)) {
      int ix = views.indexOf(evt.getSource());
      if (ix == -1) return;

      inputTabs.setTitleAt(ix, (String) evt.getNewValue());
    }
  }
示例#5
0
文件: Editor.java 项目: TouK/soapuii
  public void addEditorView(EditorView<T> editorView) {
    views.add(editorView);

    inputTabs.addTab(
        null,
        new VTextIcon(inputTabs, editorView.getTitle(), VTextIcon.ROTATE_LEFT),
        editorView.getComponent());

    editorView.addPropertyChangeListener(this);
    editorView.addLocationListener(this);

    editorView.setDocument(document);
  }
示例#6
0
文件: Editor.java 项目: TouK/soapuii
 public void selectView(int viewIndex) {
   inputTabs.setSelectedIndex(viewIndex);
 }