@Override public void fireBindingsChanged() throws XulException, InvocationTargetException { for ( Binding bind : elementBindings ) { bind.fireSourceChanged(); } }
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$ }
public XulPreviewRowsController( Shell aShell, DatabaseMeta aDatabaseMeta, String aSchema, String aTable, int aLimit ) { this.shell = aShell; this.databaseMeta = aDatabaseMeta; this.schema = aSchema; this.table = aTable; this.limit = aLimit; this.bf = new DefaultBindingFactory(); }
protected Binding createDirectoryBinding() { bf.setBindingType( Binding.Type.ONE_WAY ); return bf.createBinding( this, "repositoryDirectory", folderTree, "elements" ); }
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 ); } } }
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(); }
@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 ); }
@Override public void unbind() { for ( Binding bind : elementBindings ) { bind.destroyBindings(); } elementBindings.clear(); }
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 fireBindings() { try { this.rowCountBinding.fireSourceChanged(); } catch ( Exception e ) { logger.info( 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 XulStepFieldsController( Shell aShell, DatabaseMeta aDatabaseMeta, String schemaTableCombo, RowMetaInterface anInput ) { this.shell = aShell; this.databaseMeta = aDatabaseMeta; this.schemaTableCombo = schemaTableCombo; this.bf = new DefaultBindingFactory(); this.model = new XulStepFieldsModel(); this.rowMetaInterface = anInput; }
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; } } ); }
private void fireBindings() { try { this.stepFieldsTreeBinding.fireSourceChanged(); this.stepNameBinding.fireSourceChanged(); this.acceptButtonBinding.fireSourceChanged(); } catch ( Exception e ) { LogChannel.GENERAL.logError( "Error firing bindings", e ); } } }
public XulDatabaseExplorerController( Shell shell, DatabaseMeta databaseMeta, List<DatabaseMeta> databases, boolean aLook ) { this.model = new XulDatabaseExplorerModel( databaseMeta ); this.shell = shell; this.bf = new DefaultBindingFactory(); this.databases = databases; this.dbcache = DBCache.getInstance(); this.isJustLook = aLook; }
/** * 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; } } ); }
protected void deleteFolder( UIRepositoryDirectory repoDir ) throws Exception { repoDir.delete(); directoryBinding.fireSourceChanged(); selectedItemsBinding.fireSourceChanged(); repoDir.refresh(); }
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$ }
protected void deleteContent( UIRepositoryObject repoObject ) throws Exception { repoObject.delete(); if ( repoObject instanceof UIRepositoryDirectory ) { directoryBinding.fireSourceChanged(); if ( repoDir != null ) { repoDir.refresh(); } } selectedItemsBinding.fireSourceChanged(); }
public void onToggle( Object[] toggled, boolean expanded ) { if ( expanded ) { UIRepositoryDirectory rd = (UIRepositoryDirectory) toggled[ 0 ]; if ( !rd.isPopulated() ) { rd.populateChildren(); try { directoryBinding.fireSourceChanged(); } catch ( Exception e ) { // Do nothing } } } }