Example usage for org.apache.wicket.extensions.ajax.markup.html.modal ModalWindow setMaskType

List of usage examples for org.apache.wicket.extensions.ajax.markup.html.modal ModalWindow setMaskType

Introduction

In this page you can find the example usage for org.apache.wicket.extensions.ajax.markup.html.modal ModalWindow setMaskType.

Prototype

public ModalWindow setMaskType(final MaskType mask) 

Source Link

Document

Sets the mask type of the window.

Usage

From source file:com.doculibre.constellio.wicket.panels.admin.indexing.AdminIndexingPanel.java

License:Open Source License

private void configurePopUp(ModalWindow modal, final String textPopUp, String titlePopUp) {
    modal.add(new OpenWindowOnLoadBehavior());
    modal.setContent(new SimpleContentPanel(modal.getContentId(), textPopUp));
    modal.setTitle(titlePopUp);/*from  www . j a v  a2 s. c  om*/
    modal.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
    modal.setMaskType(ModalWindow.MaskType.TRANSPARENT);
    modal.setInitialWidth(200);
    modal.setWidthUnit("px");
    modal.setResizable(false);
    modal.setUseInitialHeight(false);
    modal.setCookieName("wicket-tips/styledModal");
    modal.setPageCreator(new ModalWindow.PageCreator() {
        @Override
        public Page createPage() {
            // TODO Auto-generated method stub
            return new PopUpPage(textPopUp);
        }
    });
}

From source file:org.alienlabs.hatchetharry.view.page.HomePage.java

License:Open Source License

private ModalWindow generateAboutLink(final String id, final ModalWindow window) {
    window.setInitialWidth(450);/*from w  w  w .  j av  a2 s  . co m*/
    window.setInitialHeight(700);
    window.setTitle("About HatchetHarry");
    window.setContent(new AboutModalWindow(window.getContentId(), window));
    window.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
    window.setMaskType(ModalWindow.MaskType.SEMI_TRANSPARENT);
    this.add(window);

    final AjaxLink<Void> aboutLink = new AjaxLink<Void>(id) {
        private static final long serialVersionUID = 8140325977385015896L;

        @Override
        public void onClick(final AjaxRequestTarget target) {
            target.prependJavaScript(BattlefieldService.HIDE_MENUS);
            target.appendJavaScript("Wicket.Window.unloadConfirmation = false;");
            window.show(target);
        }
    };

    aboutLink.setOutputMarkupId(true);
    window.setOutputMarkupId(true);
    this.add(aboutLink);
    return window;
}

From source file:org.alienlabs.hatchetharry.view.page.HomePage.java

License:Open Source License

private ModalWindow generateMulliganLink(final String id, final ModalWindow window) {
    window.setInitialWidth(500);/* w w  w .  j a v a2  s.c o m*/
    window.setInitialHeight(150);
    window.setTitle("HatchetHarry - Mulligan");
    window.setContent(new MulliganModalWindow(window, window.getContentId()));
    window.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
    window.setMaskType(ModalWindow.MaskType.SEMI_TRANSPARENT);
    this.add(window);

    final AjaxLink<Void> mulliganLink = new AjaxLink<Void>(id) {
        private static final long serialVersionUID = 8140325977385015896L;

        @Override
        public void onClick(final AjaxRequestTarget target) {
            target.prependJavaScript(BattlefieldService.HIDE_MENUS);
            target.appendJavaScript("Wicket.Window.unloadConfirmation = false;");
            window.show(target);
        }
    };

    mulliganLink.setOutputMarkupId(true);
    window.setOutputMarkupId(true);
    this.add(mulliganLink);
    return window;
}

From source file:org.alienlabs.hatchetharry.view.page.HomePage.java

License:Open Source License

private ModalWindow generateTeamInfoLink(final String id, final ModalWindow window) {
    window.setInitialWidth(475);//from  w  ww . j ava2  s . c  om
    window.setInitialHeight(750);
    window.setTitle("HatchetHarry Team info");
    window.setContent(new TeamInfoModalWindow(window.getContentId(), window));
    window.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
    window.setMaskType(ModalWindow.MaskType.SEMI_TRANSPARENT);
    this.add(window);

    final AjaxLink<Void> teamInfoLink = new AjaxLink<Void>(id) {
        private static final long serialVersionUID = 8140325977385015896L;

        @Override
        public void onClick(final AjaxRequestTarget target) {
            target.prependJavaScript(BattlefieldService.HIDE_MENUS);
            target.appendJavaScript("Wicket.Window.unloadConfirmation = false;");
            window.show(target);
        }
    };

    teamInfoLink.setOutputMarkupId(true);
    window.setOutputMarkupId(true);
    this.add(teamInfoLink);
    return window;
}

From source file:org.alienlabs.hatchetharry.view.page.HomePage.java

License:Open Source License

