use of com.twinsoft.convertigo.beans.connectors.HtmlConnector in project convertigo by convertigo.
the class ComponentInfoWizardPage method fillTree.
public void fillTree(Class<? extends DatabaseObject> beanClass) {
treeItemName = null;
tree.removeAll();
if (parentObject instanceof Transaction) {
Connector connector = (Connector) ((Transaction) parentObject).getParent();
boolean isScreenClassAware = connector instanceof IScreenClassContainer<?>;
if (beanClass.equals(ScEntryHandlerStatement.class) || beanClass.equals(ScExitHandlerStatement.class)) {
if (isScreenClassAware) {
if (connector instanceof HtmlConnector) {
HtmlConnector htmlConnector = (HtmlConnector) connector;
ScreenClass defaultScreenClass = htmlConnector.getDefaultScreenClass();
TreeItem branch = new TreeItem(tree, SWT.NONE);
branch.setText(defaultScreenClass.getName());
List<ScreenClass> screenClasses = defaultScreenClass.getInheritedScreenClasses();
for (ScreenClass screenClass : screenClasses) {
getInHeritedScreenClass(screenClass, branch);
}
} else if (connector instanceof JavelinConnector) {
JavelinConnector javelinConnector = (JavelinConnector) connector;
ScreenClass defaultScreenClass = javelinConnector.getDefaultScreenClass();
TreeItem branch = new TreeItem(tree, SWT.NONE);
branch.setText(defaultScreenClass.getName());
List<ScreenClass> screenClasses = defaultScreenClass.getInheritedScreenClasses();
for (ScreenClass screenClass : screenClasses) {
getInHeritedScreenClass(screenClass, branch);
}
}
tree.setVisible(true);
}
} else if (beanClass.equals(HandlerStatement.class)) {
TreeItem branch;
branch = new TreeItem(tree, SWT.NONE);
branch.setText(HandlerStatement.EVENT_TRANSACTION_STARTED);
branch = new TreeItem(tree, SWT.NONE);
branch.setText(HandlerStatement.EVENT_XML_GENERATED);
tree.setVisible(true);
} else
tree.setVisible(false);
}
}
use of com.twinsoft.convertigo.beans.connectors.HtmlConnector in project convertigo by convertigo.
the class ObjectInfoWizardPage method fillTree.
public void fillTree(Class<? extends DatabaseObject> beanClass) {
treeItemName = null;
tree.removeAll();
if (parentObject instanceof Transaction) {
Connector connector = (Connector) ((Transaction) parentObject).getParent();
boolean isScreenClassAware = connector instanceof IScreenClassContainer<?>;
if (beanClass.equals(ScEntryHandlerStatement.class) || beanClass.equals(ScExitHandlerStatement.class)) {
if (isScreenClassAware) {
if (connector instanceof HtmlConnector) {
HtmlConnector htmlConnector = (HtmlConnector) connector;
ScreenClass defaultScreenClass = htmlConnector.getDefaultScreenClass();
TreeItem branch = new TreeItem(tree, SWT.NONE);
branch.setText(defaultScreenClass.getName());
List<ScreenClass> screenClasses = defaultScreenClass.getInheritedScreenClasses();
for (ScreenClass screenClass : screenClasses) {
getInHeritedScreenClass(screenClass, branch);
}
} else if (connector instanceof JavelinConnector) {
JavelinConnector javelinConnector = (JavelinConnector) connector;
ScreenClass defaultScreenClass = javelinConnector.getDefaultScreenClass();
TreeItem branch = new TreeItem(tree, SWT.NONE);
branch.setText(defaultScreenClass.getName());
List<ScreenClass> screenClasses = defaultScreenClass.getInheritedScreenClasses();
for (ScreenClass screenClass : screenClasses) {
getInHeritedScreenClass(screenClass, branch);
}
}
tree.setVisible(true);
}
} else if (beanClass.equals(HandlerStatement.class)) {
TreeItem branch;
branch = new TreeItem(tree, SWT.NONE);
branch.setText(HandlerStatement.EVENT_TRANSACTION_STARTED);
branch = new TreeItem(tree, SWT.NONE);
branch.setText(HandlerStatement.EVENT_XML_GENERATED);
tree.setVisible(true);
} else
tree.setVisible(false);
}
}
use of com.twinsoft.convertigo.beans.connectors.HtmlConnector in project convertigo by convertigo.
the class TabManagementStatement method execute.
@Override
public boolean execute(Context javascriptContext, Scriptable scope) throws EngineException {
if (isEnabled()) {
if (super.execute(javascriptContext, scope)) {
HtmlTransaction htmlTransaction = (HtmlTransaction) getParentTransaction();
HtmlConnector htmlConnector = (HtmlConnector) htmlTransaction.getParent();
TabManagementEvent evt;
if (action.equalsIgnoreCase(TabManagementEvent.ACTION_SETINDEX)) {
try {
evaluate(javascriptContext, scope, jsIndex, "jsIndex", false);
int index = (int) Double.parseDouble(evaluated.toString());
evt = new TabManagementEvent(action, index);
} catch (Exception e) {
throw new EngineException("Tab index value isn't good.", e);
}
} else {
evt = new TabManagementEvent(action);
}
HtmlParser htmlParser = htmlConnector.getHtmlParser();
boolean success = htmlParser.dispatchEvent(evt, htmlTransaction.context, null);
if (!success)
Engine.logBeans.debug("NavigationBarStatement has failed");
else {
if (action.equalsIgnoreCase(TabManagementEvent.ACTION_GETINDEX)) {
String code = getIndexVarname + "=" + evt.getIndex();
evaluate(javascriptContext, scope, code, "ContextGet", true);
} else if (action.equalsIgnoreCase(TabManagementEvent.ACTION_GETNBTAB)) {
String code = getIndexVarname + "=" + evt.getNbTab();
evaluate(javascriptContext, scope, code, "ContextGet", true);
}
}
success = true;
return success;
}
}
return false;
}
use of com.twinsoft.convertigo.beans.connectors.HtmlConnector in project convertigo by convertigo.
the class WaitTriggerStatement method execute.
@Override
public boolean execute(Context javascriptContext, Scriptable scope) throws EngineException {
if (isEnabled()) {
if (super.execute(javascriptContext, scope)) {
HtmlTransaction htmlTransaction = getParentTransaction();
HtmlConnector htmlConnector = (HtmlConnector) htmlTransaction.getParent();
htmlConnector.getHtmlParser().waitTrigger(htmlTransaction.context, trigger.getTrigger());
return true;
}
}
return false;
}
use of com.twinsoft.convertigo.beans.connectors.HtmlConnector in project convertigo by convertigo.
the class ScHandlerStatement method getTagsForProperty.
@Override
public String[] getTagsForProperty(String propertyName) {
if (propertyName.equals("normalizedScreenClassName")) {
HtmlConnector connector = (HtmlConnector) getParent().getParent();
List<HtmlScreenClass> v = connector.getAllScreenClasses();
String[] sNames = new String[v.size() + 1];
sNames[0] = "";
for (int i = 1; i <= v.size(); i++) {
ScreenClass screenClass = (ScreenClass) v.get(i - 1);
String normalizedScreenClassName = StringUtils.normalize(screenClass.getName());
sNames[i] = normalizedScreenClassName;
}
return sNames;
}
return super.getTagsForProperty(propertyName);
}
Aggregations