Search in sources :

Example 21 with Command

use of org.zkoss.bind.annotation.Command in project collect by openforis.

the class SurveySelectVM method editSelectedSurvey.

@Command
public void editSelectedSurvey() throws IOException {
    CollectSurvey temporarySurvey = loadSelectedSurveyForEdit();
    SurveyEditVM.redirectToSurveyEditPage(temporarySurvey.getId());
}
Also used : CollectSurvey(org.openforis.collect.model.CollectSurvey) Command(org.zkoss.bind.annotation.Command) GlobalCommand(org.zkoss.bind.annotation.GlobalCommand)

Example 22 with Command

use of org.zkoss.bind.annotation.Command in project collect by openforis.

the class SchemaVM method openMoveNodePopup.

@Command
public void openMoveNodePopup() {
    SchemaNodeData selectedTreeNode = getSelectedTreeNode();
    if (selectedTreeNode == null) {
        return;
    }
    SurveyObject selectedItem = selectedTreeNode.getSurveyObject();
    if (selectedItem instanceof NodeDefinition) {
        NodeDefinition selectedNode = (NodeDefinition) selectedItem;
        boolean changeParentNodeAllowed = checkChangeParentNodeAllowed(selectedNode);
        if (changeParentNodeAllowed) {
            openSelectParentNodePopupForReparent(selectedNode);
        }
    } else {
        // TODO support tab moving
        return;
    }
}
Also used : SurveyObject(org.openforis.idm.metamodel.SurveyObject) NodeDefinition(org.openforis.idm.metamodel.NodeDefinition) SchemaNodeData(org.openforis.collect.designer.component.SchemaTreeModel.SchemaNodeData) GlobalCommand(org.zkoss.bind.annotation.GlobalCommand) Command(org.zkoss.bind.annotation.Command)

Example 23 with Command

use of org.zkoss.bind.annotation.Command in project collect by openforis.

the class SchemaVM method addChildTab.

@Command
@NotifyChange({ "treeModel", "selectedTab" })
public void addChildTab(@ContextParam(ContextType.BINDER) Binder binder) {
    if (checkCanAddChildTab()) {
        UITab parentTab = getSelectedNodeParentTab();
        addTabInternal(binder, parentTab);
    }
}
Also used : UITab(org.openforis.collect.metamodel.ui.UITab) NotifyChange(org.zkoss.bind.annotation.NotifyChange) GlobalCommand(org.zkoss.bind.annotation.GlobalCommand) Command(org.zkoss.bind.annotation.Command)

Example 24 with Command

use of org.zkoss.bind.annotation.Command in project collect by openforis.

the class SchemaVM method openDuplicateNodePopup.

@Command
public void openDuplicateNodePopup() {
    if (!checkCanLeaveForm()) {
        return;
    }
    SchemaNodeData selectedTreeNode = getSelectedTreeNode();
    if (selectedTreeNode == null) {
        return;
    }
    SurveyObject selectedItem = selectedTreeNode.getSurveyObject();
    if (selectedItem instanceof NodeDefinition) {
        openSelectParentNodePopupForDuplicate((NodeDefinition) selectedItem);
    }
}
Also used : SurveyObject(org.openforis.idm.metamodel.SurveyObject) NodeDefinition(org.openforis.idm.metamodel.NodeDefinition) SchemaNodeData(org.openforis.collect.designer.component.SchemaTreeModel.SchemaNodeData) GlobalCommand(org.zkoss.bind.annotation.GlobalCommand) Command(org.zkoss.bind.annotation.Command)

Example 25 with Command

use of org.zkoss.bind.annotation.Command in project collect by openforis.

the class SchemaVM method versionSelected.

@Command
public void versionSelected(@BindingParam("version") Object version) {
    ModelVersion modelVersion;
    if (version == FormObject.VERSION_EMPTY_SELECTION) {
        modelVersion = null;
    } else {
        modelVersion = (ModelVersion) version;
    }
    nodesTreeFilterChanged(selectedRootEntity, modelVersion);
}
Also used : ModelVersion(org.openforis.idm.metamodel.ModelVersion) GlobalCommand(org.zkoss.bind.annotation.GlobalCommand) Command(org.zkoss.bind.annotation.Command)

Aggregations

Command (org.zkoss.bind.annotation.Command)62 GlobalCommand (org.zkoss.bind.annotation.GlobalCommand)44 NotifyChange (org.zkoss.bind.annotation.NotifyChange)26 File (java.io.File)12 CollectSurvey (org.openforis.collect.model.CollectSurvey)10 MessageUtil (org.openforis.collect.designer.util.MessageUtil)9 UITab (org.openforis.collect.metamodel.ui.UITab)6 EntityDefinition (org.openforis.idm.metamodel.EntityDefinition)6 FileInputStream (java.io.FileInputStream)5 ConfirmParams (org.openforis.collect.designer.util.MessageUtil.ConfirmParams)5 UIOptions (org.openforis.collect.metamodel.ui.UIOptions)5 SurveyObject (org.openforis.idm.metamodel.SurveyObject)5 Media (org.zkoss.util.media.Media)5 Window (org.zkoss.zul.Window)5 UserCredential (es.bsc.compss.ui.auth.UserCredential)4 IOException (java.io.IOException)4 Date (java.util.Date)4 NodeDefinition (org.openforis.idm.metamodel.NodeDefinition)4 SessionStatus (org.openforis.collect.designer.session.SessionStatus)3 ConfirmHandler (org.openforis.collect.designer.util.MessageUtil.ConfirmHandler)3