private ModalWindow generateCreateGameModalWindow(final String id, final Player _player,
        final ModalWindow window) {
    window.setInitialWidth(475);/*w  w w.j a va2s .co m*/
    window.setInitialHeight(550);
    window.setTitle("Create a match");

    window.setContent(new CreateGameModalWindow(window, window.getContentId(), _player, this));
    window.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
    window.setMaskType(ModalWindow.MaskType.SEMI_TRANSPARENT);

    this.createGameLink = new AjaxLink<Void>(id) {
        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(final AjaxRequestTarget _target) {
            _target.prependJavaScript(BattlefieldService.HIDE_MENUS);
            _target.appendJavaScript("Wicket.Window.unloadConfirmation = false;");
            window.show(_target);
        }
    };

    this.createGameLink.setOutputMarkupId(true).setMarkupId(id);
    this.createGameWindow.setOutputMarkupId(true);

    this.add(this.createGameLink);

    return window;
}

From source file:org.alienlabs.hatchetharry.view.page.HomePage.java

License:Open Source License

private ModalWindow generateJoinGameModalWindow(final String id, final Player _player,
        final ModalWindow window) {
    window.setInitialWidth(475);/* www . j  a va  2s.  c o  m*/
    window.setInitialHeight(430);
    window.setTitle("Join a match");

    window.setContent(
            new JoinGameModalWindow(window, window.getContentId(), _player, this.dataBoxParent, this));
    window.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
    window.setMaskType(ModalWindow.MaskType.SEMI_TRANSPARENT);

    this.joinGameLink = new AjaxLink<Void>(id) {
        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(final AjaxRequestTarget _target) {
            _target.prependJavaScript(BattlefieldService.HIDE_MENUS);
            _target.appendJavaScript("Wicket.Window.unloadConfirmation = false;");
            window.show(_target);
        }
    };

    this.joinGameLink.setOutputMarkupId(true).setMarkupId(id);
    window.setOutputMarkupId(true);

    this.add(this.joinGameLink);

    return window;
}

From source file:org.alienlabs.hatchetharry.view.page.HomePage.java

License:Open Source License

private ModalWindow generateJoinGameWithoutIdModalWindow(final String id, final Player _player,
        final ModalWindow window) {
    window.setInitialWidth(475);//from   w  w  w . j  a  v a  2 s  .c  o m
    window.setInitialHeight(500);
    window.setTitle("Join a match without ID");

    window.setContent(
            new JoinGameWithoutIdModalWindow(window, window.getContentId(), _player, this.dataBoxParent, this));
    window.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
    window.setMaskType(ModalWindow.MaskType.SEMI_TRANSPARENT);

    this.joinGameWithoutIdLink = new AjaxLink<Void>(id) {
        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(final AjaxRequestTarget _target) {
            _target.prependJavaScript(BattlefieldService.HIDE_MENUS);
            _target.appendJavaScript("Wicket.Window.unloadConfirmation = false;");
            window.show(_target);
        }
    };

    this.joinGameWithoutIdLink.setOutputMarkupId(true).setMarkupId(id);
    window.setOutputMarkupId(true);

    this.add(this.joinGameWithoutIdLink);

    return window;
}

From source file:org.alienlabs.hatchetharry.view.page.HomePage.java

License:Open Source License

