Remove PluginSafeDialogBox, PluginSafePopupPanel

This is dead code since 2.8 (84275b24d6).
Nothing listens to the event.

Change-Id: I4dfc5ee070c98f643f7a1090d7468074dd3530b2
This commit is contained in:
Shawn Pearce
2015-07-20 08:49:25 -07:00
parent 2efa6030fd
commit 2bc3a98f1b
19 changed files with 23 additions and 247 deletions

View File

@@ -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;

View File

@@ -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() {

View File

@@ -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);
}
}

View File

@@ -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);
}

View File

@@ -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 &lt;div&gt; (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 &lt;div&gt;, 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);
}
}

View File

@@ -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 &lt;div&gt; (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 &lt;div&gt;, 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);
}
}

View File

@@ -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()
/*-{

View File

@@ -26,13 +26,13 @@ import com.google.gwt.user.client.rpc.StatusCodeException;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwtexpui.safehtml.client.SafeHtml;
import com.google.gwtexpui.user.client.PluginSafePopupPanel;
import com.google.gwtjsonrpc.client.RemoteJsonException;
/** A dialog box showing an error message, when bad things happen. */
public class ErrorDialog extends PluginSafePopupPanel {
public class ErrorDialog extends PopupPanel {
private final Label text;
private final FlowPanel body;
private final Button closey;

View File

@@ -26,10 +26,9 @@ import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwtexpui.globalkey.client.GlobalKey;
import com.google.gwtexpui.user.client.PluginSafePopupPanel;
/** A dialog box telling the user they are not signed in. */
public class NotSignedInDialog extends PluginSafePopupPanel implements CloseHandler<PopupPanel> {
public class NotSignedInDialog extends PopupPanel implements CloseHandler<PopupPanel> {
private Button signin;
private boolean buttonClicked;

View File

@@ -22,10 +22,10 @@ import com.google.gwt.dom.client.Element;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwtexpui.user.client.PluginSafePopupPanel;
public class UserPopupPanel extends PluginSafePopupPanel {
public class UserPopupPanel extends PopupPanel {
interface Binder extends UiBinder<Widget, UserPopupPanel> {}
private static final Binder binder = GWT.create(Binder.class);

View File

@@ -22,7 +22,6 @@ import com.google.gwt.event.logical.shared.CloseHandler;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwtexpui.globalkey.client.GlobalKey;
import com.google.gwtexpui.user.client.PluginSafePopupPanel;
class PopupHelper {
static PopupHelper popup(ActionContext ctx, Element panel) {
@@ -34,7 +33,7 @@ class PopupHelper {
private final ActionButton activatingButton;
private final FlowPanel panel;
private PluginSafePopupPanel popup;
private PopupPanel popup;
PopupHelper(ActionButton button, Element child) {
activatingButton = button;
@@ -44,7 +43,7 @@ class PopupHelper {
}
void show() {
final PluginSafePopupPanel p = new PluginSafePopupPanel(true);
final PopupPanel p = new PopupPanel(true);
p.setStyleName(Resources.I.style().popup());
p.addAutoHidePartner(activatingButton.getElement());
p.addCloseHandler(new CloseHandler<PopupPanel>() {

View File

@@ -30,7 +30,6 @@ import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwtexpui.globalkey.client.GlobalKey;
import com.google.gwtexpui.globalkey.client.NpTextArea;
import com.google.gwtexpui.user.client.PluginSafePopupPanel;
abstract class ActionMessageBox extends Composite {
interface Binder extends UiBinder<HTMLPanel, ActionMessageBox> {}
@@ -41,7 +40,7 @@ abstract class ActionMessageBox extends Composite {
}
private final Button activatingButton;
private PluginSafePopupPanel popup;
private PopupPanel popup;
@UiField Style style;
@UiField NpTextArea message;
@@ -62,7 +61,7 @@ abstract class ActionMessageBox extends Composite {
return;
}
final PluginSafePopupPanel p = new PluginSafePopupPanel(true);
final PopupPanel p = new PopupPanel(true);
p.setStyleName(style.popup());
p.addAutoHidePartner(activatingButton.getElement());
p.addCloseHandler(new CloseHandler<PopupPanel>() {

View File

@@ -21,7 +21,6 @@ import com.google.gwt.event.logical.shared.CloseHandler;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwtexpui.globalkey.client.GlobalKey;
import com.google.gwtexpui.user.client.PluginSafePopupPanel;
class AddFileAction {
private final Change.Id changeId;
@@ -54,7 +53,7 @@ class AddFileAction {
}
addBox.clearPath();
final PluginSafePopupPanel p = new PluginSafePopupPanel(true);
final PopupPanel p = new PopupPanel(true);
p.setStyleName(style.replyBox());
p.addAutoHidePartner(addButton.getElement());
p.addCloseHandler(new CloseHandler<PopupPanel>() {

View File

@@ -21,7 +21,6 @@ import com.google.gwt.event.logical.shared.CloseHandler;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwtexpui.globalkey.client.GlobalKey;
import com.google.gwtexpui.user.client.PluginSafePopupPanel;
class DeleteFileAction {
private final Change.Id changeId;
@@ -51,7 +50,7 @@ class DeleteFileAction {
}
deleteBox.clearPath();
final PluginSafePopupPanel p = new PluginSafePopupPanel(true);
final PopupPanel p = new PopupPanel(true);
p.setStyleName(style.replyBox());
p.addAutoHidePartner(deleteButton.getElement());
p.addCloseHandler(new CloseHandler<PopupPanel>() {

View File

@@ -21,7 +21,6 @@ import com.google.gwt.event.logical.shared.CloseHandler;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwtexpui.globalkey.client.GlobalKey;
import com.google.gwtexpui.user.client.PluginSafePopupPanel;
class RenameFileAction {
private final Change.Id changeId;
@@ -51,7 +50,7 @@ class RenameFileAction {
}
renameBox.clearPath();
final PluginSafePopupPanel p = new PluginSafePopupPanel(true);
final PopupPanel p = new PopupPanel(true);
p.setStyleName(style.replyBox());
p.addAutoHidePartner(renameButton.getElement());
p.addCloseHandler(new CloseHandler<PopupPanel>() {

View File

@@ -28,7 +28,6 @@ import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwtexpui.globalkey.client.GlobalKey;
import com.google.gwtexpui.user.client.PluginSafePopupPanel;
class ReplyAction {
private final PatchSet.Id psId;
@@ -105,7 +104,7 @@ class ReplyAction {
replyBox.replyTo(msg);
}
final PluginSafePopupPanel p = new PluginSafePopupPanel(true, false);
final PopupPanel p = new PopupPanel(true, false);
p.setStyleName(style.replyBox());
p.addAutoHidePartner(replyButton.getElement());
p.addAutoHidePartner(quickApproveButton.getElement());

View File

@@ -23,7 +23,6 @@ import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.UIObject;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwtexpui.globalkey.client.GlobalKey;
import com.google.gwtexpui.user.client.PluginSafePopupPanel;
abstract class RightSidePopdownAction {
private final ChangeScreen.Style style;
@@ -49,7 +48,7 @@ abstract class RightSidePopdownAction {
return;
}
final PluginSafePopupPanel p = new PluginSafePopupPanel(true) {
final PopupPanel p = new PopupPanel(true) {
@Override
public void setPopupPosition(int left, int top) {
top -= Document.get().getBodyOffsetTop();

View File

@@ -22,14 +22,14 @@ import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.PopupPanel.PositionCallback;
import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwtexpui.globalkey.client.GlobalKey;
import com.google.gwtexpui.globalkey.client.HidePopupPanelCommand;
import com.google.gwtexpui.user.client.PluginSafeDialogBox;
class PatchBrowserPopup extends PluginSafeDialogBox implements
class PatchBrowserPopup extends DialogBox implements
PositionCallback, ResizeHandler {
private final Patch.Key callerKey;
private final PatchTable fileList;

View File

@@ -25,6 +25,7 @@ import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.dom.client.KeyUpHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
@@ -33,12 +34,11 @@ import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwtexpui.globalkey.client.GlobalKey;
import com.google.gwtexpui.globalkey.client.HidePopupPanelCommand;
import com.google.gwtexpui.globalkey.client.NpTextBox;
import com.google.gwtexpui.user.client.PluginSafeDialogBox;
/** A popup containing all projects. */
public class ProjectListPopup {
private HighlightingProjectsTable projectsTab;
private PluginSafeDialogBox popup;
private DialogBox popup;
private NpTextBox filterTxt;
private HorizontalPanel filterPanel;
private String match;
@@ -155,7 +155,7 @@ public class ProjectListPopup {
}
});
popup = new PluginSafeDialogBox();
popup = new DialogBox();
popup.setModal(false);
popup.setText(popupText);
}