Example usage for com.google.gwt.event.shared HandlerManager HandlerManager

List of usage examples for com.google.gwt.event.shared HandlerManager HandlerManager

Introduction

In this page you can find the example usage for com.google.gwt.event.shared HandlerManager HandlerManager.

Prototype

public HandlerManager(Object source) 

Source Link

Document

Creates a handler manager with a source to be set on all events fired via #fireEvent(GwtEvent) .

Usage

From source file:org.gwt.dynamic.host.client.features.ModuleReadyFeatureProvider.java

License:MIT License

public ModuleReadyFeatureProvider(List<ModuleBean> modules, int timeoutSeconds) {
    super(MODULE_HOST);
    if (Utils.isEmpty(modules))
        throw new IllegalArgumentException("Module list cannot be empty");
    moduleUnreadyList.addAll(modules);//from  www. jav  a2 s.  c o m
    handlerManager = new HandlerManager(this);
    if (timeoutSeconds <= 0)
        timeoutSeconds = 1;
    timeoutTimer.schedule(timeoutSeconds * 1000);
    LOG.info("ModuleReadyFeatureProvider: instantiated");
}

From source file:org.jboss.wise.gwt.client.Main.java

License:Open Source License

public void onModuleLoad() {
    MainServiceAsync rpcService = GWT.create(MainService.class);
    HandlerManager eventBus = new HandlerManager(null);
    AppController appViewer = new AppController(rpcService, eventBus);

    //rootLogger.log(Level.INFO, "Main: href: " + Window.Location.getHref());
    //rootLogger.log(Level.INFO, "Main: queryString: " + Window.Location.getQueryString());

    String hRef = Window.Location.getHref();
    String qStr = Window.Location.getQueryString();
    if (qStr != null && qStr.length() > 0) {
        int indx = hRef.indexOf(qStr);
        if (indx > 0) {

            // extract and send the URL's query parameter to the start page
            String wsdlParam = Window.Location.getParameter("wsdl");
            if (wsdlParam != null) {
                String decodedWsdl = URL.decodeQueryString(wsdlParam);
                eventBus.fireEvent(new InputWsdlEvent(decodedWsdl));
            }// w  ww . ja  v  a  2  s .  c om
        }
    }

    appViewer.go(RootPanel.get());
}

From source file:org.jbpm.console.ng.gc.client.util.UTCDateBoxImplHtml4.java

License:Apache License

public UTCDateBoxImplHtml4() {
    handlerManager = new HandlerManager(this);
    datebox = new DatePicker();
    datebox.setAutoClose(true);/* w  w  w .  j ava  2  s.c o  m*/
    datebox.addValueChangeHandler(new ValueChangeHandler<Date>() {

        @Override
        public void onValueChange(ValueChangeEvent<Date> event) {
            // pass this event onto our handlers after converting
            // the value
            fireValueChangeEvent(UTCDateBox.date2utc(event.getValue()));
        }
    });
}

From source file:org.krypsis.gwt.store.client.javascript.JsStoreService.java

License:MIT License

public JsStoreService(StoreBackend backend) {
    this(backend, new HandlerManager(null));
}

From source file:org.ktunaxa.referral.client.gui.MapLayout.java

License:Open Source License

private MapLayout() {
    super();/*from  ww w. j  ava2s  .co  m*/
    geoserverUrl = Geomajas.getDispatcherUrl().replace("/map/d", "/geoserver/ows");
    // geoserverUrl = "http://127.0.0.1:8888/d/proxy?url=http://64.141.44.215:9090/geoserver/ows";

    WmsClient.getInstance().getWmsService().setWmsUrlTransformer(new WmsUrlTransformer() {

        @Override
        public String transform(WmsRequest request, String url) {
            if (request == WmsRequest.GETMAP) {
                return url + "&tiled=true";
            } else {
                return url;
            }
        }

    });
    handlerManager = new HandlerManager(this);
    UserContext.getInstance().addUserContextChangedHandler(new UserContextChangedHandler() {

        public void onChanged(UserContextChangedEvent event) {
            // update GUI to reflect user rights
            updateRights();
        }
    });

    setWidth100();
    setHeight100();
    setOverflow(Overflow.HIDDEN);

    // the info pane
    infoPane = new ResizableLeftLayout();
    infoPane.setStyleName(STYLE_BLOCK);

    // the map
    mapWidget = new MapWidget(KtunaxaConstant.MAP_MAIN, KtunaxaConstant.APPLICATION);
    mapWidget.getMapModel().runWhenInitialized(new Runnable() {

        @Override
        public void run() {
            addClientLayers();

        }

    });

    // add layers, referral, GIS panel
    layerPanel = new LayersPanel(mapWidget);
    infoPane.addCard(layerPanel.getName(), "Manage layers", layerPanel);
    referralPanel = new ReferralPanel();
    infoPane.addCard(referralPanel.getName(), "Manage referral", referralPanel);
    referralButton = getLastButton();
    referralButton.setDisabled(true); // no referral at start
    searchPanel = new SearchPanel(this);
    infoPane.addCard(searchPanel.getName(), "Search", searchPanel);
    // top bar
    topBar = new TopBar();
    mapWidget.getMapModel().runWhenInitialized(new Runnable() {

        public void run() {
            referralLayer = (VectorLayer) mapWidget.getMapModel().getLayer(KtunaxaConstant.LAYER_REFERRAL_ID);
            topBar.update();
        }
    });
    // menu bar
    menuBar = new MenuBar();
    for (ToolStripButton button : infoPane.getButtons()) {
        menuBar.addNavigationButton(button);
    }
    newButton = new ToolStripButton("NEW");
    newButton.addClickHandler(new ClickHandler() {

        public void onClick(ClickEvent event) {
            createReferral();
        }
    });

    menuBar.addActionButton(newButton);

    // add all
    VLayout mapLayout = new VLayout();
    mapLayout.setSize("100%", "100%");
    mapLayout.setStyleName(STYLE_BLOCK);
    final Toolbar toolbar = new Toolbar(mapWidget);
    toolbar.setButtonSize(WidgetLayout.toolbarLargeButtonSize);
    toolbar.setBorder("none");

    mapLayout.addMember(toolbar);
    mapWidget.setOverflow(Overflow.HIDDEN);
    mapLayout.addMember(mapWidget);

    addMember(topBar);
    addMember(menuBar);
    VLayout subHeader = new VLayout();
    subHeader.setSize("100%", "8px");
    subHeader.setStyleName("subHeader");
    addMember(subHeader);

    bodyLayout = new VLayout();
    bodyLayout.setOverflow(Overflow.AUTO);
    HLayout hLayout = new HLayout();
    hLayout.setMargin(LayoutConstant.MARGIN_SMALL);
    hLayout.setWidth100();
    hLayout.setHeight100();
    hLayout.addMember(infoPane);
    hLayout.addMember(mapLayout);
    bodyLayout.addMember(hLayout);
    addMember(bodyLayout);
}

