Example usage for com.google.gwt.user.client Window open

List of usage examples for com.google.gwt.user.client Window open

Introduction

In this page you can find the example usage for com.google.gwt.user.client Window open.

Prototype

public static void open(String url, String name, String features) 

Source Link

Usage

From source file:org.eclipse.kapua.app.console.client.device.DevicesTable.java

License:Open Source License

private void export(String format) {
    StringBuilder sbUrl = new StringBuilder();
    if (UserAgentUtils.isSafari() || UserAgentUtils.isChrome()) {
        sbUrl.append("console/exporter_device?");
    } else {// w w w .  j av a  2 s  . c om
        sbUrl.append("exporter_device?");
    }

    sbUrl.append("format=").append(format).append("&account=")
            .append(URL.encodeQueryString(m_currentSession.getSelectedAccount().getName()));

    //
    // Adding filtering parameter if specified
    Long tag = m_filterPredicates.getTag();
    if (tag != null) {
        sbUrl.append("&tag=").append(tag);
    }

    String clientId = m_filterPredicates.getClientId();
    if (clientId != null && !clientId.isEmpty()) {
        sbUrl.append("&clientId=").append(clientId);
    }

    String displayName = m_filterPredicates.getDisplayName();
    if (displayName != null && !displayName.isEmpty()) {
        sbUrl.append("&displayName=").append(displayName);
    }

    String serialNumber = m_filterPredicates.getSerialNumber();
    if (serialNumber != null && !serialNumber.isEmpty()) {
        sbUrl.append("&serialNumber=").append(serialNumber);
    }

    String deviceStatus = m_filterPredicates.getDeviceStatus();
    if (deviceStatus != null && !deviceStatus.isEmpty()) {
        sbUrl.append("&deviceStatus=").append(deviceStatus);
    }

    String deviceConnectionStatus = m_filterPredicates.getDeviceConnectionStatus();
    if (deviceConnectionStatus != null && !deviceConnectionStatus.isEmpty()) {
        sbUrl.append("&deviceConnectionStatus=").append(deviceConnectionStatus);
    }

    String esfVersion = m_filterPredicates.getEsfVersion();
    if (esfVersion != null && !esfVersion.isEmpty()) {
        sbUrl.append("&esfVersion=").append(esfVersion);
    }

    String applicationIdentifiers = m_filterPredicates.getApplicationIdentifiers();
    if (applicationIdentifiers != null && !applicationIdentifiers.isEmpty()) {
        sbUrl.append("&applicationIdentifiers=").append(applicationIdentifiers);
    }

    String imei = m_filterPredicates.getImei();
    if (imei != null && !imei.isEmpty()) {
        sbUrl.append("&imei=").append(imei);
    }

    String imsi = m_filterPredicates.getImsi();
    if (imsi != null && !imsi.isEmpty()) {
        sbUrl.append("&imsi=").append(imsi);
    }

    String iccid = m_filterPredicates.getIccid();
    if (iccid != null && !iccid.isEmpty()) {
        sbUrl.append("&iccid=").append(iccid);
    }

    String customAttribute1 = m_filterPredicates.getCustomAttribute1();
    if (customAttribute1 != null && !customAttribute1.isEmpty()) {
        sbUrl.append("&customAttribute1=").append(customAttribute1);
    }

    String customAttribute2 = m_filterPredicates.getCustomAttribute2();
    if (customAttribute2 != null && !customAttribute2.isEmpty()) {
        sbUrl.append("&customAttribute2=").append(customAttribute2);
    }

    Long signedCertificateId = m_filterPredicates.getSignedCertificateId();
    if (signedCertificateId != null) {
        sbUrl.append("&signedCertificateId=").append(signedCertificateId);
    }

    String sortOrder = m_filterPredicates.getSortOrder();
    if (sortOrder != null && !sortOrder.isEmpty()) {
        sbUrl.append("&sortOrder=").append(sortOrder);
    }

    String sortAttribute = m_filterPredicates.getSortAttribute();
    if (sortAttribute != null && !sortAttribute.isEmpty()) {
        sbUrl.append("&sortAttribute=").append(sortAttribute);
    }

    Window.open(sbUrl.toString(), "_blank", "location=no");
}

From source file:org.eclipse.kapua.app.console.client.device.DeviceTabHistory.java

License:Open Source License

