Java Code Examples for javax.security.auth.callback.ConfirmationCallback#YES

The following examples show how to use javax.security.auth.callback.ConfirmationCallback#YES . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Main.java    From xunxian with Apache License 2.0 6 votes vote down vote up
private void jMenuItem15ActionPerformed(java.awt.event.ActionEvent evt) {
	if (new Func.Message()
			.showConfirmDialog("软件使用Java编写,使用了大漠、大兵、信诺模块,与游戏的交互、图、色、文字点阵等辨别都已写Java接口,<br/>可以完全使用Java来进行开发!软件源代码会象征性收费1000元<br/>随着时间价格会逐渐降低,甚至,会免费放出!敬请期待!喜欢辅助软件开发的小朋友,可以联系,<br/>当然,喜欢不劳而获的那种人,请勿打扰!<br/><br/>"
					+ "功能简介:<br/>"
					+ "1.打怪挂机点增加So Easy,录入点坐标,一行代码就可增加一个挂机点!<br/>"
					+ "2.多线程监控,打怪线程、辅助线程、日志线程、系统线程、定时监控软件正常运行<br/>"
					+ "3.底层接口丰富,大漠、信诺...等模块操作系统的接口全部用写好,可直接调用!不想做寻仙做其他的游戏也完全可以<br/>"
					+ "4.基本功能模块皆有,JAVA的松耦合完美诠释。每个模块都可单独拿出做其他游戏的辅助,就如,按键精灵!<br/>"
					+ "5.扫货的数据维护,八卦灵石、宠物壳子、可直接一行代码录入数据!这都不是事<br/>"
					+ "6.界面使用MyEclipse8.5设计,可拖拽如VB、易语言的界面设计<br/>"
					+ "7.整套自己的系统,有自己的腾讯云服务器,php软件注册系统!注册码开号实时控制<br/>"
					+ "8.内置代理接口,代理可自行开注册码<br/>"
					+ "<br/>"
					+ "废话不多说,本人QQ921153866,拒加喜欢不劳而获者,贪小便宜者,思想愚笨者<br/>"
					+ "<br/>是否查看源码文件?") == ConfirmationCallback.YES) {
		System.out.println("aaa");
	}
}
 
Example 2
Source File: SaoHuo.java    From xunxian with Apache License 2.0 6 votes vote down vote up
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
	if (new Func.Message()
			.showConfirmDialog("设置杂货类所有物品的价格为2铜之内自动买进。<br/>注意:设置后原本配置的数据会都变成2铜<br/>确定要进行快速设置?") == ConfirmationCallback.YES) {
		int money = 2;
		SaoHuoFunc saoHuoFunc = new SaoHuoFunc();
		TableModel model = (TableModel) Command.JframeSaoHuo.groceriesjTable
				.getModel();
		for (int row = model.getRowCount() - 1; row >= 0; row--) {
			model.setValueAt(money, row, 2);
			model.setValueAt(saoHuoFunc.moneyToString(money), row, 1);

		}

		saoHuoFunc = null;
		model = null;
	}
}
 
Example 3
Source File: SaoHuo.java    From xunxian with Apache License 2.0 6 votes vote down vote up
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
	if (new Func.Message()
			.showConfirmDialog("设置风物志类所有物品的价格为2铜之内自动买进。<br/>注意:设置后原本配置的数据会都变成2铜<br/>确定要进行快速设置?") == ConfirmationCallback.YES) {
		int money = 2;
		SaoHuoFunc saoHuoFunc = new SaoHuoFunc();
		TableModel model = (TableModel) Command.JframeSaoHuo.fengWuZhijTable
				.getModel();
		for (int row = model.getRowCount() - 1; row >= 0; row--) {
			model.setValueAt(money, row, 2);
			model.setValueAt(saoHuoFunc.moneyToString(money), row, 1);

		}

		saoHuoFunc = null;
		model = null;
	}
}
 
Example 4
Source File: SaoHuo.java    From xunxian with Apache License 2.0 6 votes vote down vote up
private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {
	if (new Func.Message()
			.showConfirmDialog("设置传奇图纸所有物品的价格为2铜之内自动买进。<br/>注意:设置后原本配置的数据会都变成2铜<br/>确定要进行快速设置?") == ConfirmationCallback.YES) {
		int money = 2;
		SaoHuoFunc saoHuoFunc = new SaoHuoFunc();
		TableModel model = (TableModel) Command.JframeSaoHuo.legendjTable
				.getModel();
		for (int row = model.getRowCount() - 1; row >= 0; row--) {
			model.setValueAt(money, row, 2);
			model.setValueAt(saoHuoFunc.moneyToString(money), row, 1);

		}

		saoHuoFunc = null;
		model = null;
	}
}
 
