use of php.runtime.memory.ObjectMemory in project jphp by jphp-compiler.
the class ObjectInvokeHelper method unsetProperty.
public static void unsetProperty(Memory object, String property, Environment env, TraceInfo trace, PropertyCallCache callCache, int cacheIndex) throws Throwable {
object = object.toValue();
if (!object.isObject()) {
env.error(trace, Messages.ERR_CANNOT_GET_PROPERTY_OF_NON_OBJECT.fetch(property));
}
IObject iObject = ((ObjectMemory) object).value;
iObject.getReflection().unsetProperty(env, trace, iObject, property, callCache, cacheIndex);
}
use of php.runtime.memory.ObjectMemory in project jphp by jphp-compiler.
the class ObjectInvokeHelper method emptyProperty.
public static Memory emptyProperty(Memory object, String property, Environment env, TraceInfo trace, PropertyCallCache callCache, int cacheIndex) throws Throwable {
object = object.toValue();
if (!object.isObject()) {
return Memory.NULL;
//env.error(trace, Messages.ERR_CANNOT_GET_PROPERTY_OF_NON_OBJECT.fetch(property));
}
IObject iObject = ((ObjectMemory) object).value;
return iObject.getReflection().emptyProperty(env, trace, iObject, property);
}
use of php.runtime.memory.ObjectMemory in project jphp by jphp-compiler.
the class UITree method __getSelectedNodes.
@Signature
protected Memory __getSelectedNodes(Environment env, Memory... args) {
ArrayMemory r = new ArrayMemory();
TreePath[] paths = component.getContent().getSelectionPaths();
if (paths == null)
return r.toConstant();
for (TreePath p : paths) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) p.getLastPathComponent();
r.add(new ObjectMemory(new WrapTreeNode(env, node)));
}
return r.toArray();
}
use of php.runtime.memory.ObjectMemory in project jphp by jphp-compiler.
the class UIAbstractButton method getSelectedButtons.
@Signature(@Arg("buttonGroup"))
public static Memory getSelectedButtons(Environment env, Memory... args) {
ButtonGroup group = SwingExtension.getOrCreateButtonGroup(args[0].toString());
if (group == null)
return new ArrayMemory().toConstant();
Object[] selected = group.getSelection().getSelectedObjects();
ArrayMemory result = new ArrayMemory();
if (selected != null)
for (Object btn : selected) {
result.add(new ObjectMemory(UIElement.of(env, (Component) btn)));
}
return result.toConstant();
}
use of php.runtime.memory.ObjectMemory in project jphp by jphp-compiler.
the class UIAbstractButton method getButtons.
@Signature(@Arg("buttonGroup"))
public static Memory getButtons(Environment env, Memory... args) {
ButtonGroup group = SwingExtension.getOrCreateButtonGroup(args[0].toString());
if (group == null)
return new ArrayMemory().toConstant();
ArrayMemory result = new ArrayMemory();
for (AbstractButton btn : Collections.list(group.getElements())) {
result.add(new ObjectMemory(UIElement.of(env, btn)));
}
return result.toConstant();
}
Aggregations