private void generateRevealTopLibraryCardLink(final String id, final String idModalWindow) {
    final ModalWindow window = new ModalWindow(idModalWindow);
    window.setWindowClosedCallback(new WindowClosedCallback() {
        private static final long serialVersionUID = 1L;

        @Override/*from w  w w. j av  a 2s.c  o  m*/
        public void onClose(final AjaxRequestTarget target) {
            if (HomePage.this.session.getTopCardIndex() > 0L) {
                HomePage.this.session
                        .setTopCardIndex(Long.valueOf(HomePage.this.session.getTopCardIndex() - 1L));
            }

        }
    });
    window.setInitialWidth(500);
    window.setInitialHeight(510);

    final List<MagicCard> allCardsInLibrary = this.persistenceService.getAllCardsInLibraryForDeckAndPlayer(
            this.session.getGameId(), this.session.getPlayer().getId(),
            this.session.getPlayer().getDeck().getDeckId());
    final MagicCard firstCard;

    if (allCardsInLibrary.isEmpty()) {
        firstCard = null;
    } else {
        firstCard = allCardsInLibrary.get(this.session.getTopCardIndex().intValue());
    }

    window.setContent(new RevealTopLibraryCardModalWindow(window.getContentId(), window, firstCard));

    window.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
    window.setMaskType(ModalWindow.MaskType.SEMI_TRANSPARENT);
    window.setOutputMarkupId(true);

    this.revealTopLibraryCardWindow = window;
    this.add(this.revealTopLibraryCardWindow);

    final AjaxLink<Void> revealTopLibraryCardLink = new AjaxLink<Void>(id) {
        private static final long serialVersionUID = 1L;

        @SuppressWarnings("boxing")
        @SuppressFBWarnings({ "PATH_TRAVERSAL_IN", "PATH_TRAVERSAL_IN" })
        @Override
        public void onClick(final AjaxRequestTarget target) {
            final List<MagicCard> _allCardsInLibrary = HomePage.this.persistenceService
                    .getAllCardsInLibraryForDeckAndPlayer(HomePage.this.session.getGameId(),
                            HomePage.this.session.getPlayer().getId(),
                            HomePage.this.session.getPlayer().getDeck().getDeckId());
            if (_allCardsInLibrary.isEmpty()) {
                return;
            }

            final MagicCard _firstCard = _allCardsInLibrary
                    .get(HomePage.this.session.getTopCardIndex().intValue());
            final String topCardName = _firstCard.getBigImageFilename();

            final String cardPath = ResourceBundle.getBundle(HatchetHarryApplication.class.getCanonicalName())
                    .getString("SharedResourceFolder");
            final String cardPathAndName = cardPath.replace("/cards", "") + topCardName;
            final File from = new File(cardPathAndName);
            final File to = new File(cardPath + "topLibraryCard.jpg");

            try {
                Files.copy(from, to);
            } catch (final IOException e) {
                HomePage.LOGGER.error(
                        "could not copy from: " + cardPathAndName + " to: " + cardPath + "topLibraryCard.jpg",
                        e);
            }

            final Long _gameId = HomePage.this.persistenceService
                    .getPlayer(HomePage.this.session.getPlayer().getId()).getGame().getId();
            final RevealTopLibraryCardCometChannel chan = new RevealTopLibraryCardCometChannel(
                    HomePage.this.session.getPlayer().getName(), _firstCard,
                    HomePage.this.session.getTopCardIndex());
            final ConsoleLogStrategy logger = AbstractConsoleLogStrategy.chooseStrategy(
                    ConsoleLogType.REVEAL_TOP_CARD_OF_LIBRARY, null, null, null, _firstCard.getTitle(),
                    HomePage.this.session.getPlayer().getName(), null,
                    HomePage.this.session.getTopCardIndex() + 1L, null, Boolean.FALSE, _gameId);
            final List<BigInteger> allPlayersInGame = HomePage.this.persistenceService
                    .giveAllPlayersFromGame(_gameId);

            EventBusPostService.post(allPlayersInGame, chan, new ConsoleLogCometChannel(logger));
        }
    };

    revealTopLibraryCardLink.setOutputMarkupId(true).setMarkupId(id);
    this.add(revealTopLibraryCardLink);
}

From source file:org.alienlabs.hatchetharry.view.page.HomePage.java

License:Open Source License

private void generateCreateTokenLink(final String id, final ModalWindow window) {
    window.setInitialWidth(500);/*from w  ww  .  j a  v  a 2  s  .  c  o  m*/
    window.setInitialHeight(510);

    final CreateTokenModalWindow createTokenModalWindow = new CreateTokenModalWindow(window.getContentId(),
            window);
    window.setContent(createTokenModalWindow);
    window.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
    window.setMaskType(ModalWindow.MaskType.SEMI_TRANSPARENT);
    window.setTitle("Create a token");
    window.setOutputMarkupId(true);
    this.setCreateTokenModalWindow(window);
    this.add(window);

    final AjaxLink<Void> createTokenLink = new AjaxLink<Void>(id) {
        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(final AjaxRequestTarget target) {
            target.prependJavaScript(BattlefieldService.HIDE_MENUS);
            target.appendJavaScript("Wicket.Window.unloadConfirmation = false;");

            HomePage.this.createTokenWindow.show(target);
        }
    };

    createTokenLink.setOutputMarkupId(true).setMarkupId(id);
    this.add(createTokenLink);
}

From source file:org.alienlabs.hatchetharry.view.page.HomePage.java

License:Open Source License

private void generateCountCardsLink(final String id, final ModalWindow window) {
    window.setInitialWidth(740);//w  ww  .  j a v  a  2 s .c  o  m
    window.setInitialHeight(550);

    window.setContent(new CountCardsModalWindow(window.getContentId(), this.session.getGameId()));
    window.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
    window.setMaskType(ModalWindow.MaskType.SEMI_TRANSPARENT);
    window.setOutputMarkupId(true);
    this.add(window);

    final AjaxLink<Void> countCardsLink = new AjaxLink<Void>(id) {
        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(final AjaxRequestTarget target) {
            target.prependJavaScript(BattlefieldService.HIDE_MENUS);

            final Long _gameId = HomePage.this.session.getGameId();
            final CountCardsCometChannel cccc = new CountCardsCometChannel(_gameId,
                    HomePage.this.session.getPlayer().getName());

            final List<BigInteger> allPlayersInGame = HomePage.this.persistenceService
                    .giveAllPlayersFromGame(_gameId);
            EventBusPostService.post(allPlayersInGame, cccc);
        }
    };

    countCardsLink.setOutputMarkupId(true);
    this.add(countCardsLink);
}