From source file:org.ktunaxa.referral.client.layer.ReferenceLayer.java

License:Open Source License

public ReferenceLayer(VectorLayer layer, List<ReferenceLayerDto> subLayerDtos,
        List<ReferenceLayerTypeDto> layerTypeDtos, boolean isBase) {
    this.layer = layer;
    for (ReferenceLayerTypeDto layerType : layerTypeDtos) {
        if (isBase == layerType.isBaseLayer()) {
            layerTypes.add(layerType);/*from w w  w.  j av a2  s.  co m*/
        }
    }
    handlerManager = new HandlerManager(this);
    // forward layer changed events
    this.layer.addLayerChangedHandler(new LayerChangedForwarder());
    mapModel = layer.getMapModel();
    mapModel.getMapView().addMapViewChangedHandler(new LayerShowingHandler());
    for (ReferenceLayerDto referenceLayerDto : subLayerDtos) {
        if (isBase == referenceLayerDto.getType().isBaseLayer()) {
            subLayers.add(new ReferenceSubLayer(this, referenceLayerDto));
        }
    }
    updateScaleBounds(layer);
    updateShowing();
}

From source file:org.ktunaxa.referral.client.referral.FileUploadForm.java

License:Open Source License

public FileUploadForm(String title, String targetUrl, String referralId) {
    super();//w  w w  .j  a va 2 s .co m
    if (!targetUrl.contains("?")) {
        this.targetUrl = targetUrl + "?";
    } else {
        this.targetUrl = targetUrl + "&";
    }
    this.targetUrl += KtunaxaConstant.FORM_ID + "=" + getID();
    if (referralId != null) {
        setReferralId(referralId);
    }
    String targetFrame = "resFrame" + getID();
    handlerManager = new HandlerManager(this);
    initComplete(this);
    setEncoding(Encoding.MULTIPART);
    setTarget(targetFrame);
    setCanSubmit(true);
    setWidth100();

    fileItem = new UploadItem(KtunaxaConstant.FORM_FILE);
    fileItem.setTitle(title);
    fileItem.setWrapTitle(false);
    fileItem.setWidth("*");
    fileItem.setHeight(24);
    fileItem.setCellHeight(24);
    /*
     * fileItem.addChangeHandler(new ChangeHandler() { public void onChange(ChangeEvent event) { if
     * (fileItem.getEnteredValue().endsWith(".zip")) { uploadButton.enable(); } else { uploadButton.disable(); } }
     * });
     */
    setFields(fileItem);

    NamedFrame frame = new NamedFrame(targetFrame);
    frame.setSize("1", "1");
    frame.setVisible(false);
    addChild(frame);
}

From source file:org.kuali.student.common.ui.client.widgets.focus.FocusGroup.java

License:Educational Community License

public FocusGroup(final Widget parentWidget) {
    this.handlers = new HandlerManager(parentWidget);
}

From source file:org.onebusaway.webapp.gwt.mobile_application.control.LocationManager.java

License:Apache License

private HandlerManager handlers() {
    return _handlerManager == null ? _handlerManager = new HandlerManager("") : _handlerManager;
}

From source file:org.onebusaway.webapp.gwt.viewkit.TabBarController.java

License:Apache License

private HandlerManager ensureHandlers() {
    return _handlerManager == null ? _handlerManager = new HandlerManager(this) : _handlerManager;
}