private void export(String format) {
    StringBuilder sbUrl = new StringBuilder();
    if (UserAgentUtils.isSafari() || UserAgentUtils.isChrome()) {
        sbUrl.append("console/exporter_device_event?");
    } else {/*from w  w w. java2  s  .co m*/
        sbUrl.append("exporter_device_event?");
    }

    sbUrl.append("format=").append(format).append("&account=")
            .append(URL.encodeQueryString(m_currentSession.getSelectedAccount().getName())).append("&clientId=")
            .append(URL.encodeQueryString(m_selectedDevice.getClientId())).append("&startDate=")
            .append(m_dateRangeSelector.getStartDate().getTime()).append("&endDate=")
            .append(m_dateRangeSelector.getEndDate().getTime());
    Window.open(sbUrl.toString(), "_blank", "location=no");
}

From source file:org.ednovo.gooru.client.mvp.assessments.play.collection.preview.home.share.SocialShareSmallView.java

License:Open Source License

/**
 * Share the data by using Twister.//from w ww . j av a  2 s  .c om
 */
private void onTwisterShareEvent() {
    MixpanelUtil.Click_On_Twitter();
    if (PlaceTokens.PROFILE_PAGE.equalsIgnoreCase(AppClientFactory.getCurrentPlaceToken())) {
        if (socialDo.getIsSearchShare()) {
            triggerShareDataEvent(PlayerDataLogEvents.TWITTER, false);
            Window.open(
                    "http://twitter.com/intent/tweet?text=" + i18n.GL0733() + " " + i18n.GL_GRR_Hyphen() + " "
                            + socialDo.getTitle().replaceAll("\\+", "%2B") + ": " + socialDo.getBitlylink(),
                    "_blank", "width=600,height=300");
        } else {
            triggerShareDataEvent(PlayerDataLogEvents.TWITTER, false);
            Window.open("http://twitter.com/intent/tweet?text=" + i18n.GL1085_1() + " " + i18n.GL_GRR_Hyphen()
                    + " " + socialDo.getBitlylink(), "_blank", "width=600,height=300");
        }
    } else {
        triggerShareDataEvent(PlayerDataLogEvents.TWITTER, false);
        Window.open(
                "http://twitter.com/intent/tweet?text=" + i18n.GL0733() + " " + i18n.GL_GRR_Hyphen() + " "
                        + socialDo.getTitle().replaceAll("\\+", "%2B") + ": " + socialDo.getBitlylink(),
                "_blank", "width=600,height=300");
    }
}

From source file:org.ednovo.gooru.client.mvp.assessments.play.collection.share.AssessmentsShareView.java

License:Open Source License

@Override
public void setData(final CollectionDo collectionDo) {
    sharePanel.clear();/*from w w  w  .  j  a va 2  s  .  co m*/
    SocialShareWidget swidget = null;
    if (collectionDo != null) {
        final String collectionTitle = collectionDo.getTitle() != null ? collectionDo.getTitle() : "";
        String collectionImg = collectionDo.getThumbnails() != null
                ? (collectionDo.getThumbnails().getUrl() != null ? collectionDo.getThumbnails().getUrl() : "")
                : "";
        swidget = new SocialShareWidget(collectionDo.getGoals() != null ? collectionDo.getGoals() : "",
                collectionImg, ClientConstants.COLLECTION) {

            @Override
            public void onTwitter() {
                Window.open(
                        ClientConstants.TWITTERURL + i18n.GL1439() + " "
                                + collectionTitle.replaceAll("\\+", "%2B") + ": " + shareBitlyUrl,
                        "_blank", "width=600,height=300");
            }

            @Override
            public void onFacebook() {
                SocialShareView.postOnFacebook(collectionTitle, SocialShareView.getEncodedUrl(shareUrl),
                        getResourceDescription(), getThumbnailUrl());
            }

            @Override
            public void onEmail() {
                String emailSubject = i18n.GL1439() + " " + collectionTitle;
                String emailDescription = collectionTitle + "<div><br/></div><div>" + shareUrl
                        + "</div><div><br/></div><div>" + i18n.GL1440() + " "
                        + AppClientFactory.getLoggedInUser().getSettings().getHomeEndPoint() + " "
                        + i18n.GL1441() + "</div>";
                emailShareView = new CollectionEmailShareView(emailSubject, emailDescription) {
                    @Override
                    public void sendEmail(String fromEmail, String toEmail, String copyEmail, String subject,
                            String message) {
                        getUiHandlers().sendEmail(fromEmail, toEmail, copyEmail, subject, message);
                    }

                    @Override
                    public void closeEmailPopup() {
                    }
                };
                emailShareView.show();
            }
        };
        sharePanel.add(swidget);
    }
}

From source file:org.ednovo.gooru.client.mvp.assessments.play.collection.share.AssessmentsShareView.java

License:Open Source License

