Tabnine Logo
NSTabView
Code IndexAdd Tabnine to your IDE (free)

How to use
NSTabView
in
ch.cyberduck.binding.application

Best Java code snippets using ch.cyberduck.binding.application.NSTabView (Showing top 12 results out of 315)

origin: iterate-ch/cyberduck

public BrowserTab getSelectedTabView() {
  return BrowserTab.byPosition(browserTabView.indexOfTabViewItem(browserTabView.selectedTabViewItem()));
}
origin: iterate-ch/cyberduck

/**
 * Change the toolbar selection and display the tab index.
 *
 * @param selected The index of the tab to be selected
 */
protected void setSelectedPanel(final int selected) {
  int tab = selected;
  if(-1 == tab) {
    tab = 0;
  }
  String identifier = tabView.tabViewItemAtIndex(tab).identifier();
  if(!this.validateTabWithIdentifier(identifier)) {
    tab = 0;
    identifier = tabView.tabViewItemAtIndex(tab).identifier();
  }
  tabView.selectTabViewItemAtIndex(tab);
  NSTabViewItem page = tabView.selectedTabViewItem();
  if(page == null) {
    page = tabView.tabViewItemAtIndex(0);
  }
  toolbar.setSelectedItemIdentifier(page.identifier());
  this.initializePanel(identifier);
}
origin: iterate-ch/cyberduck

public void toolbarItemSelected(final NSToolbarItem sender) {
  this.setSelectedPanel(tabView.indexOfTabViewItemWithIdentifier(sender.itemIdentifier()));
}
origin: iterate-ch/cyberduck

public void setTabView(NSTabView view) {
  this.tabView = view;
  this.tabView.setAutoresizingMask(new NSUInteger(NSView.NSViewWidthSizable | NSView.NSViewHeightSizable));
  this.tabView.setDelegate(this.id());
}
origin: iterate-ch/cyberduck

@Override
public void awakeFromNib() {
  // Reset
  NSEnumerator items = this.tabView.tabViewItems().objectEnumerator();
  NSObject object;
  while(((object = items.nextObject()) != null)) {
    this.tabView.removeTabViewItem(Rococoa.cast(object, NSTabViewItem.class));
  }
  // Insert all panels into tab view
  for(Map.Entry<Label, NSView> tab : this.getPanels().entrySet()) {
    final NSTabViewItem item = NSTabViewItem.itemWithIdentifier(tab.getKey().identifier);
    item.setView(tab.getValue());
    item.setLabel(tab.getKey().label);
    this.tabView.addTabViewItem(item);
  }
  // Set up toolbar properties: Allow customization, give a default display mode, and remember state in user defaults
  toolbar.setAllowsUserCustomization(false);
  toolbar.setSizeMode(this.getToolbarSize());
  toolbar.setDisplayMode(this.getToolbarMode());
  toolbar.setDelegate(this.id());
  window.setToolbar(toolbar);
  // Change selection to last selected item in preferences
  final int index = preferences.getInteger(String.format("%s.selected", this.getToolbarName()));
  this.setSelectedPanel(index < this.getPanels().size() ? index : 0);
  this.setTitle(this.getTitle(tabView.selectedTabViewItem()));
  super.awakeFromNib();
}
origin: iterate-ch/cyberduck

public void setFiles(List<Path> files) {
  if(files.isEmpty()) {
    return;
  }
  this.files = files;
  this.initializePanel(this.getSelectedTab());
  this.setTitle(this.getTitle(tabView.selectedTabViewItem()));
}
origin: iterate-ch/cyberduck

private void selectBrowser(final BrowserSwitchSegement selected) {
  bookmarkSwitchView.setSelectedSegment(BookmarkSwitchSegement.browser.ordinal());
  this.setNavigation(this.isMounted());
  switch(selected) {
    case list:
      browserTabView.selectTabViewItemAtIndex(BrowserTab.list.ordinal());
      break;
    case outline:
      browserTabView.selectTabViewItemAtIndex(BrowserTab.outline.ordinal());
      break;
  }
  // Save selected browser view
  preferences.setProperty("browser.view", selected.ordinal());
  // Remove any custom file filter
  this.setFilter(null);
  // Update from model
  this.reload();
  // Focus on browser view
  this.getFocus();
}
origin: iterate-ch/cyberduck

