Remove PluginSafeDialogBox, PluginSafePopupPanel
This is dead code since 2.8 (84275b24d6
).
Nothing listens to the event.
Change-Id: I4dfc5ee070c98f643f7a1090d7468074dd3530b2
This commit is contained in:
@@ -28,9 +28,9 @@ import com.google.gwt.user.client.ui.FocusPanel;
|
||||
import com.google.gwt.user.client.ui.Grid;
|
||||
import com.google.gwt.user.client.ui.HTMLTable.CellFormatter;
|
||||
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
|
||||
import com.google.gwt.user.client.ui.PopupPanel;
|
||||
import com.google.gwtexpui.safehtml.client.SafeHtml;
|
||||
import com.google.gwtexpui.safehtml.client.SafeHtmlBuilder;
|
||||
import com.google.gwtexpui.user.client.PluginSafePopupPanel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@@ -42,7 +42,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class KeyHelpPopup extends PluginSafePopupPanel implements
|
||||
public class KeyHelpPopup extends PopupPanel implements
|
||||
KeyPressHandler, KeyDownHandler {
|
||||
private final FocusPanel focus;
|
||||
|
||||
|
@@ -18,9 +18,10 @@ import com.google.gwt.event.logical.shared.ResizeEvent;
|
||||
import com.google.gwt.event.logical.shared.ResizeHandler;
|
||||
import com.google.gwt.event.shared.HandlerRegistration;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.ui.DialogBox;
|
||||
|
||||
/** A DialogBox that automatically re-centers itself if the window changes */
|
||||
public class AutoCenterDialogBox extends PluginSafeDialogBox {
|
||||
public class AutoCenterDialogBox extends DialogBox {
|
||||
private HandlerRegistration recenter;
|
||||
|
||||
public AutoCenterDialogBox() {
|
||||
|
@@ -1,60 +0,0 @@
|
||||
// Copyright (C) 2013 The Android Open Source Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package com.google.gwtexpui.user.client;
|
||||
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
public class DialogVisibleEvent extends GwtEvent<DialogVisibleHandler> {
|
||||
private static Type<DialogVisibleHandler> TYPE;
|
||||
|
||||
public static Type<DialogVisibleHandler> getType() {
|
||||
if (TYPE == null) {
|
||||
TYPE = new Type<>();
|
||||
}
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
private final Widget parent;
|
||||
private final boolean visible;
|
||||
|
||||
DialogVisibleEvent(Widget w, boolean visible) {
|
||||
this.parent = w;
|
||||
this.visible = visible;
|
||||
}
|
||||
|
||||
public boolean contains(Widget c) {
|
||||
for (; c != null; c = c.getParent()) {
|
||||
if (c == parent) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isVisible() {
|
||||
return visible;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<DialogVisibleHandler> getAssociatedType() {
|
||||
return getType();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(DialogVisibleHandler handler) {
|
||||
handler.onDialogVisible(this);
|
||||
}
|
||||
}
|
@@ -1,21 +0,0 @@
|
||||
// Copyright (C) 2013 The Android Open Source Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package com.google.gwtexpui.user.client;
|
||||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
|
||||
public interface DialogVisibleHandler extends EventHandler {
|
||||
public void onDialogVisible(DialogVisibleEvent event);
|
||||
}
|
@@ -1,61 +0,0 @@
|
||||
// Copyright (C) 2009 The Android Open Source Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package com.google.gwtexpui.user.client;
|
||||
|
||||
import com.google.gwt.user.client.ui.DialogBox;
|
||||
|
||||
/**
|
||||
* A DialogBox that can appear over Flash movies and Java applets.
|
||||
* <p>
|
||||
* Some browsers have issues with placing a <div> (such as that used by
|
||||
* the DialogBox implementation) over top of native UI such as that used by the
|
||||
* Flash plugin. Often the native UI leaks over top of the <div>, which is
|
||||
* not the desired behavior for a dialog box.
|
||||
* <p>
|
||||
* This implementation hides the native resources by setting their display
|
||||
* property to 'none' when the dialog is shown, and restores them back to their
|
||||
* prior setting when the dialog is hidden.
|
||||
* */
|
||||
public class PluginSafeDialogBox extends DialogBox {
|
||||
public PluginSafeDialogBox() {
|
||||
this(false);
|
||||
}
|
||||
|
||||
public PluginSafeDialogBox(final boolean autoHide) {
|
||||
this(autoHide, true);
|
||||
}
|
||||
|
||||
public PluginSafeDialogBox(final boolean autoHide, final boolean modal) {
|
||||
super(autoHide, modal);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisible(final boolean show) {
|
||||
UserAgent.fireDialogVisible(this, show);
|
||||
super.setVisible(show);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
UserAgent.fireDialogVisible(this, true);
|
||||
super.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hide(final boolean autoClosed) {
|
||||
UserAgent.fireDialogVisible(this, false);
|
||||
super.hide(autoClosed);
|
||||
}
|
||||
}
|
@@ -1,61 +0,0 @@
|
||||
// Copyright (C) 2009 The Android Open Source Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package com.google.gwtexpui.user.client;
|
||||
|
||||
import com.google.gwt.user.client.ui.PopupPanel;
|
||||
|
||||
/**
|
||||
* A PopupPanel that can appear over Flash movies and Java applets.
|
||||
* <p>
|
||||
* Some browsers have issues with placing a <div> (such as that used by
|
||||
* the PopupPanel implementation) over top of native UI such as that used by the
|
||||
* Flash plugin. Often the native UI leaks over top of the <div>, which is
|
||||
* not the desired behavior for a dialog box.
|
||||
* <p>
|
||||
* This implementation hides the native resources by setting their display
|
||||
* property to 'none' when the dialog is shown, and restores them back to their
|
||||
* prior setting when the dialog is hidden.
|
||||
* */
|
||||
public class PluginSafePopupPanel extends PopupPanel {
|
||||
public PluginSafePopupPanel() {
|
||||
this(false);
|
||||
}
|
||||
|
||||
public PluginSafePopupPanel(final boolean autoHide) {
|
||||
this(autoHide, true);
|
||||
}
|
||||
|
||||
public PluginSafePopupPanel(final boolean autoHide, final boolean modal) {
|
||||
super(autoHide, modal);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisible(final boolean show) {
|
||||
UserAgent.fireDialogVisible(this, show);
|
||||
super.setVisible(show);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
UserAgent.fireDialogVisible(this, true);
|
||||
super.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hide(final boolean autoClosed) {
|
||||
UserAgent.fireDialogVisible(this, false);
|
||||
super.hide(autoClosed);
|
||||
}
|
||||
}
|
@@ -15,11 +15,7 @@
|
||||
package com.google.gwtexpui.user.client;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.event.shared.EventBus;
|
||||
import com.google.gwt.event.shared.HandlerRegistration;
|
||||
import com.google.gwt.event.shared.SimpleEventBus;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
/**
|
||||
* User agent feature tests we don't create permutations for.
|
||||
@@ -33,16 +29,6 @@ import com.google.gwt.user.client.ui.Widget;
|
||||
public class UserAgent {
|
||||
/** Does the browser have ShockwaveFlash plugin enabled? */
|
||||
public static final boolean hasFlash = hasFlash();
|
||||
private static final EventBus bus = new SimpleEventBus();
|
||||
|
||||
public static HandlerRegistration addDialogVisibleHandler(
|
||||
DialogVisibleHandler handler) {
|
||||
return bus.addHandler(DialogVisibleEvent.getType(), handler);
|
||||
}
|
||||
|
||||
static void fireDialogVisible(Widget w, boolean visible) {
|
||||
bus.fireEvent(new DialogVisibleEvent(w, visible));
|
||||
}
|
||||
|
||||
private static native boolean hasFlash()
|
||||
/*-{
|
||||
|
Reference in New Issue
Block a user