Example 5
Source File: SaoHuo.java    From xunxian with Apache License 2.0 6 votes vote down vote up
private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {
	if (new Func.Message()
			.showConfirmDialog("设置其他分类里面所有物品的价格为2铜之内自动买进。<br/>注意:设置后原本配置的数据会都变成2铜<br/>确定要进行快速设置?") == ConfirmationCallback.YES) {
		int money = 2;
		SaoHuoFunc saoHuoFunc = new SaoHuoFunc();
		TableModel model = (TableModel) Command.JframeSaoHuo.elseClassjTable
				.getModel();
		for (int row = model.getRowCount() - 1; row >= 0; row--) {
			model.setValueAt(money, row, 2);
			model.setValueAt(saoHuoFunc.moneyToString(money), row, 1);

		}

		saoHuoFunc = null;
		model = null;
	}
}
 
Example 6
Source File: SaoHuo.java    From xunxian with Apache License 2.0 6 votes vote down vote up
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
	if (new Func.Message()
			.showConfirmDialog("设置宠物壳子所有物品的价格为2铜之内自动买进。<br/>注意:设置后原本配置的数据会都变成2铜<br/>确定要进行快速设置?") == ConfirmationCallback.YES) {
		int money = 2;
		SaoHuoFunc saoHuoFunc = new SaoHuoFunc();
		TableModel model = (TableModel) Command.JframeSaoHuo.petjTable
				.getModel();
		for (int row = model.getRowCount() - 1; row >= 0; row--) {
			model.setValueAt(money, row, 2);
			model.setValueAt(saoHuoFunc.moneyToString(money), row, 1);

		}

		saoHuoFunc = null;
		model = null;
	}
}
 
Example 7
Source File: SaoHuo.java    From xunxian with Apache License 2.0 6 votes vote down vote up
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
	if (new Func.Message()
			.showConfirmDialog("设置宠物壳子所有物品的价格为2铜之内自动买进。<br/>注意:设置后原本配置的数据会都变成2铜<br/>确定要进行快速设置?") == ConfirmationCallback.YES) {
		int money = 2;
		SaoHuoFunc saoHuoFunc = new SaoHuoFunc();
		TableModel model = (TableModel) Command.JframeSaoHuo.stonejTable
				.getModel();
		for (int row = model.getRowCount() - 1; row >= 0; row--) {
			model.setValueAt(money, row, 2);
			model.setValueAt(saoHuoFunc.moneyToString(money), row, 1);

		}

		saoHuoFunc = null;
		model = null;
	}
}
 
Example 8
Source File: Main.java    From xunxian with Apache License 2.0 6 votes vote down vote up
private void SaveDatajButtonActionPerformed(java.awt.event.ActionEvent evt) {
	if (new Func.Message().showConfirmDialog("确定要保存数据?") == ConfirmationCallback.YES) {
		try {
			File file = new action.File();

			file.saoHuoGroceriesSave();
			file.saoHuoStoneSave();
			file.saoHuoPetSave();
			file.saoHuoFengWuZhiSave();
			file.saoHuoLegendSave();
			file.saoHuoElseClassSave();
			file.UISave();

			new Func.Message().showMessageDialog("保存成功");
			file = null;
		} catch (Exception e) {
			new Func.Message().showMessageDialog("执行失败");
		}
	}
}
 
