Package scratch.ide.popup

Examples of scratch.ide.popup.ScratchListPopup


  }

  public void displayScratchesListPopup(List<Scratch> scratches, final UserDataHolder userDataHolder) {
    ScratchListPopupStep popupStep = new ScratchListPopupStep(scratches, takeProjectFrom(userDataHolder));
    popupStep.setDefaultOptionIndex(scratchListSelectedIndex);
    ScratchListPopup popup = new ScratchListPopup(popupStep) {

      @Override protected void onNewScratch() {
        SwingUtilities.invokeLater(new Runnable() {
          @Override public void run() {
            mrScratchManager().userWantsToEnterNewScratchName(userDataHolder);
          }
        });
      }

      @Override protected void onRenameScratch(final Scratch scratch) {
        SwingUtilities.invokeLater(new Runnable() {
          @Override public void run() {
            mrScratchManager().userWantsToEditScratchName(scratch);
          }
        });
      }

      @Override protected void onScratchDelete(Scratch scratch) {
        mrScratchManager().userAttemptedToDeleteScratch(scratch);
      }

            @Override protected void onScratchDeleteWithoutPrompt(Scratch scratch) {
                mrScratchManager().userWantsToDeleteScratch(scratch);
            }

      @Override protected void onScratchMoved(Scratch scratch, int shift) {
        mrScratchManager().userMovedScratch(scratch, shift);
      }

      @Override public void dispose() {
        scratchListSelectedIndex = getSelectedIndex();
        super.dispose();
      }
    };
    popup.showCenteredInCurrentWindow(takeProjectFrom(userDataHolder));
  }
View Full Code Here

TOP

Related Classes of scratch.ide.popup.ScratchListPopup

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.