private void createBindings() { bf.createBinding( this, "allowed", "file-context-rename", "!disabled" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ bf.createBinding( this, "allowed", "file-context-delete", "!disabled" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ bf.createBinding( this, "allowed", "folder-context-create", "!disabled" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ bf.createBinding( this, "allowed", "folder-context-rename", "!disabled" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ bf.createBinding( this, "allowed", "folder-context-delete", "!disabled" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ }
protected void createBindings() { // Lock bindings bindingFactory.setBindingType( Type.ONE_WAY ); bindingFactory.createBinding( browseController, "repositoryObjects", "lock-menu", "!disabled", forButtons ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ bindingFactory.createBinding( browseController, "repositoryObjects", "file-context-lock", "selected", checkLockedState ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ bindingFactory.createBinding( browseController, "repositoryObjects", this, "menuItemEnabledState" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ bindingFactory.createBinding( browseController, "repositoryObjects", "file-context-locknotes", "!disabled", checkLockedStateBool ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ bindingFactory.createBinding( browseController, "repositoryObjects", "lock-context-lock", "selected", checkLockedState ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ bindingFactory.createBinding( browseController, "repositoryObjects", "lock-context-lock", "!disabled", checkLockPermissions ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ bindingFactory.createBinding( browseController, "repositoryObjects", "lock-context-locknotes", "!disabled", checkLockedStateBool ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ }
private void createTrashTableBindings( BindingConvertor<List<UIDeletedObject>, Boolean> buttonConverter, XulTree trashFileTable ) { bf.createBinding( trashFileTable, "selectedItems", this, "selectedTrashFileItems" ); //$NON-NLS-1$ //$NON-NLS-2$ bf.createBinding( trashFileTable, "selectedItems", deleteButton, "!disabled", buttonConverter ); //$NON-NLS-1$ //$NON-NLS-2$ bf.createBinding( trashFileTable, "selectedItems", undeleteButton, "!disabled", buttonConverter ); //$NON-NLS-1$ //$NON-NLS-2$ bf.createBinding( trashFileTable, "selectedItems", "trash-context-delete", "!disabled", buttonConverter ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ bf.createBinding( trashFileTable, "selectedItems", "trash-context-restore", "!disabled", buttonConverter ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ bf.setBindingType( Binding.Type.ONE_WAY ); bf.createBinding( this, "trash", trashFileTable, "elements", //$NON-NLS-1$ //$NON-NLS-2$ new BindingConvertor<List<IDeletedObject>, List<UIDeletedObject>>() { @Override public List<UIDeletedObject> sourceToTarget( List<IDeletedObject> trash ) { List<UIDeletedObject> newList = new ArrayList<UIDeletedObject>( trash.size() ); for ( IDeletedObject obj : trash ) { newList.add( new UIDeletedObject( obj ) ); } Collections.sort( newList, new UIDeletedObjectComparator() ); return newList; } @Override public List<IDeletedObject> targetToSource( List<UIDeletedObject> elements ) { return null; } } ); }
@Override protected void addBindings( List<Binding> bindings, BindingFactory bf ) { Binding b = bf.createBinding( this, "password", "password", "value" ); b.setBindingType( Binding.Type.BI_DIRECTIONAL ); bindings.add( b ); }
protected Binding createDirectoryBinding() { bf.setBindingType( Binding.Type.ONE_WAY ); return bf.createBinding( this, "repositoryDirectory", folderTree, "elements" ); }
/** * Intercept the repositoryDirectory.children and add the Trash directory to the end. */ @Override protected Binding createDirectoryBinding() { bf.setBindingType( Binding.Type.ONE_WAY ); return bf.createBinding( this, "repositoryDirectory", folderTree, "elements", //$NON-NLS-1$//$NON-NLS-2$ new BindingConvertor<UIRepositoryDirectory, UIRepositoryDirectory>() { @Override public UIRepositoryDirectory sourceToTarget( final UIRepositoryDirectory value ) { if ( value == null || value.size() == 0 ) { return null; } if ( !value.get( value.size() - 1 ).equals( trashDir ) ) { // add directly to children collection to bypass events value.getChildren().add( trashDir ); } return value; } @Override public UIRepositoryDirectory targetToSource( final UIRepositoryDirectory value ) { // not used return value; } } ); }
private void createBindings() { repositoryConfigDialog = (XulDialog) document.getElementById( "repository-config-dialog" );//$NON-NLS-1$ url = (XulTextbox) document.getElementById( "repository-url" );//$NON-NLS-1$ name = (XulTextbox) document.getElementById( "repository-name" );//$NON-NLS-1$ id = (XulTextbox) document.getElementById( "repository-id" );//$NON-NLS-1$ modificationComments = (XulCheckbox) document.getElementById( "repository-modification-comments" );//$NON-NLS-1$ okButton = (XulButton) document.getElementById( "repository-config-dialog_accept" ); //$NON-NLS-1$ bf.setBindingType( Type.BI_DIRECTIONAL ); bf.createBinding( model, "url", url, "value" );//$NON-NLS-1$ //$NON-NLS-2$ bf.createBinding( model, "name", name, "value" );//$NON-NLS-1$ //$NON-NLS-2$ bf.createBinding( model, "id", id, "value" );//$NON-NLS-1$ //$NON-NLS-2$ bf.createBinding( model, "modificationComments", modificationComments, "checked" );//$NON-NLS-1$ //$NON-NLS-2$ bf.setBindingType( Type.ONE_WAY ); bf.createBinding( model, "valid", okButton, "!disabled" );//$NON-NLS-1$ //$NON-NLS-2$ }
@Override protected void addBindings( List<Binding> bindings, BindingFactory bf ) { super.addBindings( bindings, bf ); Binding b = bf.createBinding( this, "keytabFile", "keytab", "value" ); b.setBindingType( Binding.Type.BI_DIRECTIONAL ); bindings.add( b ); b = bf.createBinding( this, "useKeytab", "useKeytab", "checked" ); b.setBindingType( Binding.Type.BI_DIRECTIONAL ); bindings.add( b ); b = bf.createBinding( "useKeytab", "checked", "keytab", "!disabled" ); b.setBindingType( Binding.Type.ONE_WAY ); bindings.add( b ); b = bf.createBinding( "useKeytab", "checked", "browse", "!disabled" ); b.setBindingType( Binding.Type.ONE_WAY ); bindings.add( b ); b = bf.createBinding( "useKeytab", "checked", "password", "disabled" ); b.setBindingType( Binding.Type.ONE_WAY ); bindings.add( b ); b = bf.createBinding( "useKeytab", "checked", "principal", "disabled" ); b.setBindingType( Binding.Type.ONE_WAY ); bindings.add( b ); }
public void createBindings() { refreshClusters(); try { clustersTable = (XulTree) document.getElementById( "clusters-table" ); bf.setBindingType( Binding.Type.ONE_WAY ); bf.createBinding( clusterList, "children", clustersTable, "elements" ).fireSourceChanged(); bf.createBinding( clustersTable, "selectedItems", this, "enableButtons" ); } catch ( Exception e ) { if ( mainController == null || !mainController.handleLostRepository( e ) ) { throw new RuntimeException( e ); } } }
private void createBindings() { refreshConnectionList(); connectionsTable = (XulTree) document.getElementById( "connections-table" ); // Bind the connection table to a list of connections bf.setBindingType( Binding.Type.ONE_WAY ); //CHECKSTYLE:LineLength:OFF try { bf.createBinding( dbConnectionList, "children", connectionsTable, "elements" ).fireSourceChanged(); ( bindButtonNew = bf.createBinding( this, "repReadOnly", "connections-new", "disabled" ) ).fireSourceChanged(); ( bindButtonEdit = bf.createBinding( this, "repReadOnly", "connections-edit", "disabled" ) ).fireSourceChanged(); ( bindButtonRemove = bf.createBinding( this, "repReadOnly", "connections-remove", "disabled" ) ).fireSourceChanged(); if ( repository != null ) { bf.createBinding( connectionsTable, "selectedItems", this, "selectedConnections" ); } } catch ( Exception ex ) { if ( mainController == null || !mainController.handleLostRepository( ex ) ) { // convert to runtime exception so it bubbles up through the UI throw new RuntimeException( ex ); } } }
public void init() { createStepFieldNodes(); this.bf.setDocument( super.document ); this.bf.setBindingType( Type.ONE_WAY ); this.stepFieldsTree = (XulTree) super.document.getElementById( "step_fields_data" ); this.stepFieldsTreeBinding = this.bf.createBinding( this.model, "stepFields", this.stepFieldsTree, "elements" ); this.stepNameBinding = this.bf.createBinding( this.model, "stepName", "stepNameLabel", "value" ); this.acceptButtonBinding = this.bf.createBinding( this, "showAcceptButton", "stepFieldsDialog_accept", "visible" ); if ( this.getShowAcceptButton() ) { BindingConvertor<StepFieldNode, Boolean> isDisabledConvertor = new BindingConvertor<StepFieldNode, Boolean>() { public Boolean sourceToTarget( StepFieldNode value ) { return !( value != null ); } public StepFieldNode targetToSource( Boolean value ) { return null; } }; this.acceptButtonBinding = this.bf.createBinding( this.stepFieldsTree, "selectedItem", "stepFieldsDialog_accept", "disabled", isDisabledConvertor ); } fireBindings(); }
public void createBindings() { refreshSlaves(); try { slavesTable = (XulTree) document.getElementById( "slaves-table" ); bf.setBindingType( Binding.Type.ONE_WAY ); bf.createBinding( slaveList, "children", slavesTable, "elements" ).fireSourceChanged(); bf.createBinding( slavesTable, "selectedItems", this, "enableButtons" ); } catch ( Exception e ) { if ( mainController == null || !mainController.handleLostRepository( e ) ) { // convert to runtime exception so it bubbles up through the UI throw new RuntimeException( e ); } } }
@Override public void bind() throws BindingException, XulException, InvocationTargetException { unbind(); elementBindings = new ArrayList<Binding>(); Binding b = bf.createBinding( this, "principal", "principal", "value" ); b.setBindingType( Binding.Type.BI_DIRECTIONAL ); elementBindings.add( b ); addBindings( elementBindings, bf ); fireBindingsChanged(); }
public void createBindings() { refreshPartitions(); try { partitionsTable = (XulTree) document.getElementById( "partitions-table" ); bf.setBindingType( Binding.Type.ONE_WAY ); bf.createBinding( partitionList, "children", partitionsTable, "elements" ).fireSourceChanged(); bf.createBinding( partitionsTable, "selectedItems", this, "enableButtons" ); } catch ( Exception e ) { if ( mainController == null || !mainController.handleLostRepository( e ) ) { // convert to runtime exception so it bubbles up through the UI throw new RuntimeException( e ); } } }
@Override protected void createBindings() { super.createBindings(); roleListBox = (XulListbox) document.getElementById( "roles-list" );//$NON-NLS-1$ systemRoleListBox = (XulListbox) document.getElementById( "system-roles-list" );//$NON-NLS-1$ applyLogicalRolesButton = (XulButton) document.getElementById( "apply-action-permission" );//$NON-NLS-1$ applyLogicalSystemRolesButton = (XulButton) document.getElementById( "apply-system-role-action-permission" );//$NON-NLS-1$ logicalRolesBox = (XulVbox) document.getElementById( "role-action-permissions-vbox" );//$NON-NLS-1$ logicalSystemRolesBox = (XulVbox) document.getElementById( "system-role-action-permissions-vbox" );//$NON-NLS-1$ bf.setBindingType( Binding.Type.ONE_WAY ); // Action based security permissions buttonConverter = new BindingConvertor<Integer, Boolean>() { @Override public Boolean sourceToTarget( Integer value ) { if ( value != null && value >= 0 ) { return false; } return true; } @Override public Integer targetToSource( Boolean value ) { // TODO Auto-generated method stub return null; } }; bf.createBinding( roleListBox, "selectedIndex", applyLogicalRolesButton, "disabled", buttonConverter );//$NON-NLS-1$ //$NON-NLS-2$ bf.createBinding( systemRoleListBox, "selectedIndex", applyLogicalSystemRolesButton, "disabled", buttonConverter );//$NON-NLS-1$ //$NON-NLS-2$ bf.createBinding( absSecurity, "selectedRole", this, "selectedRoleChanged" );//$NON-NLS-1$ //$NON-NLS-2$ bf.createBinding( absSecurity, "selectedSystemRole", this, "selectedSystemRoleChanged" );//$NON-NLS-1$ //$NON-NLS-2$ }
public void init() { createPreviewRows(); this.bf.setDocument( super.document ); this.bf.setBindingType( Type.ONE_WAY ); this.rowCountBinding = this.bf.createBinding( this, "rowCount", "rowCountLabel", "value" ); fireBindings(); }
/** * Initialized the ActionPermissions UI with all the possible values from LogicalSystemRoles enum */ private void initializeLogicalSystemRolesUI() { try { Map<String, String> logicalRoles = ( (IAbsSecurityManager) service ).getAllLogicalRoles( GlobalMessageUtil.getLocale().getDisplayName() ); for ( Entry<String, String> logicalRole : logicalRoles.entrySet() ) { XulCheckbox logicalSystemRoleCheckbox; logicalSystemRoleCheckbox = (XulCheckbox) document.createElement( "checkbox" );//$NON-NLS-1$ logicalSystemRoleCheckbox.setLabel( logicalRole.getValue() ); logicalSystemRoleCheckbox.setId( logicalRole.getValue() ); logicalSystemRoleCheckbox.setCommand( "iSecurityController.updateSystemRoleActionPermission()" );//$NON-NLS-1$ logicalSystemRoleCheckbox.setFlex( 1 ); logicalSystemRoleCheckbox.setDisabled( true ); logicalSystemRolesBox.addChild( logicalSystemRoleCheckbox ); logicalSystemRoleChecboxMap.put( logicalSystemRoleCheckbox, logicalRole.getKey() ); bf.setBindingType( Binding.Type.ONE_WAY ); bf.createBinding( systemRoleListBox, "selectedIndex", logicalSystemRoleCheckbox, "disabled", buttonConverter );//$NON-NLS-1$ //$NON-NLS-2$ } } catch ( XulException xe ) { } catch ( KettleException xe ) { } }
/** * Initialized the ActionPermissions UI with all the possible values from LogicalRoles enum */ private void initializeLogicalRolesUI() { try { Map<String, String> logicalRoles = ( (IAbsSecurityManager) service ).getAllLogicalRoles( GlobalMessageUtil.getLocale().getDisplayName() ); for ( Entry<String, String> logicalRole : logicalRoles.entrySet() ) { XulCheckbox logicalRoleCheckbox; logicalRoleCheckbox = (XulCheckbox) document.createElement( "checkbox" );//$NON-NLS-1$ logicalRoleCheckbox.setLabel( logicalRole.getValue() ); logicalRoleCheckbox.setId( logicalRole.getValue() ); logicalRoleCheckbox.setCommand( "iSecurityController.updateRoleActionPermission()" );//$NON-NLS-1$ logicalRoleCheckbox.setFlex( 1 ); logicalRoleCheckbox.setDisabled( true ); logicalRolesBox.addChild( logicalRoleCheckbox ); logicalRoleChecboxMap.put( logicalRoleCheckbox, logicalRole.getKey() ); bf.setBindingType( Binding.Type.ONE_WAY ); bf.createBinding( roleListBox, "selectedIndex", logicalRoleCheckbox, "disabled", buttonConverter );//$NON-NLS-1$ //$NON-NLS-2$ } } catch ( XulException xe ) { } catch ( KettleException xe ) { } }
bf.createBinding( "step-name", "value", this, "stepName" ); bf.createBinding( "rule-file", "value", metaMapper, "ruleFile" ); bf.createBinding( "rule-definition", "value", metaMapper, "ruleDefinition" ); bf.createBinding( metaMapper.getColumnList(), "children", "fields-table", "elements" ).fireSourceChanged(); bf.createBinding( "rule-file-radio-button", "selected", "rule-file", "!disabled" ).fireSourceChanged(); bf.createBinding( "rule-file-radio-button", "selected", "rule-definition", "disabled" ).fireSourceChanged(); .createBinding( "rule-definition-radio-button", "selected", "rule-definition", "!disabled" ) .fireSourceChanged(); bf.createBinding( "rule-definition-radio-button", "selected", "rule-file", "disabled" ).fireSourceChanged(); } catch ( Exception e ) { e.printStackTrace();
public void init() { try { bf.setDocument( container.getDocumentRoot() ); mainController = (MainController) this.getXulDomContainer().getEventHandler( "mainController" ); bf.setBindingType( Binding.Type.ONE_WAY ); bf.createBinding( objects, "children", "file-list", "elements" ).fireSourceChanged(); } catch ( Exception e ) { if ( mainController == null || !mainController.handleLostRepository( e ) ) { new ErrorDialog( (Shell) container.getOuterContext(), BaseMessages.getString( PKG, "FileOverwriteDialog.ErrorDialog.Title" ), BaseMessages.getString( PKG, "FileOverwriteDialog.ErrorDialog.Message" ), e ); } } }