Example 9
Source File: Main.java    From xunxian with Apache License 2.0 5 votes vote down vote up
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
	if (new Func.Message()
			.showConfirmDialog("游戏已不再留恋!软件全部免费!<br/>原本只能购买才能用的自动扫货跟工作室用的高级打怪模式全自动卦机打怪,现免费发布,免费使用!<br/>免费注册码为www.xnx3.com注册便可以用!<br/>本软件使用Java编写!精通Java,对辅助有兴趣的,可联系我QQ921153866购买源码,继续开发下去!<br/><br/>【注】软件已全免费,但答题是用的第三方的答题平台,喜欢软件的仙友仍可以自行购买自动答题服务") == ConfirmationCallback.YES) {
		Command.browser.loadUrl(
				"http://www.xnx3.com/xunxian/fuzhu/shenshan_kefu.html",
				200, 200, 800, 600);
	}
	//		switch (Command.agent) {
	//		case 1: //1是自己的
	//			Object[] options = { "自动扫货购买", "打怪自动过验证码服务" };
	//			int response = JOptionPane
	//					.showOptionDialog(
	//							null,
	//							"自动打怪功能、后台键盘鼠标模拟、捉宝宝打符、免费使用!\n免费注册码:www.xnx3.com\n\n自动扫货续费都是5元一个月超低价!\n自动打怪可以购买自动过验证码服务,无需人工值守",
	//							"软件购买", JOptionPane.YES_OPTION,
	//							JOptionPane.QUESTION_MESSAGE, null, options,
	//							options[0]);
	//			if (response == 0) { //客服购买
	//				Command.browser
	//						.loadUrl(
	//								"http://www.xnx3.com/xunxian/xxautofight/20140308/82.html",
	//								200, 200, 1024, 900);
	//			} else if (response == 1) {
	//				Command.browser
	//						.loadUrl(
	//								"http://www.xnx3.com/xunxian/xxautofight/20140308/83.html",
	//								200, 200, 1024, 900);
	//			}
	//		case 2:
	//			Command.browser.loadUrl(
	//					"http://www.xnx3.com/xunxian/fuzhu/shenshan_kefu.html",
	//					200, 200, 420, 700);
	//		}
}
 
