当前位置: 首页>>代码示例>>Java>>正文


Java UIDescriptor.getUIFactory方法代码示例

本文整理汇总了Java中net.jini.lookup.entry.UIDescriptor.getUIFactory方法的典型用法代码示例。如果您正苦于以下问题:Java UIDescriptor.getUIFactory方法的具体用法?Java UIDescriptor.getUIFactory怎么用?Java UIDescriptor.getUIFactory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.jini.lookup.entry.UIDescriptor的用法示例。


在下文中一共展示了UIDescriptor.getUIFactory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: actionPerformed

import net.jini.lookup.entry.UIDescriptor; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent anEvent) {

	    UIDescriptor uiDescriptor = getSelectedUIDescriptor();

	    if (uiDescriptor == null) {
		return;
	    }

	    try {
		JFrameFactory uiFactory = (JFrameFactory)
		    uiDescriptor.getUIFactory(Thread.currentThread().getContextClassLoader());
		JFrame frame = uiFactory.getJFrame(serviceItem);

		frame.validate();
		frame.setVisible(true);
	    }
	    catch (Exception e) {
		e.printStackTrace();

		return;
	    }
	}
 
开发者ID:apache,项目名称:river-container,代码行数:23,代码来源:ServiceBrowser.java

示例2: actionPerformed

import net.jini.lookup.entry.UIDescriptor; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent ev) {
    String command = ev.getActionCommand();

    if (command.equals("showInfo")) {
        Class[] infs = getInterfaces(item.service.getClass());
        String[] msg = new String[3 + infs.length];
        msg[0] = "ServiceID: " + item.serviceID;
        msg[1] = ("Service Instance: "
                + item.service.getClass().getName());
        if (infs.length == 1) {
            msg[2] = "Implemented Interface:";
        } else {
            msg[2] = "Implemented Interfaces:";
        }
        for (int i = 0; i < infs.length; i++) {
            msg[3 + i] = infs[i].getName();
        }

        JOptionPane.showMessageDialog(Browser.this,
                msg,
                "ServiceItem Information",
                JOptionPane.INFORMATION_MESSAGE);
    } else if (command.equals("browseService")) {
        new ServiceBrowser(item, lookup,
                Browser.this).setVisible(true);
    } else if (command.equals("adminService")) {
        new ServiceEditor(item, listItem.getAdmin(),
                lookup, Browser.this).setVisible(true);
    } else if (command.equals("browseEntry")) {
        // Not supported at the present time.
    } else if (command.equals("showUI")) {
        UIDescriptor uiDescriptor = getSelectedUIDescriptor();

        if (uiDescriptor == null) {
            return;
        }

        try {
            JFrameFactory uiFactory = (JFrameFactory) uiDescriptor.getUIFactory(
                    Thread.currentThread().getContextClassLoader());
            JFrame frame = uiFactory.getJFrame(item);

            frame.validate();
            frame.setVisible(true);
        } catch (Exception e) {
            logger.log(Level.INFO, "show ui failed", e);
            JOptionPane.showMessageDialog(Browser.this,
                    e.getMessage(),
                    e.getClass().getName(),
                    JOptionPane.WARNING_MESSAGE);
            return;
        }
    }
}
 
开发者ID:apache,项目名称:river-container,代码行数:55,代码来源:Browser.java


注:本文中的net.jini.lookup.entry.UIDescriptor.getUIFactory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。