use of com.google.gwt.event.logical.shared.ResizeEvent in project opennms by OpenNMS.
the class PageableApplicationList method registerHandlers.
private void registerHandlers() {
m_eventBus.addHandler(ApplicationDetailsRetrievedEvent.TYPE, this);
addHandler(new ResizeHandler() {
@Override
public void onResize(final ResizeEvent event) {
refreshApplicationListResize();
}
}, ResizeEvent.getType());
}
use of com.google.gwt.event.logical.shared.ResizeEvent in project opennms by OpenNMS.
the class VSearchBox method onLoad.
@Override
public void onLoad() {
m_componentHolder.clear();
this.setStyleName("topology-search");
final TextBoxBase textField = new TextBox();
textField.setWidth("245px");
textField.setStyleName("topology-search-box");
textField.getElement().setAttribute("placeholder", "Search...");
textField.setFocus(true);
RemoteSuggestOracle oracle = new RemoteSuggestOracle();
m_suggestBox = new SuggestBox(oracle, textField);
m_suggestBox.addSelectionHandler(new SelectionHandler<SuggestOracle.Suggestion>() {
@Override
public void onSelection(SelectionEvent<SuggestOracle.Suggestion> event) {
SearchSuggestion selectedItem = (SearchSuggestion) event.getSelectedItem();
textField.setText("");
m_connector.addToFocus(selectedItem);
}
});
if (m_isMultiValued) {
m_suggestBox.setStyleName("multivalue");
}
m_suggestBox.addStyleName("wideTextField");
m_suggestBox.addSelectionHandler(this);
m_suggestBox.addKeyUpHandler(this);
m_componentHolder.setWidth("245px");
m_componentHolder.add(m_suggestBox);
if (m_focusedContainer == null) {
m_focusedContainer = new VerticalPanel();
m_scrollContainer = new FlowPanel();
m_scrollContainer.add(m_focusedContainer);
}
m_focusedContainer.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
m_focusedContainer.setTitle("Focused Vertices");
m_componentHolder.add(m_scrollContainer);
Timer timer = new Timer() {
@Override
public void run() {
updateScrollPanelSize();
}
};
timer.schedule(1000);
m_windowResizeRegistration = Window.addResizeHandler(new ResizeHandler() {
@Override
public void onResize(ResizeEvent event) {
updateScrollPanelSize();
}
});
}
use of com.google.gwt.event.logical.shared.ResizeEvent in project gerrit by GerritCodeReview.
the class EditScreen method onShowView.
@Override
public void onShowView() {
super.onShowView();
Window.enableScrolling(false);
JumpKeys.enable(false);
if (prefs.hideTopMenu()) {
Gerrit.setHeaderVisible(false);
}
resizeHandler = Window.addResizeHandler(new ResizeHandler() {
@Override
public void onResize(ResizeEvent event) {
adjustHeight();
}
});
closeHandler = Window.addWindowClosingHandler(new ClosingHandler() {
@Override
public void onWindowClosing(ClosingEvent event) {
if (!cmEdit.isClean(generation)) {
event.setMessage(EditConstants.I.closeUnsavedChanges());
}
}
});
generation = cmEdit.changeGeneration(true);
setClean(true);
cmEdit.on(new ChangesHandler() {
@Override
public void handle(CodeMirror cm) {
setClean(cm.isClean(generation));
}
});
adjustHeight();
cmEdit.on("cursorActivity", updateCursorPosition());
setShowTabs(prefs.showTabs());
setLineLength(prefs.lineLength());
cmEdit.refresh();
cmEdit.focus();
if (startLine > 0) {
cmEdit.scrollToLine(startLine);
}
updateActiveLine();
editPrefsAction = new EditPreferencesAction(this, prefs);
}
use of com.google.gwt.event.logical.shared.ResizeEvent in project opennms by OpenNMS.
the class MapQuestMapPanel method initializeMap.
/**
* <p>initializeMap</p>
*/
private void initializeMap() {
m_map = MQATileMap.newInstance(m_mapHolder.getElement());
m_map.addControl(MQALargeZoomControl.newInstance());
m_map.setZoomLevel(1);
m_map.setCenter(MQALatLng.newInstance("0,0"));
m_map.addMoveEndHandler(new MoveEndHandler() {
@Override
public void onMoveEnd(final MoveEndEvent event) {
m_eventBus.fireEvent(new MapPanelBoundsChangedEvent(getBounds()));
}
});
m_map.addClickHandler(new com.googlecode.gwtmapquest.transaction.event.ClickHandler() {
@Override
public void onClicked(final com.googlecode.gwtmapquest.transaction.event.ClickEvent event) {
m_clickCounter.incrementCounter(event.getLL());
}
});
m_map.addDblClickHandler(new DblClickHandler() {
@Override
public void onDblClicked(DblClickEvent event) {
m_clickCounter.incrementCounter(event.getLL());
}
});
m_map.addZoomEndHandler(new ZoomEndHandler() {
@Override
public void onZoomEnd(ZoomEndEvent event) {
m_eventBus.fireEvent(new MapPanelBoundsChangedEvent(getBounds()));
}
});
m_map.addShapeAddedHandler(new ShapeAddedHandler() {
@Override
public void onShapeAdded(ShapeAddedEvent event) {
Element mqPoiDiv = DOM.getElementById("mqpoidiv");
Element markerElement = Element.as(mqPoiDiv.getLastChild());
updatePOILayer(markerElement);
}
});
Window.addResizeHandler(new ResizeHandler() {
@Override
public void onResize(ResizeEvent event) {
syncMapSizeWithParent();
}
});
}
use of com.google.gwt.event.logical.shared.ResizeEvent in project opennms by OpenNMS.
the class OpenLayersMapPanel method initializeMap.
/**
* <p>initializeMap</p>
*/
private void initializeMap() {
final MapOptions mo = new MapOptions();
mo.setProjection(PROJECTION_SPHERICAL_MERCATOR.getProjectionCode());
mo.setDisplayProjection(PROJECTION_LAT_LON);
mo.setMaxExtent(new Bounds(-180, -90, 180, 90).transform(PROJECTION_LAT_LON, PROJECTION_SPHERICAL_MERCATOR));
m_mapWidget = new MapWidget("100%", "100%", mo);
m_mapHolder.add(m_mapWidget);
m_map = m_mapWidget.getMap();
m_map.addControl(new PanZoomBar());
m_map.addControl(new MousePosition());
m_map.zoomTo(2);
initializeImageError();
XYZOptions xyzOptions = new XYZOptions();
xyzOptions.setSphericalMercator(true);
xyzOptions.setAttribution(getAttribution());
XYZ x = new XYZ("OpenStreetMap", getLayerUrl(), xyzOptions);
x.setIsBaseLayer(true);
x.setIsVisible(true);
m_map.addLayer(x);
m_markersLayer = new Markers("Remote Pollers");
m_markersLayer.setIsVisible(true);
m_markersLayer.setIsBaseLayer(false);
m_map.addLayer(m_markersLayer);
/*
final LayerSwitcher switcher = new LayerSwitcher();
m_map.addControl(switcher);
*/
m_map.zoomToMaxExtent();
Window.addResizeHandler(new ResizeHandler() {
@Override
public void onResize(ResizeEvent event) {
syncMapSizeWithParent();
}
});
}
Aggregations