Example 10
Source File: SetHwnd.java    From xunxian with Apache License 2.0 5 votes vote down vote up
public static void setHwnd(){
	new Func.Message().showMessageDialog("点击确定后有1秒时间将鼠标<br/>指向要进行后台卦级的游戏窗口");
	try {
		new Func.Sleep().sleep(1000);
		Command.hwnd= Command.activeDm.invoke("GetMousePointWindow").getInt();
		String title=Command.activeDm.invoke("GetWindowTitle",Command.hwnd)+"";
		if(title.indexOf("寻仙")>-1){
			if(title.indexOf(Command.title)>-1){		//再次判断获取的不能为当前辅助软件窗口
				Command.hwnd=0;	//不是寻仙窗口,还原句柄
				if(new Func.Message().showConfirmDialog("失败!本次获取的为当前软件的窗口!<br/>请点击[获取目标窗口]按钮然后点了[确定]后<br/>将鼠标放到要挂机的寻仙游戏的窗口上。<br/><br/>是否要查看此操作详细说明?")==ConfirmationCallback.YES){
					Command.browser.loadUrl("http://www.xnx3.com/xunxian/xxautofight/20130626/41.html",200,200,800,600);
				}
			}else{		//获取正确
				Command.JForm.setHwndjLabel.setText("窗口句柄:"+Command.hwnd+",窗口名:"+title);
			}
		}else{
			if(new Func.Message().showConfirmDialog("获取窗口错误,不是寻仙窗口!<br/>点击获取目标窗口后将鼠标指向寻仙游戏<br/><br/>是否要查看此操作详细说明?")==ConfirmationCallback.YES){
				System.out.println("--");
				Command.browser.loadUrl("http://www.xnx3.com/xunxian/xxautofight/20130626/41.html",200,200,800,600);
			}
			Command.hwnd=0;	//不是寻仙窗口,还原句柄
			Command.JForm.setHwndjLabel.setText("请点击前面按钮获取目标窗口");
		}
		
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
Example 11
Source File: DialogCallbackHandler.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
void setCallback(ConfirmationCallback callback)
    throws UnsupportedCallbackException
{
    this.callback = callback;

    int confirmationOptionType = callback.getOptionType();
    switch (confirmationOptionType) {
    case ConfirmationCallback.YES_NO_OPTION:
        optionType = JOptionPane.YES_NO_OPTION;
        translations = new int[] {
            JOptionPane.YES_OPTION, ConfirmationCallback.YES,
            JOptionPane.NO_OPTION, ConfirmationCallback.NO,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.NO
        };
        break;
    case ConfirmationCallback.YES_NO_CANCEL_OPTION:
        optionType = JOptionPane.YES_NO_CANCEL_OPTION;
        translations = new int[] {
            JOptionPane.YES_OPTION, ConfirmationCallback.YES,
            JOptionPane.NO_OPTION, ConfirmationCallback.NO,
            JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL
        };
        break;
    case ConfirmationCallback.OK_CANCEL_OPTION:
        optionType = JOptionPane.OK_CANCEL_OPTION;
        translations = new int[] {
            JOptionPane.OK_OPTION, ConfirmationCallback.OK,
            JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL
        };
        break;
    case ConfirmationCallback.UNSPECIFIED_OPTION:
        options = callback.getOptions();
        /*
         * There's no way to know if the default option means
         * to cancel the login, but there isn't a better way
         * to guess this.
         */
        translations = new int[] {
            JOptionPane.CLOSED_OPTION, callback.getDefaultOption()
        };
        break;
    default:
        throw new UnsupportedCallbackException(
            callback,
            "Unrecognized option type: " + confirmationOptionType);
    }

    int confirmationMessageType = callback.getMessageType();
    switch (confirmationMessageType) {
    case ConfirmationCallback.WARNING:
        messageType = JOptionPane.WARNING_MESSAGE;
        break;
    case ConfirmationCallback.ERROR:
        messageType = JOptionPane.ERROR_MESSAGE;
        break;
    case ConfirmationCallback.INFORMATION:
        messageType = JOptionPane.INFORMATION_MESSAGE;
        break;
    default:
        throw new UnsupportedCallbackException(
            callback,
            "Unrecognized message type: " + confirmationMessageType);
    }
}
 
Example 12
Source File: DialogCallbackHandler.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
void setCallback(ConfirmationCallback callback)
    throws UnsupportedCallbackException
{
    this.callback = callback;

    int confirmationOptionType = callback.getOptionType();
    switch (confirmationOptionType) {
    case ConfirmationCallback.YES_NO_OPTION:
        optionType = JOptionPane.YES_NO_OPTION;
        translations = new int[] {
            JOptionPane.YES_OPTION, ConfirmationCallback.YES,
            JOptionPane.NO_OPTION, ConfirmationCallback.NO,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.NO
        };
        break;
    case ConfirmationCallback.YES_NO_CANCEL_OPTION:
        optionType = JOptionPane.YES_NO_CANCEL_OPTION;
        translations = new int[] {
            JOptionPane.YES_OPTION, ConfirmationCallback.YES,
            JOptionPane.NO_OPTION, ConfirmationCallback.NO,
            JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL
        };
        break;
    case ConfirmationCallback.OK_CANCEL_OPTION:
        optionType = JOptionPane.OK_CANCEL_OPTION;
        translations = new int[] {
            JOptionPane.OK_OPTION, ConfirmationCallback.OK,
            JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL
        };
        break;
    case ConfirmationCallback.UNSPECIFIED_OPTION:
        options = callback.getOptions();
        /*
         * There's no way to know if the default option means
         * to cancel the login, but there isn't a better way
         * to guess this.
         */
        translations = new int[] {
            JOptionPane.CLOSED_OPTION, callback.getDefaultOption()
        };
        break;
    default:
        throw new UnsupportedCallbackException(
            callback,
            "Unrecognized option type: " + confirmationOptionType);
    }

    int confirmationMessageType = callback.getMessageType();
    switch (confirmationMessageType) {
    case ConfirmationCallback.WARNING:
        messageType = JOptionPane.WARNING_MESSAGE;
        break;
    case ConfirmationCallback.ERROR:
        messageType = JOptionPane.ERROR_MESSAGE;
        break;
    case ConfirmationCallback.INFORMATION:
        messageType = JOptionPane.INFORMATION_MESSAGE;
        break;
    default:
        throw new UnsupportedCallbackException(
            callback,
            "Unrecognized message type: " + confirmationMessageType);
    }
}
 
Example 13
Source File: DialogCallbackHandler.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
void setCallback(ConfirmationCallback callback)
    throws UnsupportedCallbackException
{
    this.callback = callback;

    int confirmationOptionType = callback.getOptionType();
    switch (confirmationOptionType) {
    case ConfirmationCallback.YES_NO_OPTION:
        optionType = JOptionPane.YES_NO_OPTION;
        translations = new int[] {
            JOptionPane.YES_OPTION, ConfirmationCallback.YES,
            JOptionPane.NO_OPTION, ConfirmationCallback.NO,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.NO
        };
        break;
    case ConfirmationCallback.YES_NO_CANCEL_OPTION:
        optionType = JOptionPane.YES_NO_CANCEL_OPTION;
        translations = new int[] {
            JOptionPane.YES_OPTION, ConfirmationCallback.YES,
            JOptionPane.NO_OPTION, ConfirmationCallback.NO,
            JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL
        };
        break;
    case ConfirmationCallback.OK_CANCEL_OPTION:
        optionType = JOptionPane.OK_CANCEL_OPTION;
        translations = new int[] {
            JOptionPane.OK_OPTION, ConfirmationCallback.OK,
            JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL
        };
        break;
    case ConfirmationCallback.UNSPECIFIED_OPTION:
        options = callback.getOptions();
        /*
         * There's no way to know if the default option means
         * to cancel the login, but there isn't a better way
         * to guess this.
         */
        translations = new int[] {
            JOptionPane.CLOSED_OPTION, callback.getDefaultOption()
        };
        break;
    default:
        throw new UnsupportedCallbackException(
            callback,
            "Unrecognized option type: " + confirmationOptionType);
    }

    int confirmationMessageType = callback.getMessageType();
    switch (confirmationMessageType) {
    case ConfirmationCallback.WARNING:
        messageType = JOptionPane.WARNING_MESSAGE;
        break;
    case ConfirmationCallback.ERROR:
        messageType = JOptionPane.ERROR_MESSAGE;
        break;
    case ConfirmationCallback.INFORMATION:
        messageType = JOptionPane.INFORMATION_MESSAGE;
        break;
    default:
        throw new UnsupportedCallbackException(
            callback,
            "Unrecognized message type: " + confirmationMessageType);
    }
}
 
Example 14
Source File: DialogCallbackHandler.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
void setCallback(ConfirmationCallback callback)
    throws UnsupportedCallbackException
{
    this.callback = callback;

    int confirmationOptionType = callback.getOptionType();
    switch (confirmationOptionType) {
    case ConfirmationCallback.YES_NO_OPTION:
        optionType = JOptionPane.YES_NO_OPTION;
        translations = new int[] {
            JOptionPane.YES_OPTION, ConfirmationCallback.YES,
            JOptionPane.NO_OPTION, ConfirmationCallback.NO,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.NO
        };
        break;
    case ConfirmationCallback.YES_NO_CANCEL_OPTION:
        optionType = JOptionPane.YES_NO_CANCEL_OPTION;
        translations = new int[] {
            JOptionPane.YES_OPTION, ConfirmationCallback.YES,
            JOptionPane.NO_OPTION, ConfirmationCallback.NO,
            JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL
        };
        break;
    case ConfirmationCallback.OK_CANCEL_OPTION:
        optionType = JOptionPane.OK_CANCEL_OPTION;
        translations = new int[] {
            JOptionPane.OK_OPTION, ConfirmationCallback.OK,
            JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL
        };
        break;
    case ConfirmationCallback.UNSPECIFIED_OPTION:
        options = callback.getOptions();
        /*
         * There's no way to know if the default option means
         * to cancel the login, but there isn't a better way
         * to guess this.
         */
        translations = new int[] {
            JOptionPane.CLOSED_OPTION, callback.getDefaultOption()
        };
        break;
    default:
        throw new UnsupportedCallbackException(
            callback,
            "Unrecognized option type: " + confirmationOptionType);
    }

    int confirmationMessageType = callback.getMessageType();
    switch (confirmationMessageType) {
    case ConfirmationCallback.WARNING:
        messageType = JOptionPane.WARNING_MESSAGE;
        break;
    case ConfirmationCallback.ERROR:
        messageType = JOptionPane.ERROR_MESSAGE;
        break;
    case ConfirmationCallback.INFORMATION:
        messageType = JOptionPane.INFORMATION_MESSAGE;
        break;
    default:
        throw new UnsupportedCallbackException(
            callback,
            "Unrecognized message type: " + confirmationMessageType);
    }
}
 
Example 15
Source File: DialogCallbackHandler.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
void setCallback(ConfirmationCallback callback)
    throws UnsupportedCallbackException
{
    this.callback = callback;

    int confirmationOptionType = callback.getOptionType();
    switch (confirmationOptionType) {
    case ConfirmationCallback.YES_NO_OPTION:
        optionType = JOptionPane.YES_NO_OPTION;
        translations = new int[] {
            JOptionPane.YES_OPTION, ConfirmationCallback.YES,
            JOptionPane.NO_OPTION, ConfirmationCallback.NO,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.NO
        };
        break;
    case ConfirmationCallback.YES_NO_CANCEL_OPTION:
        optionType = JOptionPane.YES_NO_CANCEL_OPTION;
        translations = new int[] {
            JOptionPane.YES_OPTION, ConfirmationCallback.YES,
            JOptionPane.NO_OPTION, ConfirmationCallback.NO,
            JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL
        };
        break;
    case ConfirmationCallback.OK_CANCEL_OPTION:
        optionType = JOptionPane.OK_CANCEL_OPTION;
        translations = new int[] {
            JOptionPane.OK_OPTION, ConfirmationCallback.OK,
            JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL
        };
        break;
    case ConfirmationCallback.UNSPECIFIED_OPTION:
        options = callback.getOptions();
        /*
         * There's no way to know if the default option means
         * to cancel the login, but there isn't a better way
         * to guess this.
         */
        translations = new int[] {
            JOptionPane.CLOSED_OPTION, callback.getDefaultOption()
        };
        break;
    default:
        throw new UnsupportedCallbackException(
            callback,
            "Unrecognized option type: " + confirmationOptionType);
    }

    int confirmationMessageType = callback.getMessageType();
    switch (confirmationMessageType) {
    case ConfirmationCallback.WARNING:
        messageType = JOptionPane.WARNING_MESSAGE;
        break;
    case ConfirmationCallback.ERROR:
        messageType = JOptionPane.ERROR_MESSAGE;
        break;
    case ConfirmationCallback.INFORMATION:
        messageType = JOptionPane.INFORMATION_MESSAGE;
        break;
    default:
        throw new UnsupportedCallbackException(
            callback,
            "Unrecognized message type: " + confirmationMessageType);
    }
}
 
Example 16
Source File: DialogCallbackHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
void setCallback(ConfirmationCallback callback)
    throws UnsupportedCallbackException
{
    this.callback = callback;

    int confirmationOptionType = callback.getOptionType();
    switch (confirmationOptionType) {
    case ConfirmationCallback.YES_NO_OPTION:
        optionType = JOptionPane.YES_NO_OPTION;
        translations = new int[] {
            JOptionPane.YES_OPTION, ConfirmationCallback.YES,
            JOptionPane.NO_OPTION, ConfirmationCallback.NO,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.NO
        };
        break;
    case ConfirmationCallback.YES_NO_CANCEL_OPTION:
        optionType = JOptionPane.YES_NO_CANCEL_OPTION;
        translations = new int[] {
            JOptionPane.YES_OPTION, ConfirmationCallback.YES,
            JOptionPane.NO_OPTION, ConfirmationCallback.NO,
            JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL
        };
        break;
    case ConfirmationCallback.OK_CANCEL_OPTION:
        optionType = JOptionPane.OK_CANCEL_OPTION;
        translations = new int[] {
            JOptionPane.OK_OPTION, ConfirmationCallback.OK,
            JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL
        };
        break;
    case ConfirmationCallback.UNSPECIFIED_OPTION:
        options = callback.getOptions();
        /*
         * There's no way to know if the default option means
         * to cancel the login, but there isn't a better way
         * to guess this.
         */
        translations = new int[] {
            JOptionPane.CLOSED_OPTION, callback.getDefaultOption()
        };
        break;
    default:
        throw new UnsupportedCallbackException(
            callback,
            "Unrecognized option type: " + confirmationOptionType);
    }

    int confirmationMessageType = callback.getMessageType();
    switch (confirmationMessageType) {
    case ConfirmationCallback.WARNING:
        messageType = JOptionPane.WARNING_MESSAGE;
        break;
    case ConfirmationCallback.ERROR:
        messageType = JOptionPane.ERROR_MESSAGE;
        break;
    case ConfirmationCallback.INFORMATION:
        messageType = JOptionPane.INFORMATION_MESSAGE;
        break;
    default:
        throw new UnsupportedCallbackException(
            callback,
            "Unrecognized message type: " + confirmationMessageType);
    }
}
 
Example 17
Source File: DialogCallbackHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
void setCallback(ConfirmationCallback callback)
    throws UnsupportedCallbackException
{
    this.callback = callback;

    int confirmationOptionType = callback.getOptionType();
    switch (confirmationOptionType) {
    case ConfirmationCallback.YES_NO_OPTION:
        optionType = JOptionPane.YES_NO_OPTION;
        translations = new int[] {
            JOptionPane.YES_OPTION, ConfirmationCallback.YES,
            JOptionPane.NO_OPTION, ConfirmationCallback.NO,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.NO
        };
        break;
    case ConfirmationCallback.YES_NO_CANCEL_OPTION:
        optionType = JOptionPane.YES_NO_CANCEL_OPTION;
        translations = new int[] {
            JOptionPane.YES_OPTION, ConfirmationCallback.YES,
            JOptionPane.NO_OPTION, ConfirmationCallback.NO,
            JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL
        };
        break;
    case ConfirmationCallback.OK_CANCEL_OPTION:
        optionType = JOptionPane.OK_CANCEL_OPTION;
        translations = new int[] {
            JOptionPane.OK_OPTION, ConfirmationCallback.OK,
            JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL
        };
        break;
    case ConfirmationCallback.UNSPECIFIED_OPTION:
        options = callback.getOptions();
        /*
         * There's no way to know if the default option means
         * to cancel the login, but there isn't a better way
         * to guess this.
         */
        translations = new int[] {
            JOptionPane.CLOSED_OPTION, callback.getDefaultOption()
        };
        break;
    default:
        throw new UnsupportedCallbackException(
            callback,
            "Unrecognized option type: " + confirmationOptionType);
    }

    int confirmationMessageType = callback.getMessageType();
    switch (confirmationMessageType) {
    case ConfirmationCallback.WARNING:
        messageType = JOptionPane.WARNING_MESSAGE;
        break;
    case ConfirmationCallback.ERROR:
        messageType = JOptionPane.ERROR_MESSAGE;
        break;
    case ConfirmationCallback.INFORMATION:
        messageType = JOptionPane.INFORMATION_MESSAGE;
        break;
    default:
        throw new UnsupportedCallbackException(
            callback,
            "Unrecognized message type: " + confirmationMessageType);
    }
}
 
Example 18
Source File: DialogCallbackHandler.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
void setCallback(ConfirmationCallback callback)
    throws UnsupportedCallbackException
{
    this.callback = callback;

    int confirmationOptionType = callback.getOptionType();
    switch (confirmationOptionType) {
    case ConfirmationCallback.YES_NO_OPTION:
        optionType = JOptionPane.YES_NO_OPTION;
        translations = new int[] {
            JOptionPane.YES_OPTION, ConfirmationCallback.YES,
            JOptionPane.NO_OPTION, ConfirmationCallback.NO,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.NO
        };
        break;
    case ConfirmationCallback.YES_NO_CANCEL_OPTION:
        optionType = JOptionPane.YES_NO_CANCEL_OPTION;
        translations = new int[] {
            JOptionPane.YES_OPTION, ConfirmationCallback.YES,
            JOptionPane.NO_OPTION, ConfirmationCallback.NO,
            JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL
        };
        break;
    case ConfirmationCallback.OK_CANCEL_OPTION:
        optionType = JOptionPane.OK_CANCEL_OPTION;
        translations = new int[] {
            JOptionPane.OK_OPTION, ConfirmationCallback.OK,
            JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL
        };
        break;
    case ConfirmationCallback.UNSPECIFIED_OPTION:
        options = callback.getOptions();
        /*
         * There's no way to know if the default option means
         * to cancel the login, but there isn't a better way
         * to guess this.
         */
        translations = new int[] {
            JOptionPane.CLOSED_OPTION, callback.getDefaultOption()
        };
        break;
    default:
        throw new UnsupportedCallbackException(
            callback,
            "Unrecognized option type: " + confirmationOptionType);
    }

    int confirmationMessageType = callback.getMessageType();
    switch (confirmationMessageType) {
    case ConfirmationCallback.WARNING:
        messageType = JOptionPane.WARNING_MESSAGE;
        break;
    case ConfirmationCallback.ERROR:
        messageType = JOptionPane.ERROR_MESSAGE;
        break;
    case ConfirmationCallback.INFORMATION:
        messageType = JOptionPane.INFORMATION_MESSAGE;
        break;
    default:
        throw new UnsupportedCallbackException(
            callback,
            "Unrecognized message type: " + confirmationMessageType);
    }
}
 
Example 19
Source File: DialogCallbackHandler.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
void setCallback(ConfirmationCallback callback)
    throws UnsupportedCallbackException
{
    this.callback = callback;

    int confirmationOptionType = callback.getOptionType();
    switch (confirmationOptionType) {
    case ConfirmationCallback.YES_NO_OPTION:
        optionType = JOptionPane.YES_NO_OPTION;
        translations = new int[] {
            JOptionPane.YES_OPTION, ConfirmationCallback.YES,
            JOptionPane.NO_OPTION, ConfirmationCallback.NO,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.NO
        };
        break;
    case ConfirmationCallback.YES_NO_CANCEL_OPTION:
        optionType = JOptionPane.YES_NO_CANCEL_OPTION;
        translations = new int[] {
            JOptionPane.YES_OPTION, ConfirmationCallback.YES,
            JOptionPane.NO_OPTION, ConfirmationCallback.NO,
            JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL
        };
        break;
    case ConfirmationCallback.OK_CANCEL_OPTION:
        optionType = JOptionPane.OK_CANCEL_OPTION;
        translations = new int[] {
            JOptionPane.OK_OPTION, ConfirmationCallback.OK,
            JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL
        };
        break;
    case ConfirmationCallback.UNSPECIFIED_OPTION:
        options = callback.getOptions();
        /*
         * There's no way to know if the default option means
         * to cancel the login, but there isn't a better way
         * to guess this.
         */
        translations = new int[] {
            JOptionPane.CLOSED_OPTION, callback.getDefaultOption()
        };
        break;
    default:
        throw new UnsupportedCallbackException(
            callback,
            "Unrecognized option type: " + confirmationOptionType);
    }

    int confirmationMessageType = callback.getMessageType();
    switch (confirmationMessageType) {
    case ConfirmationCallback.WARNING:
        messageType = JOptionPane.WARNING_MESSAGE;
        break;
    case ConfirmationCallback.ERROR:
        messageType = JOptionPane.ERROR_MESSAGE;
        break;
    case ConfirmationCallback.INFORMATION:
        messageType = JOptionPane.INFORMATION_MESSAGE;
        break;
    default:
        throw new UnsupportedCallbackException(
            callback,
            "Unrecognized message type: " + confirmationMessageType);
    }
}
 
Example 20
Source File: DialogCallbackHandler.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
void setCallback(ConfirmationCallback callback)
    throws UnsupportedCallbackException
{
    this.callback = callback;

    int confirmationOptionType = callback.getOptionType();
    switch (confirmationOptionType) {
    case ConfirmationCallback.YES_NO_OPTION:
        optionType = JOptionPane.YES_NO_OPTION;
        translations = new int[] {
            JOptionPane.YES_OPTION, ConfirmationCallback.YES,
            JOptionPane.NO_OPTION, ConfirmationCallback.NO,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.NO
        };
        break;
    case ConfirmationCallback.YES_NO_CANCEL_OPTION:
        optionType = JOptionPane.YES_NO_CANCEL_OPTION;
        translations = new int[] {
            JOptionPane.YES_OPTION, ConfirmationCallback.YES,
            JOptionPane.NO_OPTION, ConfirmationCallback.NO,
            JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL
        };
        break;
    case ConfirmationCallback.OK_CANCEL_OPTION:
        optionType = JOptionPane.OK_CANCEL_OPTION;
        translations = new int[] {
            JOptionPane.OK_OPTION, ConfirmationCallback.OK,
            JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL,
            JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL
        };
        break;
    case ConfirmationCallback.UNSPECIFIED_OPTION:
        options = callback.getOptions();
        /*
         * There's no way to know if the default option means
         * to cancel the login, but there isn't a better way
         * to guess this.
         */
        translations = new int[] {
            JOptionPane.CLOSED_OPTION, callback.getDefaultOption()
        };
        break;
    default:
        throw new UnsupportedCallbackException(
            callback,
            "Unrecognized option type: " + confirmationOptionType);
    }

    int confirmationMessageType = callback.getMessageType();
    switch (confirmationMessageType) {
    case ConfirmationCallback.WARNING:
        messageType = JOptionPane.WARNING_MESSAGE;
        break;
    case ConfirmationCallback.ERROR:
        messageType = JOptionPane.ERROR_MESSAGE;
        break;
    case ConfirmationCallback.INFORMATION:
        messageType = JOptionPane.INFORMATION_MESSAGE;
        break;
    default:
        throw new UnsupportedCallbackException(
            callback,
            "Unrecognized message type: " + confirmationMessageType);
    }
}