/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4966112
* @summary Some Composite components does not show the Context Popup.
* @library ../../regtesthelpers
* @build Util
* @author Alexander Zuev
* @run main bug4966112
*/
public class bug4966112 {
private static volatile boolean shown = false;
private static int buttonMask;
closeFrame();
if (popupButton == NO_MOUSE_BUTTON) {
return;
}
// Test Split Pane
closeFrame();
if (!shown) {
throw new RuntimeException("Popup was not shown on splitpane");
}
// Test Spinner
closeFrame();
if (!shown) {
throw new RuntimeException("Popup was not shown on spinner");
}
// Test File Chooser
closeFrame();
if (!shown) {
throw new RuntimeException("Popup was not shown on filechooser");
}
}
setClickPoint(c);
}
}
private static void setButtonMask() {
switch (popupButton) {
case MouseEvent.BUTTON1:
break;
case MouseEvent.BUTTON2:
break;
case MouseEvent.BUTTON3:
break;
}
}
public void run() {
Point p = c.getLocationOnScreen();
}
});
}
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
shown = true;
}
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
}
public void popupMenuCanceled(PopupMenuEvent e) {
}
});
return jpm;
}
public void run() {
void setPopupTrigger(MouseEvent e) {
if (e.isPopupTrigger()) {
popupButton = e.getButton();
}
}
public void mouseClicked(MouseEvent e) {
setPopupTrigger(e);
}
public void mousePressed(MouseEvent e) {
setPopupTrigger(e);
}
public void mouseReleased(MouseEvent e) {
setPopupTrigger(e);
}
});
frame.setVisible(true);
}
});
}
public void run() {
shown = false;
jsp = new JSplitPane();
frame.setVisible(true);
}
});
}
public void run() {
shown = false;
frame.setVisible(true);
}
});
}
public void run() {
shown = false;
filec = new JFileChooser();
frame.setVisible(true);
}
});
}
private static void closeFrame() {
public void run() {
}
});
}
private static class AutoClosable {
}
}
public void close() {
popup.setVisible(false);
}
}
}
}