use of com.servoy.j2db.plugins.IClientPlugin in project servoy-client by Servoy.
the class PluginScope method getIds.
/**
* @see com.servoy.j2db.scripting.DefaultScope#getIds()
*/
@Override
public Object[] getIds() {
if (application.getPluginManager() == null)
return new Object[0];
List<IClientPlugin> lst = application.getPluginManager().getPlugins(IClientPlugin.class);
Object[] array = new String[lst.size()];
for (int i = 0; i < lst.size(); i++) {
IClientPlugin plugin = lst.get(i);
array[i] = plugin.getName();
}
Arrays.sort(array);
return array;
}
use of com.servoy.j2db.plugins.IClientPlugin in project servoy-client by Servoy.
the class JSApplication method js_writeXMLFile.
/**
* @deprecated As of release 2.x, replaced by {@link plugins.file#writeXMLFile(Object, String)}.
*/
@Deprecated
public boolean js_writeXMLFile(String fileName, String xml) {
// $NON-NLS-1$
IClientPlugin cp = application.getPluginManager().getPlugin(IClientPlugin.class, "file");
if (cp != null) {
IScriptable so = cp.getScriptObject();
if (so != null) {
try {
// $NON-NLS-1$
Method m = so.getClass().getMethod("js_writeXMLFile", new Class[] { String.class, String.class });
Boolean obj = (Boolean) m.invoke(so, new Object[] { fileName, xml });
if (obj != null)
return obj.booleanValue();
return false;
} catch (Exception e) {
Debug.error(e);
}
}
}
application.reportError("Writing to xml file failed", "For this operation the file plugin is needed\nNote this method is deprecated, use the plugin directly in your code");
return false;
}
use of com.servoy.j2db.plugins.IClientPlugin in project servoy-client by Servoy.
the class JSApplication method js_showFileOpenDialog.
/**
* @deprecated As of release 2.x, replaced by {@link plugins.file#showFileOpenDialog(Object[])}.
*/
@Deprecated
public String js_showFileOpenDialog() {
// $NON-NLS-1$
IClientPlugin cp = application.getPluginManager().getPlugin(IClientPlugin.class, "file");
if (cp != null) {
IScriptable so = cp.getScriptObject();
if (so != null) {
try {
// $NON-NLS-1$
Method m = so.getClass().getMethod("js_showFileOpenDialog", new Class[] {});
Object obj = m.invoke(so, (Object[]) null);
if (obj != null)
return obj.toString();
return null;
} catch (Exception e) {
Debug.error(e);
}
}
}
application.reportError("Showing file open dialog failed", "For this operation the file plugin is needed\nNote this method is deprecated, use the plugin directly in your code");
return null;
}
use of com.servoy.j2db.plugins.IClientPlugin in project servoy-client by Servoy.
the class JSApplication method js_writeFile.
/**
* @deprecated As of release 2.x, replaced by {@link plugins.file#writeFile(Object, byte[])}.
*/
@Deprecated
public boolean js_writeFile(String fileName, byte[] data) {
// $NON-NLS-1$
IClientPlugin cp = application.getPluginManager().getPlugin(IClientPlugin.class, "file");
if (cp != null) {
IScriptable so = cp.getScriptObject();
if (so != null) {
try {
// $NON-NLS-1$
Method m = so.getClass().getMethod("js_writeFile", new Class[] { String.class, byte[].class });
Boolean obj = (Boolean) m.invoke(so, new Object[] { fileName, data });
if (obj != null)
return obj.booleanValue();
return false;
} catch (Exception e) {
Debug.error(e);
}
}
}
application.reportError("Writing to file failed", "For this operation the file plugin is needed\nNote this method is deprecated, use the plugin directly in your code");
return false;
}
use of com.servoy.j2db.plugins.IClientPlugin in project servoy-client by Servoy.
the class JSApplication method js_readTXTFile.
/**
* @deprecated As of release 2.x, replaced by {@link plugins.file#readTXTFile(Object[])}.
*/
@Deprecated
public String js_readTXTFile(Object[] args) {
// $NON-NLS-1$
IClientPlugin cp = application.getPluginManager().getPlugin(IClientPlugin.class, "file");
if (cp != null) {
IScriptable so = cp.getScriptObject();
if (so != null) {
try {
// $NON-NLS-1$
Method m = so.getClass().getMethod("js_readTXTFile", getClassArrayFromObjectArgs(args));
Object obj = m.invoke(so, args);
if (obj != null)
return obj.toString();
return null;
} catch (Exception e) {
Debug.error(e);
}
}
}
application.reportError("Reading from file failed", "For this operation the file plugin is needed\nNote this method is deprecated, use the plugin directly in your code");
return null;
}
Aggregations