@Override
public void tabView_didSelectTabViewItem(final NSTabView view, final NSTabViewItem item) {
  this.setTitle(this.getTitle(item));
  this.resize();
  preferences.setProperty(String.format("%s.selected", this.getToolbarName()), view.indexOfTabViewItem(item));
}
origin: iterate-ch/cyberduck

@Override
public NSToolbarItem toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar(final NSToolbar toolbar,
                                       final String itemIdentifier,
                                       final boolean flag) {
  if(!cache.containsKey(itemIdentifier)) {
    cache.put(itemIdentifier, NSToolbarItem.itemWithIdentifier(itemIdentifier));
  }
  final NSToolbarItem toolbarItem = cache.get(itemIdentifier);
  final NSTabViewItem tab = tabView.tabViewItemAtIndex(tabView.indexOfTabViewItemWithIdentifier(itemIdentifier));
  if(null == tab) {
    log.warn(String.format("No tab for toolbar item %s", itemIdentifier));
    return null;
  }
  toolbarItem.setLabel(tab.label());
  toolbarItem.setPaletteLabel(tab.label());
  toolbarItem.setToolTip(tab.label());
  toolbarItem.setImage(IconCacheFactory.<NSImage>get().iconNamed(String.format("%s.tiff", itemIdentifier), 32));
  toolbarItem.setTarget(this.id());
  toolbarItem.setAction(Foundation.selector("toolbarItemSelected:"));
  return toolbarItem;
}
origin: iterate-ch/cyberduck

@Override
public void invalidate() {
  toolbar.setDelegate(null);
  tabView.setDelegate(null);
  super.invalidate();
}
origin: iterate-ch/cyberduck

  /**
   * @return Minimum size to fit content view of currently selected tab.
   */
  private NSRect getContentRect() {
    NSRect contentRect = new NSRect(0, 0);
    final NSView view = tabView.selectedTabViewItem().view();
    final NSEnumerator enumerator = view.subviews().objectEnumerator();
    NSObject next;
    while(null != (next = enumerator.nextObject())) {
      final NSView subview = Rococoa.cast(next, NSView.class);
      contentRect = FoundationKitFunctionsLibrary.NSUnionRect(contentRect, subview.frame());
    }
    return contentRect;
  }
}
origin: iterate-ch/cyberduck

this.setNavigation(false);
browserTabView.selectTabViewItemAtIndex(BrowserTab.bookmarks.ordinal());
final AbstractHostCollection source;
switch(selected) {
ch.cyberduck.binding.applicationNSTabView

Most used methods

  • indexOfTabViewItem
    Original signature : NSInteger indexOfTabViewItem(NSTabViewItem*) NSNotFound if not found native dec
  • selectTabViewItemAtIndex
    Original signature : void selectTabViewItemAtIndex(NSInteger) May raise an NSRangeException native d
  • selectedTabViewItem
    Original signature : NSTabViewItem* selectedTabViewItem() return nil if none are selected native dec
  • addTabViewItem
    Original signature : void addTabViewItem(NSTabViewItem*) Add tab at the end. native declaration : :1
  • indexOfTabViewItemWithIdentifier
    Original signature : NSInteger indexOfTabViewItemWithIdentifier(id) NSNotFound if not found native d
  • removeTabViewItem
    Original signature : void removeTabViewItem(NSTabViewItem*) tabViewItem must be an existing tabViewI
  • setAutoresizingMask
  • setDelegate
    Original signature : void setDelegate(id) native declaration : :115
  • tabViewItemAtIndex
    Original signature : NSTabViewItem* tabViewItemAtIndex(NSInteger) May raise an NSRangeException nati
  • tabViewItems
    Original signature : NSArray* tabViewItems() native declaration : :91

Popular in Java

  • Running tasks concurrently on multiple threads
  • runOnUiThread (Activity)
  • putExtra (Intent)
  • notifyDataSetChanged (ArrayAdapter)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now