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);
}
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;
}
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;
}
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());
}
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());
}
Aggregations