@Override
public void showResourceData(final CollectionItemDo collectionItemDo) {
    if (collectionItemDo != null) {
        sharePanel.clear();// www.  ja  v a2s  . c  o  m
        if (collectionItemDo.getResource() != null) {
            resourceTitle = collectionItemDo.getResource().getTitle() != null
                    ? collectionItemDo.getResource().getTitle()
                    : "";
            resourceDesc = collectionItemDo.getResource() != null
                    ? (collectionItemDo.getResource().getDescription() != null
                            ? collectionItemDo.getResource().getDescription()
                            : "")
                    : "";
            resourceCategory = collectionItemDo.getCategory() != null ? collectionItemDo.getCategory() : "";
            resourceGooruId = collectionItemDo.getResource().getGooruOid() != null
                    ? collectionItemDo.getResource().getGooruOid()
                    : "";
            resoruceItemId = collectionItemDo.getCollectionItemId() != null
                    ? collectionItemDo.getCollectionItemId()
                    : "";
        }
        String resourceImageUrl = collectionItemDo.getResource() != null
                ? (collectionItemDo.getResource().getThumbnails() != null
                        ? (collectionItemDo.getResource().getThumbnails().getUrl() != null
                                ? collectionItemDo.getResource().getThumbnails().getUrl()
                                : "")
                        : "")
                : "";
        SocialShareWidget swidget = new SocialShareWidget(resourceDesc, resourceImageUrl, resourceCategory,
                collectionItemDo) {
            @Override
            public void onTwitter() {
                getUiHandlers().triggerShareDatalogEvent(resourceGooruId, resoruceItemId,
                        PlayerDataLogEvents.RESOURCE, PlayerDataLogEvents.TWITTER, false);
                Window.open(
                        ClientConstants.TWITTERURL + i18n.GL1439() + " "
                                + removeHtmlTags(resourceTitle).replaceAll("\\+", "%2B") + ": "
                                + SocialShareView.getEncodedUrl(resourceShareUrl),
                        "_blank", "width=600,height=300");
            }

            @Override
            public void onFacebook() {
                getUiHandlers().triggerShareDatalogEvent(resourceGooruId, resoruceItemId,
                        PlayerDataLogEvents.RESOURCE, PlayerDataLogEvents.FACEBOOK, false);
                SocialShareView.postOnFacebook(removeHtmlTags(resourceTitle),
                        SocialShareView.getEncodedUrl(resourceShareUrl), getResourceDescription(),
                        getThumbnailUrl());
            }

            /**
             * used in preview player resource share.
             */
            @Override
            public void onEmail() {
                String emailSubject = removeHtmlTags(resourceTitle);
                String emailDescription = StringUtil.generateMessage(i18n.GL1999(),
                        AppClientFactory.getLoggedInUser().getUsername(), i18n.GL2000(), resourceTitle,
                        resourceShareUrl, AppClientFactory.getLoggedInUser().getSettings().getHomeEndPoint());
                emailShareView = new CollectionEmailShareView(emailSubject, emailDescription) {
                    @Override
                    public void sendEmail(String fromEmail, String toEmail, String copyEmail, String subject,
                            String message) {
                        getUiHandlers().triggerShareDatalogEvent(resourceGooruId,
                                collectionItemDo.getCollectionItemId(), PlayerDataLogEvents.RESOURCE,
                                PlayerDataLogEvents.MAIL, true);
                        getUiHandlers().sendEmail(fromEmail, toEmail, copyEmail, subject, message);
                    }

                    @Override
                    public void closeEmailPopup() {
                        getUiHandlers().triggerShareDatalogEvent(resourceGooruId, resoruceItemId,
                                PlayerDataLogEvents.RESOURCE, PlayerDataLogEvents.MAIL, false);
                    }
                };
                emailShareView.show();
            }
        };
        sharePanel.add(swidget);
    }
}

From source file:org.ednovo.gooru.client.mvp.assessments.play.resource.framebreaker.ResourceFrameBreakerView.java

License:Open Source License

/**
 *
 * @function openResurceLink//  w  w  w  . j  a va2s. c  o m
 *
 * @created_date : Jan 2, 2014
 *
 * @description
 *       To open original resource link in new tab.
 *
 * @parm(s) : @param ClickEvent
 *
 * @return : void
 *
 * @throws : <Mentioned if any exceptions>
 *
 *
 */
@UiHandler("btnResourceLink")
public void openResurceLink(ClickEvent event) {
    MixpanelUtil.mixpanelEvent("Player_Click_Linked_Out_Resource");
    Window.open(collectionItemDo.getResource().getUrl(), "_blank", "");
}

