本文整理汇总了Java中net.jini.lookup.entry.UIDescriptor类的典型用法代码示例。如果您正苦于以下问题:Java UIDescriptor类的具体用法?Java UIDescriptor怎么用?Java UIDescriptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UIDescriptor类属于net.jini.lookup.entry包,在下文中一共展示了UIDescriptor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSelectedUIDescriptor
import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
private UIDescriptor getSelectedUIDescriptor() {
if (!(new ServiceListItem(item)).isUI()) {
return null;
}
Entry[] attrs = item.attributeSets;
if ((attrs != null) && (attrs.length != 0)) {
for (int i = 0; i < attrs.length; i++) {
if (attrs[i] instanceof UIDescriptor) {
UIDescriptor desc = (UIDescriptor) attrs[i];
if (!"javax.swing".equals(desc.toolkit)) {
continue;
}
return desc;
}
}
}
return null;
}
示例2: 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;
}
}
示例3: mouseReleased
import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
public void mouseReleased(MouseEvent ev) {
higlightSelection(ev);
if (!ev.isPopupTrigger()) {
return;
}
UIDescriptor selectedDescriptor = getSelectedUIDescriptor();
if (selectedDescriptor == null) {
return;
}
if (!"javax.swing".equals(selectedDescriptor.toolkit)) {
return;
}
popup.setServiceItem(serviceItem);
popup.show(ev.getComponent(), ev.getX(), ev.getY());
}
示例4: mousePressed
import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
public void mousePressed(MouseEvent ev) {
higlightSelection(ev);
if (!ev.isPopupTrigger()) {
return;
}
UIDescriptor selectedDescriptor = getSelectedUIDescriptor();
if (selectedDescriptor == null) {
return;
}
if (!"javax.swing".equals(selectedDescriptor.toolkit)) {
return;
}
popup.setServiceItem(serviceItem);
popup.show(ev.getComponent(), ev.getX(), ev.getY());
}
示例5: getSelectedUIDescriptor
import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
private UIDescriptor getSelectedUIDescriptor() {
ObjectNode selectedNode =
(ObjectNode) attrPanel.tree.getLastSelectedPathComponent();
if (selectedNode == null) {
return null;
}
Object selectedObject = selectedNode.getObject();
try {
return (UIDescriptor) selectedObject;
}
catch (ClassCastException e) {
return null;
}
}
示例6: printLookupAttributes
import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
static public void printLookupAttributes(Entry[] attributeSets)
throws IOException, ClassNotFoundException {
if (attributeSets.length > 0) {
PrintStream out = NetworkShell.getShellOutputStream();
out.println("Lookup attributes:");
for (int k = 0; k < attributeSets.length; k++) {
if (attributeSets[k] instanceof UIDescriptor) {
out.println(" "
// + attributeSets[k].getClass()
// + "UIDescriptor: "
+ ((UIDescriptor) attributeSets[k]).factory
.get());
} else if (attributeSets[k] instanceof SorcerServiceInfo) {
printSorcerServiceInfo((SorcerServiceInfo) attributeSets[k]);
} else {
if (attributeSets[k] instanceof AbstractEntry) {
out.println(" "
+ toShortString((AbstractEntry) attributeSets[k]));
} else {
out.println(" " + attributeSets[k]);
}
}
}
}
}
示例7: getMainUIDescriptor
import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
/**
* Returns a service UI descriptor for LoggerManagerUI. The service
* UI allows for viewing remote logs of selected providers.
*/
/*
* (non-Java doc)
*
* @see sorcer.core.provider.ServiceProvider#getMainUIDescriptor()
*/
public static UIDescriptor getMainUIDescriptor() {
UIDescriptor uiDesc = null;
try {
URL uiUrl = new URL(Sorcer.getWebsterUrl() + "/sos-logger-"+ SOS.getSorcerVersion()+"-ui.jar");
URL helpUrl = new URL(Sorcer.getWebsterUrl() + "/logger.html");
uiDesc = UIDescriptorFactory.getUIDescriptor(MainUI.ROLE,
(JFrameFactory) new UIFrameFactory(new URL[]{uiUrl},
LoggerFrameUI.class
.getName(),
"Log Viewer",
helpUrl));
} catch (Exception ex) {
ex.printStackTrace();
}
return uiDesc;
}
示例8: isUI
import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
private boolean isUI() {
Entry[] attrs = item.attributeSets;
if ((attrs != null) && (attrs.length != 0)) {
for (int i = 0; i < attrs.length; i++) {
if (attrs[i] instanceof UIDescriptor) {
return true;
}
}
}
return false;
}
示例9: getUIDescriptor
import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
/**
* Returns a service UI descriptor for this service. Usually this method is
* used as an entry in provider configuration files when smart proxies are
* deployed with a standard off the shelf {@link sorcer.core.provider.ServiceProvider}.
*
* @return service UI descriptor
*/
public static UIDescriptor getUIDescriptor() {
UIDescriptor uiDesc = null;
try {
String serverVersion = System.getProperty("sorcer.version");
uiDesc = UIDescriptorFactory.getUIDescriptor(MainUI.ROLE,
new UIComponentFactory(new URL[] { new URL(Sorcer.getWebsterUrl() + "/adder-" + serverVersion + "-ui.jar") },
AdderUI.class.getName()));
} catch (Exception ex) {
logger.warn("getCalculatorDescriptor", ex);
}
return uiDesc;
}
示例10: getCalculatorDescriptor
import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
/**
* Returns a service UI descriptorfor this service. Usally this method is
* used as an entry in provider configuration files when smart proxies are
* deployed with a standard off the shelf {@link ServiceProvider}.
*
* @return service UI descriptor
*/
public static UIDescriptor getCalculatorDescriptor() {
UIDescriptor uiDesc = null;
try {
uiDesc = UIDescriptorFactory.getUIDescriptor(MainUI.ROLE,
new UIComponentFactory(new URL[] { new URL(Sorcer
.getWebsterUrl()
+ "/calculator-ui.jar") }, CalculatorUI.class
.getName()));
} catch (Exception ex) {
logger.warn("getCalculatorDescriptor", ex);
}
return uiDesc;
}
示例11: getCalculatorDescriptor
import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
public static UIDescriptor getCalculatorDescriptor() {
UIDescriptor uiDesc = null;
try {
uiDesc = UIDescriptorFactory.getUIDescriptor(MainUI.ROLE,
new UIComponentFactory(new URL[] { new URL(Sorcer
.getWebsterUrl()
+ "/calculator-ui.jar") }, CalculatorUI.class
.getName()));
} catch (Exception ex) {
// do nothing
}
return uiDesc;
}
示例12: getMainUIDescriptor
import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
public UIDescriptor getMainUIDescriptor() {
UIDescriptor uiDesc = null;
try {
URL uiUrl = new URL(Sorcer.getWebsterUrl() + "/sos-cataloger-"+ SOS.getSorcerVersion()+"-ui.jar");
uiDesc = UIDescriptorFactory.getUIDescriptor(MainUI.ROLE,
new UIFrameFactory(new URL[]{uiUrl},
CatalogerUI.class.getName(),
"Cataloger UI",
null));
} catch (Exception ex) {
logger.warn("Could not create UI descriptor", ex);
}
return uiDesc;
}
示例13: getUIRoles
import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
private Object[] getUIRoles(Entry atts[]) {
java.util.List list = new ArrayList();
for (int i = 0; atts != null && i < atts.length; i++)
if (atts[i] instanceof UIDescriptor) {
UIDescriptor desc = (UIDescriptor) atts[i];
if (desc.role != null)
list.add(desc.role);
}
return list.toArray();
}
示例14: getProviderUIDescriptor
import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
public static UIDescriptor getProviderUIDescriptor() {
UIDescriptor descriptor = null;
try {
descriptor = UIDescriptorFactory.getUIDescriptor(
MainUI.ROLE,
new UIComponentFactory(new URL[] { new URL(String.format("%s/sorcer-ui-%s.jar",
Sorcer.getWebsterUrl(),
SOS.getSorcerVersion()))
},
"sorcer.ui.provider.ProviderUI"));
} catch (Exception ex) {
logger.debug("getServiceUI", ex);
}
return descriptor;
}
示例15: getServiceUIEntries
import net.jini.lookup.entry.UIDescriptor; //导入依赖的package包/类
/**
* Returns an array of additional service UI descriptors to be included in a
* Jini service item that is registerd with lookup services. By default a
* generic ServiceProvider service UI is provided with: attribute viewer,
* context and task editor for this service provider.
*
* @return an array of service UI descriptors
*/
public UIDescriptor[] getServiceUIEntries() {
// Service UI as a panel of the ServiceBrowser
// UIDescriptor uiDesc1 = null;
// try {
// uiDesc1 = UIDescriptorFactory.getUIDescriptor(
// MainUI.ROLE,
// new UIComponentFactory(new URL[] {new URL(String.format("%s/sorcer-ui-%s.jar",
// Sorcer.getWebsterUrl(),
// SOS.getSorcerVersion()))
// },
// "sorcer.ui.exertlet.NetletEditor"));
// } catch (Exception ex) {
// logger.debug("getServiceUI", ex);
// }
// Service UI as a standalone frame is the ServiceBrowser
UIDescriptor uiDesc2 = null;
try {
URL uiUrl = new URL(Sorcer.getWebsterUrl() + "/exertlet-ui.jar");
URL helpUrl = new URL(Sorcer.getWebsterUrl()
+ "/exertlet/exertlet-ui.html");
// URL exportUrl, String className, String name, String helpFilename
uiDesc2 = UIDescriptorFactory.getUIDescriptor(MainUI.ROLE,
(JFrameFactory) new UIFrameFactory(new URL[] { uiUrl },
"sorcer.ui.exertlet.NetletUI", "Netlet Editor",
helpUrl));
} catch (Exception ex) {
logger.debug("getServiceUI", ex);
}
return new UIDescriptor[] { getProviderUIDescriptor(), uiDesc2 };
}