Search in sources :

Example 6 with TabTitle

use of com.igormaznitsa.sciareto.ui.tabs.TabTitle in project netbeans-mmd-plugin by raydac.

the class MainFrame method menuNavigateMenuSelected.

// GEN-LAST:event_menuNavigateLinksGraphActionPerformed
private void menuNavigateMenuSelected(javax.swing.event.MenuEvent evt) {
    // GEN-FIRST:event_menuNavigateMenuSelected
    final TabTitle title = getFocusedTab();
    this.menuNavigateLinksGraph.setEnabled(title != null && title.getProvider().getEditor().getEditorContentType() == EditorContentType.MINDMAP);
}
Also used : TabTitle(com.igormaznitsa.sciareto.ui.tabs.TabTitle)

Example 7 with TabTitle

use of com.igormaznitsa.sciareto.ui.tabs.TabTitle in project netbeans-mmd-plugin by raydac.

the class MainFrame method centerRootTopicIfFocusedMMD.

// GEN-LAST:event_menuOpenFileActionPerformed
@Override
public boolean centerRootTopicIfFocusedMMD() {
    boolean result = false;
    final TabTitle title = this.getFocusedTab();
    if (title != null && title.getProvider().getEditor().getEditorContentType() == EditorContentType.MINDMAP) {
        SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {
                ((MMDEditor) title.getProvider().getEditor()).rootToCentre();
            }
        });
        result = true;
    }
    return result;
}
Also used : TabTitle(com.igormaznitsa.sciareto.ui.tabs.TabTitle)

Example 8 with TabTitle

use of com.igormaznitsa.sciareto.ui.tabs.TabTitle in project netbeans-mmd-plugin by raydac.

the class MainFrame method safeCloseEditorsForFile.

@Override
public boolean safeCloseEditorsForFile(@Nonnull final File file) {
    boolean changed = false;
    final List<TabTitle> list = new ArrayList<>();
    for (final TabTitle t : this.tabPane) {
        if (t.belongFolderOrSame(file)) {
            list.add(t);
            changed |= t.isChanged();
        }
    }
    if (changed && !DialogProviderManager.getInstance().getDialogProvider().msgConfirmOkCancel(null, "Confirmation", "Some changed file will be affected! To close them?")) {
        return false;
    }
    closeTab(list.toArray(new TabTitle[list.size()]));
    return true;
}
Also used : TabTitle(com.igormaznitsa.sciareto.ui.tabs.TabTitle)

Example 9 with TabTitle

use of com.igormaznitsa.sciareto.ui.tabs.TabTitle in project netbeans-mmd-plugin by raydac.

the class MainFrame method menuEditCopyActionPerformed.

// GEN-LAST:event_menuFileMenuDeselected
private void menuEditCopyActionPerformed(java.awt.event.ActionEvent evt) {
    // GEN-FIRST:event_menuEditCopyActionPerformed
    final TabTitle title = this.getFocusedTab();
    if (title != null && title.getProvider().doesSupportCutCopyPaste()) {
        title.getProvider().doCopy();
    }
    updateMenuItemsForProvider(title == null ? null : title.getProvider());
}
Also used : TabTitle(com.igormaznitsa.sciareto.ui.tabs.TabTitle)

Example 10 with TabTitle

use of com.igormaznitsa.sciareto.ui.tabs.TabTitle in project netbeans-mmd-plugin by raydac.

the class MainFrame method menuEditMenuSelected.

// GEN-LAST:event_menuFindTextActionPerformed
private void menuEditMenuSelected(javax.swing.event.MenuEvent evt) {
    // GEN-FIRST:event_menuEditMenuSelected
    final TabTitle title = this.getFocusedTab();
    updateMenuItemsForProvider(title == null ? null : title.getProvider());
    this.menuEditShowTreeContextMenu.setEnabled(this.explorerTree.hasSelectedItem());
}
Also used : TabTitle(com.igormaznitsa.sciareto.ui.tabs.TabTitle)

Aggregations

TabTitle (com.igormaznitsa.sciareto.ui.tabs.TabTitle)16 File (java.io.File)3 NodeProject (com.igormaznitsa.sciareto.ui.tree.NodeProject)2 ExtraFile (com.igormaznitsa.mindmap.model.ExtraFile)1 PreferencesPanel (com.igormaznitsa.sciareto.preferences.PreferencesPanel)1 FindFilesForTextPanel (com.igormaznitsa.sciareto.ui.FindFilesForTextPanel)1 FindUsagesPanel (com.igormaznitsa.sciareto.ui.FindUsagesPanel)1 NodeFileOrFolder (com.igormaznitsa.sciareto.ui.tree.NodeFileOrFolder)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 IOException (java.io.IOException)1 Path (java.nio.file.Path)1 ArrayList (java.util.ArrayList)1 Nonnull (javax.annotation.Nonnull)1 JMenu (javax.swing.JMenu)1 JMenuItem (javax.swing.JMenuItem)1 JPopupMenu (javax.swing.JPopupMenu)1 JSeparator (javax.swing.JSeparator)1