From source file:org.ednovo.gooru.client.mvp.assessments.play.resource.share.AssessmentsResourceShareView.java

License:Open Source License

@Override
public void setData(final CollectionItemDo collectionItemDo) {
    sharePanel.clear();//from ww  w. ja va  2  s .co m
    SocialShareWidget swidget = new SocialShareWidget(collectionItemDo.getResource().getDescription(),
            collectionItemDo.getResource().getThumbnails().getUrl(), collectionItemDo.getCategory(),
            collectionItemDo) {
        @Override
        public void onTwitter() {
            getUiHandlers().triggerShareDataLogEvent(collectionItemDo.getResource().getGooruOid(),
                    PlayerDataLogEvents.RESOURCE, PlayerDataLogEvents.TWITTER, false);
            Window.open("http://twitter.com/intent/tweet?text=" + i18n.GL1439() + " "
                    + removeHtmlTags(collectionItemDo.getResource().getTitle()).replaceAll("\\+", "%2B") + ": "
                    + shareBitlyUrl, "_blank", "width=600,height=300");
        }

        @Override
        public void onFacebook() {
            getUiHandlers().triggerShareDataLogEvent(collectionItemDo.getResource().getGooruOid(),
                    PlayerDataLogEvents.RESOURCE, PlayerDataLogEvents.FACEBOOK, false);
            SocialShareView.postOnFacebook(removeHtmlTags(collectionItemDo.getResource().getTitle()),
                    originalUrl, getResourceDescription(), getThumbnailUrl());
        }

        /**
         * This method is used in resource player share.
         */
        @Override
        public void onEmail() {
            String emailSubject = i18n.GL1439() + " " + collectionItemDo.getResource().getTitle();
            String emailDescription = removeHtmlTags(collectionItemDo.getResource().getTitle())
                    + "<div><br/></div><div>" + shareBitlyUrl + "</div><div><br/></div><div>" + i18n.GL1440()
                    + " " + AppClientFactory.getLoggedInUser().getSettings().getHomeEndPoint() + " "
                    + i18n.GL1441() + "</div>";
            emailShareView = new CollectionEmailShareView(emailSubject, emailDescription) {
                @Override
                public void sendEmail(String fromEmail, String toEmail, String copyEmail, String subject,
                        String message) {
                    getUiHandlers().sendEmail(fromEmail, toEmail, copyEmail, subject, message);
                    getUiHandlers().triggerShareDataLogEvent(collectionItemDo.getResource().getGooruOid(),
                            PlayerDataLogEvents.RESOURCE, PlayerDataLogEvents.MAIL, true);
                }

                @Override
                public void closeEmailPopup() {
                    getUiHandlers().triggerShareDataLogEvent(collectionItemDo.getResource().getGooruOid(),
                            PlayerDataLogEvents.RESOURCE, PlayerDataLogEvents.MAIL, false);
                }
            };
            emailShareView.show();
        }
    };

    sharePanel.add(swidget);
}

From source file:org.ednovo.gooru.client.mvp.classpage.studentclassview.learningmap.assessmentchild.SlmAssessmentChildView.java

License:Open Source License

private void redirectPlayer(String gooruOid, String type, String status) {
    if (!type.equalsIgnoreCase("assessment/url")) {
        String classUId = AppClientFactory.getPlaceManager()
                .getRequestParameter(UrlNavigationTokens.STUDENT_CLASSPAGE_CLASS_ID, null);
        String courseGooruOid = AppClientFactory.getPlaceManager()
                .getRequestParameter(UrlNavigationTokens.STUDENT_CLASSPAGE_COURSE_ID, null);
        String unitId = AppClientFactory.getPlaceManager()
                .getRequestParameter(UrlNavigationTokens.STUDENT_CLASSPAGE_UNIT_ID, null);
        String lessonId = AppClientFactory.getPlaceManager()
                .getRequestParameter(UrlNavigationTokens.STUDENT_CLASSPAGE_LESSON_ID, null);

        String token = PlaceTokens.ASSESSMENT_PLAY;
        if (type.equalsIgnoreCase("collection")) {
            token = PlaceTokens.COLLECTION_PLAY;
        }/*from  w  w  w .  j  a va  2  s.c om*/

        PlaceRequest placeRequest = new PlaceRequest(token);
        placeRequest = placeRequest.with("id", gooruOid);
        placeRequest = placeRequest.with("cid", classUId);
        placeRequest = placeRequest.with("courseId", courseGooruOid);
        placeRequest = placeRequest.with("unitId", unitId);
        placeRequest = placeRequest.with("lessonId", lessonId);

        if (status != null && status.equalsIgnoreCase("active")) {
            placeRequest = placeRequest.with("isStudent", "true");
        }

        AppClientFactory.getPlaceManager().revealPlace(false, placeRequest, true);
    } else {
        if (planContentDo.getUrl() != null && !planContentDo.getUrl().isEmpty()) {
            Window.open(planContentDo.getUrl(), "_blank", "");
        }
    }
}

