Package org.rssowl.ui.internal.OwlUI

Examples of org.rssowl.ui.internal.OwlUI.Layout


    }
  }

  private void updateLayout(boolean updateInput) {
    IPreferenceScope preferences = Owl.getPreferenceService().getEntityScope(fInput.getMark());
    Layout layout = OwlUI.getLayout(preferences);

    /* Return early if layout already up to date */
    if (fLayout == layout)
      return;

View Full Code Here


    /* Lookup current layout from actual UI to support toggling */
    boolean isNewspaperLayout = !isTableViewerVisible();
    boolean isClassicLayout = (fSashForm.getOrientation() & SWT.VERTICAL) != 0;

    /* Determine new layout based on existing */
    Layout newLayout = isNewspaperLayout ? (isClassicLayout ? Layout.CLASSIC : Layout.VERTICAL) : Layout.NEWSPAPER;

    /* Save only into Entity if the Entity was configured with the given Settings before */
    FeedViewInput input = ((FeedViewInput) getEditorInput());
    IPreferenceScope entityPreferences;
    if (input.getMark() instanceof FolderNewsMark)
      entityPreferences = Owl.getPreferenceService().getEntityScope(((FolderNewsMark) input.getMark()).getFolder());
    else
      entityPreferences = Owl.getPreferenceService().getEntityScope(input.getMark());

    if (entityPreferences.hasKey(DefaultPreferences.FV_LAYOUT)) {
      entityPreferences.putInteger(DefaultPreferences.FV_LAYOUT, newLayout.ordinal());
      entityPreferences.flush();

      /* Update Layout (on current feed view) */
      updateLayout();
    }

    /* Save Globally */
    else {
      fPreferences.putInteger(DefaultPreferences.FV_LAYOUT, newLayout.ordinal());

      /* Update Layout (on all opened feed views) */
      EditorUtils.updateLayout();
    }
  }
View Full Code Here

    if (fSite != null) {
      IPreferenceScope inputPreferences = fSite.getInputPreferences();
      fMarkReadOnExpand = inputPreferences.getBoolean(DefaultPreferences.MARK_READ_STATE);

      /* Update settings based on Layout */
      Layout layout = OwlUI.getLayout(inputPreferences);
      onLayoutChanged(layout);
    }

    /* Stop any other Website if required */
    String url = fBrowser.getControl().getUrl();
View Full Code Here

        OwlUI.positionDropDownMenu(this, fFilterGroupingLayoutToolBarManager);
      }

      @Override
      public ImageDescriptor getImageDescriptor() {
        Layout currentLayout = getLayout();
        switch (currentLayout) {
          case CLASSIC:
            return OwlUI.getImageDescriptor("icons/obj16/classic_layout.gif"); //$NON-NLS-1$
          case VERTICAL:
            return OwlUI.getImageDescriptor("icons/obj16/vertical_layout.gif"); //$NON-NLS-1$
          case LIST:
            return OwlUI.getImageDescriptor("icons/obj16/list_layout.gif"); //$NON-NLS-1$
          case NEWSPAPER:
            return OwlUI.getImageDescriptor("icons/obj16/newspaper_layout.gif"); //$NON-NLS-1$
          case HEADLINES:
            return OwlUI.getImageDescriptor("icons/obj16/headlines_layout.gif"); //$NON-NLS-1$
        }

        return OwlUI.getImageDescriptor("icons/obj16/classic_layout.gif"); //$NON-NLS-1$
      }

      @Override
      public String getText() {
        Layout currentLayout = getLayout();
        return currentLayout.getName();
      }
    };

    newsLayout.setId(LAYOUT_ACTION);
    newsLayout.setMenuCreator(new ContextMenuCreator() {

      @Override
      public Menu createMenu(Control parent) {
        Layout currentLayout = getLayout();
        Menu menu = new Menu(parent);

        Layout[] layouts = new Layout[] { Layout.CLASSIC, Layout.VERTICAL, Layout.LIST, Layout.NEWSPAPER, Layout.HEADLINES };
        for (final Layout layout : layouts) {
          final MenuItem layoutMenuItem = new MenuItem(menu, SWT.RADIO);
View Full Code Here

    /* Build Menu dynamically */
    viewMenu.addMenuListener(new IMenuListener() {
      public void menuAboutToShow(IMenuManager manager) {
        final FeedView activeFeedView = OwlUI.getActiveFeedView();
        final IPreferenceScope entityPreferences = OwlUI.getActiveFeedViewPreferences();
        final Layout layout = OwlUI.getLayout(entityPreferences != null ? entityPreferences : globalPreferences);
        final PageSize pageSize = OwlUI.getPageSize(entityPreferences != null ? entityPreferences : globalPreferences);

        manager.add(new GroupMarker(M_VIEW_START));

        /* Layout */
 
View Full Code Here

TOP

Related Classes of org.rssowl.ui.internal.OwlUI.Layout

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.