Package org.pentaho.mantle.client.solutionbrowser.tabs

Examples of org.pentaho.mantle.client.solutionbrowser.tabs.IFrameTabPanel


      }
    }
  }

  private Frame getActiveBrowserPerspectiveFrame() {
    IFrameTabPanel panel = SolutionBrowserPanel.getInstance().getContentTabPanel().getCurrentFrame();
    if ( panel == null ) {
      return null;
    } else {
      return panel.getFrame();
    }
  }
View Full Code Here


    boolean printVisible = false;

    JavaScriptObject callback = null;

    if ( panel != null && panel instanceof IFrameTabPanel ) {
      IFrameTabPanel tbp = (IFrameTabPanel) panel;
      saveEnabled = tbp.isSaveEnabled();
      editIsEnabled = tbp.isEditEnabled();
      editSelected = tbp.isEditSelected();
      printVisible = tbp.isPrintVisible();
    }

    setSaveEnabled( saveEnabled );
    setSaveAsEnabled( saveEnabled );
    setContentEditEnabled( editIsEnabled );
View Full Code Here

          break;
        }
      }
    }

    IFrameTabPanel panel = null;
    if ( freeFrames.size() > 0 ) {
      panel = freeFrames.iterator().next();
      panel.setName( frameName );
      // mark as no longer free by removing from set
      freeFrames.remove( panel );
    } else {
      panel = new IFrameTabPanel( frameName );
    }

    addTab( tabName, tabTooltip, true, panel );
    selectTab( elementId );

    // plugins will define their background color, if any
    // all other content is expected, for backwards compatibility to
    // be set on a white background (default for web browsers)
    // I have defined a CSS class for this background if someone
    // wants to change or remove the color
    if ( url.indexOf( "/content" ) > -1 || url.indexOf( "/generatedContent" ) > -1 ) {
      panel.getElement().addClassName( "mantle-white-tab-background" ); // white background
    } else {
      panel.getElement().addClassName( "mantle-default-tab-background" ); // transparent background
    }

    final ArrayList<com.google.gwt.dom.client.Element> parentList = new ArrayList<com.google.gwt.dom.client.Element>();
    com.google.gwt.dom.client.Element parent = panel.getFrame().getElement();
    while ( parent != getElement() ) {
      parentList.add( parent );
      parent = parent.getParentElement();
    }
    Collections.reverse( parentList );
    for ( int i = 1; i < parentList.size(); i++ ) {
      parentList.get( i ).getStyle().setProperty( "height", "100%" ); //$NON-NLS-1$ //$NON-NLS-2$
    }

    Widget selectTabContent = null;
    if ( getTab( getSelectedTabIndex() ) != null ) {
      selectTabContent = getTab( getSelectedTabIndex() ).getContent();
    }
    List<FileItem> selectedItems = SolutionBrowserPanel.getInstance().getFilesListPanel().getSelectedFileItems();

    EventBusUtil.EVENT_BUS.fireEvent( new SolutionBrowserOpenEvent( selectTabContent, selectedItems ) );

    // if showContent is the thing that turns on our first tab, which is entirely possible, then we
    // would encounter the same timing issue as before
    panel.setUrl( url );

    EventBusUtil.EVENT_BUS.fireEvent( new SolutionBrowserSelectEvent( selectTabContent, selectedItems ) );

    if ( setFileInfoInFrame && SolutionBrowserPanel.getInstance().getFilesListPanel()
        .getSelectedFileItems().size() > 0 ) {
View Full Code Here

  public void hideLoadingIndicator() {
    WaitPopup.getInstance().setVisible( false );
  }

  public void setCurrentTabSaveEnabled( boolean enabled ) {
    IFrameTabPanel panel = getCurrentFrame();
    if ( panel != null ) {
      panel.setSaveEnabled( enabled );
      Widget selectTabContent = null;
      if ( getTab( getSelectedTabIndex() ) != null ) {
        selectTabContent = getTab( getSelectedTabIndex() ).getContent();
      }
      List<FileItem> selectedItems = SolutionBrowserPanel.getInstance().getFilesListPanel().getSelectedFileItems();
View Full Code Here

  /*
   * registerContentOverlay - register the overlay with the panel. Once the registration is done it fires a
   * soultion browser event passing the current tab index and the type of event
   */
  public void registerContentOverlay( String id ) {
    IFrameTabPanel panel = getCurrentFrame();
    if ( panel != null ) {
      panel.addOverlay( id );
      Widget selectTabContent = null;
      if ( getTab( getSelectedTabIndex() ) != null ) {
        selectTabContent = getTab( getSelectedTabIndex() ).getContent();
      }
      List<FileItem> selectedItems = SolutionBrowserPanel.getInstance().getFilesListPanel().getSelectedFileItems();
View Full Code Here

      EventBusUtil.EVENT_BUS.fireEvent( new SolutionBrowserOpenEvent( selectTabContent, selectedItems ) );
    }
  }

  public void enableContentEdit( boolean enable ) {
    IFrameTabPanel panel = getCurrentFrame();
    if ( panel != null ) {
      panel.setEditEnabled( enable );
      Widget selectTabContent = null;
      if ( getTab( getSelectedTabIndex() ) != null ) {
        selectTabContent = getTab( getSelectedTabIndex() ).getContent();
      }
      List<FileItem> selectedItems = SolutionBrowserPanel.getInstance().getFilesListPanel().getSelectedFileItems();
View Full Code Here

      EventBusUtil.EVENT_BUS.fireEvent( new SolutionBrowserUndefinedEvent( selectTabContent, selectedItems ) );
    }
  }

  public void setContentEditSelected( boolean selected ) {
    IFrameTabPanel panel = getCurrentFrame();
    if ( panel != null ) {
      panel.setEditSelected( selected );
      Widget selectTabContent = null;
      if ( getTab( getSelectedTabIndex() ) != null ) {
        selectTabContent = getTab( getSelectedTabIndex() ).getContent();
      }
      List<FileItem> selectedItems = SolutionBrowserPanel.getInstance().getFilesListPanel().getSelectedFileItems();
View Full Code Here

   * Store representation of file in the frame for reference later when save is called
   *
   * @param selectedFileItem
   */
  public void setFileInfoInFrame( FileItem selectedFileItem ) {
    IFrameTabPanel tp = getCurrentFrame();
    if ( tp != null && selectedFileItem != null ) {
      SolutionFileInfo fileInfo = new SolutionFileInfo();
      fileInfo.setName( selectedFileItem.getName() );
      fileInfo.setPath( selectedFileItem.getPath() );
      tp.setFileInfo( fileInfo );
    }
  }
View Full Code Here

    // can be cleaned up (maybe just wishful thinking)
    Widget w = closeTab.getContent();
    if ( w instanceof IFrameTabPanel && freeFrames.size() < 5 ) {
      // wipe out any file info so it doesn't impact future usages of this frame
      SolutionFileInfo sfi = null;
      IFrameTabPanel iFrameTabPanel = (IFrameTabPanel) w;
      iFrameTabPanel.setFileInfo( sfi );
      freeFrames.add( iFrameTabPanel );
    }

    if ( getTabCount() == 0 ) {
      allTabsClosed();
View Full Code Here

        closeTab( curpos, true );
      }
    }
    PentahoTab pt = getTab( curpos );
    if ( pt != null && pt.getContent() != null ) {
      IFrameTabPanel curPanel = (IFrameTabPanel) getTab( curpos ).getContent();
      if ( url.contains( curPanel.getUrl() ) ) {
        closeTab( curpos, true );
      }

      for ( int i = getTabCount() - 1; i >= 0; i-- ) {
        curPanel = (IFrameTabPanel) getTab( i ).getContent();

        if ( url.contains( curPanel.getUrl() ) ) {
          closeTab( i, true );
          break;
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.pentaho.mantle.client.solutionbrowser.tabs.IFrameTabPanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.