From source file:org.ednovo.gooru.client.mvp.folder.toc.util.FolderCollectionView.java

License:Open Source License

public FolderCollectionView(String levelStyleName, final FolderDo folderDo, final String parentId) {
    this.res = FolderTocCBundle.INSTANCE;
    res.css().ensureInjected();/*from www  .  ja  va  2 s  .  com*/
    initWidget(uiBinder.createAndBindUi(this));
    if (folderDo.getCollectionType().equals(ASSESSMENT_URL)
            || folderDo.getCollectionType().equals(ASSESSMENT)) {
        collectionTypePanel.getElement().setAttribute("style",
                "background: url('../images/folders/panel/assessment-smal.png') no-repeat 8px 4px;padding-left: 34px;background-size: 21px 17px;");
    } else {
        collectionTypePanel.getElement().setAttribute("style",
                "background: url('../images/folders/panel/collection-small-icon.png') no-repeat 8px 4px;padding-left: 34px;");
    }
    imgLock.setVisible(false);
    if (folderDo.getSettings() != null && folderDo.getSettings().getIsLoginRequired() != null) {
        imgLock.setVisible(Boolean.parseBoolean(folderDo.getSettings().getIsLoginRequired()));
    }

    if (folderDo.getTitle() != null && !folderDo.getTitle().isEmpty()) {
        lblCollectionTitle.setText(folderDo.getTitle());
    }
    if (folderDo.getDescription() != null && !folderDo.getDescription().isEmpty()) {
        lblCollectionDesc.setText(folderDo.getDescription());
    }
    if (folderDo.getCollectionItems().size() > 0) {
        pnlResources.add(new FolderCollectionResourceView(folderDo, parentId));
    }
    lblCollectionTitle.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            if (ASSESSMENT_URL.equalsIgnoreCase(folderDo.getCollectionType())) {
                Window.open(folderDo.getUrl(), "", "");
            } else {
                HashMap<String, String> params = new HashMap<String, String>();
                String selectedfolderId = AppClientFactory.getPlaceManager().getRequestParameter("id");
                params.put("id", folderDo.getGooruOid());
                if (parentId != null) {
                    params.put("folderId", parentId);
                } else {
                    params.put("folderId", selectedfolderId);
                }

                params.put("folderItemId", folderDo.getCollectionItemId());
                PlaceRequest placeRequest = AppClientFactory.getPlaceManager()
                        .preparePlaceRequest(PlaceTokens.COLLECTION_PLAY, params);
                AppClientFactory.getPlaceManager().revealPlace(false, placeRequest, true);
            }
        }
    });
}

From source file:org.ednovo.gooru.client.mvp.home.library.assign.SocialShareSmallView.java

License:Open Source License

/**
 * Share the data by using FB./*from ww w  .  ja  v  a2 s . c  o  m*/
 */
private void onFbShareEvent() {
    MixpanelUtil.Click_On_FaceBook();
    if (AppClientFactory.getCurrentPlaceToken().equals(PlaceTokens.PROFILE_PAGE)) {
        if (socialDo.getIsSearchShare()) {
            Window.open(
                    "http://www.facebook.com/sharer/sharer.php?s=100&p[url]=" + socialDo.getRawUrl()
                            + "&p[images][0]=" + socialDo.getThumbnailurl() + "&p[title]="
                            + socialDo.getTitle().replaceAll("\\+", "%2B") + "&p[summary]=" + description,
                    "_blank", "width=626,height=436");
        } else {
            Window.open("http://www.facebook.com/sharer/sharer.php?s=100&p[url]=" + socialDo.getRawUrl()
                    + "&p[images][0]=" + socialDo.getThumbnailurl() + "&p[title]=" + "Check out "
                    + socialDo.getTitle().replaceAll("\\+", "%2B") + " on Gooru" + "&p[summary]=" + description,
                    "_blank", "width=626,height=436");
        }
    } else {
        Window.open(
                "http://www.facebook.com/sharer/sharer.php?s=100&p[url]=" + socialDo.getRawUrl()
                        + "&p[images][0]=" + socialDo.getThumbnailurl() + "&p[title]="
                        + socialDo.getTitle().replaceAll("\\+", "%2B") + "&p[summary]=" + description,
                "_blank", "width=626,height=436");
    }
}