コード例 #1
0
  private void setup(final MultipleDocumentInterface mdi) {
    mdi.registerEntry(
        MultipleDocumentInterface.SIDEBAR_SECTION_BETAPROGRAM,
        new MdiEntryCreationListener() {
          public MdiEntry createMDiEntry(String id) {

            final ViewTitleInfoBetaP viewTitleInfo = new ViewTitleInfoBetaP();

            MdiEntry entry =
                mdi.createEntryFromSkinRef(
                    MultipleDocumentInterface.SIDEBAR_HEADER_VUZE,
                    MultipleDocumentInterface.SIDEBAR_SECTION_BETAPROGRAM,
                    "main.area.beta",
                    "{Sidebar.beta.title}",
                    viewTitleInfo,
                    null,
                    true,
                    MultipleDocumentInterface.SIDEBAR_POS_FIRST);

            entry.setImageLeftID("image.sidebar.beta");

            entry.addListener(
                new MdiCloseListener() {
                  public void mdiEntryClosed(MdiEntry entry, boolean userClosed) {
                    viewTitleInfo.clearIndicator();
                  }
                });

            return entry;
          }
        });

    mdi.registerEntry(
        MultipleDocumentInterface.SIDEBAR_SECTION_WELCOME,
        new MdiEntryCreationListener() {
          public MdiEntry createMDiEntry(String id) {
            MdiEntry entry =
                mdi.createEntryFromSkinRef(
                    MultipleDocumentInterface.SIDEBAR_HEADER_VUZE,
                    MultipleDocumentInterface.SIDEBAR_SECTION_WELCOME,
                    "main.area.welcome",
                    MessageText.getString("v3.MainWindow.menu.getting_started").replaceAll("&", ""),
                    null,
                    null,
                    true,
                    "");
            entry.setImageLeftID("image.sidebar.welcome");
            addDropTest(entry);
            return entry;
          }
        });

    SBC_ActivityTableView.setupSidebarEntry();

    ViewTitleInfoManager.addListener(
        new ViewTitleInfoListener() {
          public void viewTitleInfoRefresh(ViewTitleInfo titleInfo) {
            MdiEntry childrenArray[] = children.toArray(new MdiEntry[0]);
            for (MdiEntry entry : childrenArray) {
              if (entry.getViewTitleInfo() == titleInfo) {
                if (SB_Vuze.this.titleInfo != null) {
                  ViewTitleInfoManager.refreshTitleInfo(SB_Vuze.this.titleInfo);
                }
                break;
              }
            }
          }
        });

    mdi.addListener(
        new MdiEntryLoadedListener() {
          public void mdiEntryLoaded(MdiEntry entry) {
            if (MultipleDocumentInterface.SIDEBAR_HEADER_VUZE.equals(entry.getParentID())) {
              children.add(entry);
              entry.addListener(
                  new MdiChildCloseListener() {
                    public void mdiChildEntryClosed(MdiEntry parent, MdiEntry child, boolean user) {
                      children.remove(child);
                    }
                  });
            }
            if (!entry.getId().equals(MultipleDocumentInterface.SIDEBAR_HEADER_VUZE)) {
              return;
            }
            setupHeader(entry);
          }
        });
  }
コード例 #2
0
  private static void addFreeBurnUI() {
    final MultipleDocumentInterface mdi = UIFunctionsManager.getUIFunctions().getMDI();
    MdiEntry existingEntry = mdi.getEntry(MultipleDocumentInterface.SIDEBAR_HEADER_DVD);
    if (existingEntry != null) {
      // abandon all hope, something already added DVD stuff
      return;
    }
    mdi.registerEntry(
        MultipleDocumentInterface.SIDEBAR_SECTION_BURN_INFO,
        new MdiEntryCreationListener() {
          public MdiEntry createMDiEntry(String id) {

            MdiEntry entryAbout =
                mdi.createEntryFromSkinRef(
                    MultipleDocumentInterface.SIDEBAR_HEADER_DVD,
                    MultipleDocumentInterface.SIDEBAR_SECTION_BURN_INFO,
                    "main.burn.ftux",
                    MessageText.getString("mdi.entry.about.dvdburn"),
                    null,
                    null,
                    false,
                    null);
            entryAbout.setImageLeftID("image.sidebar.dvdburn");
            entryAbout.setExpanded(true);

            entryAbout.addListener(
                new MdiEntryDropListener() {
                  public boolean mdiEntryDrop(MdiEntry entry, Object droppedObject) {
                    openTrialAskWindow();
                    return true;
                  }
                });

            MenuManager menuManager =
                PluginInitializer.getDefaultInterface().getUIManager().getMenuManager();
            MenuItem menuHide =
                menuManager.addMenuItem(
                    "Sidebar." + MultipleDocumentInterface.SIDEBAR_SECTION_BURN_INFO,
                    "popup.error.hide");
            menuHide.addListener(
                new MenuItemListener() {
                  public void selected(MenuItem menu, Object target) {
                    mdi.closeEntry(MultipleDocumentInterface.SIDEBAR_SECTION_BURN_INFO);
                  }
                });

            return entryAbout;
          }
        });

    mdi.addListener(
        new MdiEntryLoadedListener() {
          public void mdiEntryLoaded(MdiEntry entry) {
            if (!entry.getId().equals(MultipleDocumentInterface.SIDEBAR_HEADER_DVD)) {
              return;
            }
            MdiEntryVitalityImage addSub = entry.addVitalityImage("image.sidebar.subs.add");
            addSub.addListener(
                new MdiEntryVitalityImageListener() {
                  public void mdiEntryVitalityImage_clicked(int x, int y) {
                    openTrialAskWindow();
                  }
                });
          }
        });

    mdi.registerEntry(
        MultipleDocumentInterface.SIDEBAR_SECTION_PLUS,
        new MdiEntryCreationListener() {
          public MdiEntry createMDiEntry(String id) {
            String title =
                MessageText.getString(
                    FeatureManagerUI.hasFullLicence()
                        ? "mdi.entry.plus.full"
                        : "mdi.entry.plus.free");
            String placeBelow =
                mdi.getEntry(MultipleDocumentInterface.SIDEBAR_SECTION_WELCOME) == null
                    ? ""
                    : MultipleDocumentInterface.SIDEBAR_SECTION_WELCOME;

            MdiEntry entry =
                mdi.createEntryFromSkinRef(
                    MultipleDocumentInterface.SIDEBAR_HEADER_VUZE,
                    MultipleDocumentInterface.SIDEBAR_SECTION_PLUS,
                    "main.area.plus",
                    title,
                    null,
                    null,
                    true,
                    placeBelow);
            entry.setImageLeftID("image.sidebar.plus");
            return entry;
          }
        });
    if (ConfigurationChecker.isNewVersion()
        && !ConfigurationChecker.isNewInstall()
        && !hasFullLicence()) {
      SBC_PlusFTUX.setSourceRef("startup");
      mdi.showEntryByID(MultipleDocumentInterface.SIDEBAR_SECTION_PLUS);
    }
  }