public void init() throws ControllerInitializationException { // TODO Initialize the Repository Login Dialog try { messageBox = (XulMessageBox) document.createElement( "messagebox" ); confirmBox = (XulConfirmBox) document.createElement( "confirmbox" ); } catch ( Exception e ) { throw new ControllerInitializationException( e ); } if ( bf != null ) { createBindings(); } }
protected void showMessage( String message ) { try { XulMessageBox box = (XulMessageBox) document.createElement( "messagebox" ); box.setMessage( message ); box.open(); } catch ( XulException e ) { System.out.println( "Error creating messagebox " + e.getMessage() ); } } }
private void displayRepositoryAlreadyExistMessage( String name ) { try { XulMessageBox messageBox = (XulMessageBox) container.getDocumentRoot().createElement( "messagebox" ); messageBox.setTitle( resourceBundle.getString( "Dialog.Error" ) );//$NON-NLS-1$ messageBox.setAcceptLabel( resourceBundle.getString( "Dialog.Ok" ) );//$NON-NLS-1$ messageBox.setMessage( BaseMessages.getString( PKG, "PurRepositoryDialog.Dialog.ErrorIdExist.Message", name ) );//$NON-NLS-1$ messageBox.open(); } catch ( XulException e ) { throw new RuntimeException( e ); } } }
public void viewLockNote() throws Exception { List<UIRepositoryObject> selectedRepoObjects = browseController.getSelectedFileItems(); if ( selectedRepoObjects.size() > 0 && selectedRepoObjects.get( 0 ) instanceof UIRepositoryContent ) { final UIRepositoryContent contentToLock = (UIRepositoryContent) selectedRepoObjects.get( 0 ); XulMessageBox msgBox = (XulMessageBox) document.createElement( "messagebox" ); //$NON-NLS-1$ msgBox.setTitle( BaseMessages.getString( PKG, "PurRepository.LockNote.Title" ) ); //$NON-NLS-1$ msgBox.setMessage( ( (ILockObject) contentToLock ).getLockMessage() ); msgBox.open(); } }
public void browse() { try { XulTextbox filename = (XulTextbox) document.getElementById( "keytab" ); XulFileDialog dialog = (XulFileDialog) document.createElement( "filedialog" ); XulFileDialog.RETURN_CODE retval = dialog.showOpenDialog(); if ( retval == XulFileDialog.RETURN_CODE.OK ) { File file = (File) dialog.getFile(); filename.setValue( file.getAbsolutePath() ); } } catch ( XulException e ) { log.logError( resourceBundle.getString( "error.file_browse" ), e ); } }
protected XulPromptBox promptForName( final UIRepositoryObject object ) throws XulException { XulPromptBox prompt = (XulPromptBox) document.createElement( "promptbox" ); String currentName = ( object == null ) ? BaseMessages.getString( PKG, "BrowserController.NewFolder" ) : object.getName(); prompt.setTitle( BaseMessages.getString( PKG, "BrowserController.Name" ).concat( currentName ) ); prompt.setButtons( new DialogConstant[] { DialogConstant.OK, DialogConstant.CANCEL } ); prompt.setMessage( BaseMessages.getString( PKG, "BrowserController.NameLabel" ).concat( currentName ) ); prompt.setValue( currentName ); return prompt; }
/** * 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 ) { } }
/** * 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 ) { } }
public void showMessage( final String message, final String title ) { try { final XulMessageBox msg = (XulMessageBox) document.createElement( "messagebox" ); msg.setModalParent( modalParent ); msg.setTitle( title ); msg.setMessage( message ); msg.open(); } catch ( XulException e ) { log.logError( "Error displaying message: {0}", message ); } }
private SwtConfirmBox promptCommitComment( org.pentaho.ui.xul.dom.Document document ) throws XulException { SwtConfirmBox confirmbox = (SwtConfirmBox) document.createElement( "confirmbox" ); confirmbox.setTitle( BaseMessages.getString( PKG, "RepositoryExplorer.CommitTitle" ) ); //$NON-NLS-1$ confirmbox.setButtons( new DialogConstant[] { DialogConstant.OK, DialogConstant.CANCEL } ); confirmbox.setMessage( BaseMessages.getString( PKG, "RepositoryExplorer.CommitLabel" ) ); //$NON-NLS-1$//$NON-NLS-1$ return confirmbox; }
private void showErrorDialog( final Exception e ) { XulMessageBox messageBox = null; try { messageBox = (XulMessageBox) document.createElement( "messagebox" ); } catch ( XulException xe ) { throw new RuntimeException( xe ); } messageBox.setTitle( BaseMessages.getString( PKG, "Dialog.Error" ) ); messageBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Ok" ) ); if ( e != null ) { messageBox.setMessage( BaseMessages.getString( PKG, "LazilyInitializedController.Message.UnableToInitWithParam", e.getLocalizedMessage() ) ); } else { messageBox.setMessage( BaseMessages.getString( PKG, "LazilyInitializedController.Message.UnableToInit" ) ); } messageBox.open(); }
public int showPromptMessage( final String message, final String title, Object[] buttons ) { try { final XulMessageBox msg = (XulMessageBox) document.createElement( "messagebox" ); msg.setModalParent( modalParent ); msg.setTitle( title ); msg.setMessage( message ); msg.setButtons( buttons ); return msg.open(); } catch ( XulException e ) { log.logError( "Error displaying message: {0}", message ); } return -1; }
private XulPromptBox promptLockMessage( org.pentaho.ui.xul.dom.Document document, ResourceBundle messages, String defaultMessage ) throws XulException { XulPromptBox prompt = (XulPromptBox) document.createElement( "promptbox" ); //$NON-NLS-1$ prompt.setTitle( BaseMessages.getString( PKG, "RepositoryExplorer.LockMessage.Title" ) ); //$NON-NLS-1$ prompt.setButtons( new DialogConstant[] { DialogConstant.OK, DialogConstant.CANCEL } ); prompt.setMessage( BaseMessages.getString( PKG, "RepositoryExplorer.LockMessage.Label" ) ); //$NON-NLS-1$ prompt.setValue( defaultMessage == null ? BaseMessages.getString( PKG, "RepositoryExplorer.DefaultLockMessage" ) : defaultMessage ); //$NON-NLS-1$ return prompt; }
protected void showMessage( String message, boolean scroll ) { try { XulMessageBox box = (XulMessageBox) document.createElement( "messagebox" ); box.setMessage( message ); box.setModalParent( ( (XulRoot) document.getElementById( "general-datasource-window" ) ).getRootObject() ); if ( scroll ) { box.setScrollable( true ); box.setWidth( 500 ); box.setHeight( 400 ); } box.open(); } catch ( XulException e ) { System.out.println( "Error creating messagebox " + e.getMessage() ); } }
private XulPromptBox promptLockMessage( org.pentaho.ui.xul.dom.Document document, ResourceBundle messages, String defaultMessage ) throws XulException { XulPromptBox prompt = (XulPromptBox) document.createElement( "promptbox" ); //$NON-NLS-1$ prompt.setModalParent( shell ); prompt.setTitle( BaseMessages.getString( PKG, "RepositoryExplorer.LockMessage.Title" ) );//$NON-NLS-1$ prompt.setButtons( new DialogConstant[] { DialogConstant.OK, DialogConstant.CANCEL } ); prompt.setMessage( BaseMessages.getString( PKG, "RepositoryExplorer.LockMessage.Label" ) );//$NON-NLS-1$ prompt.setValue( defaultMessage == null ? BaseMessages.getString( PKG, "RepositoryExplorer.DefaultLockMessage" ) : defaultMessage ); //$NON-NLS-1$ return prompt; }
public void init() throws ControllerInitializationException { bf = new DefaultBindingFactory(); bf.setDocument( this.getXulDomContainer().getDocumentRoot() ); try { messageBox = (XulMessageBox) document.createElement( "messagebox" ); //$NON-NLS-1$ } catch ( Throwable th ) { throw new ControllerInitializationException( th ); } model = new RepositoryConfigModel(); if ( bf != null ) { createBindings(); } initializeModel(); }
protected XulMessageBox runXulChangedWarningDialog( String fileName ) throws IllegalArgumentException, XulException { container = Spoon.getInstance().getMainSpoonContainer(); XulMessageBox messageBox = (XulMessageBox) container.getDocumentRoot().createElement( "messagebox" ); messageBox.setTitle( BaseMessages.getString( PKG, "Spoon.Dialog.PromptSave.Title" ) ); if ( fileName != null ) { messageBox.setMessage( BaseMessages.getString( PKG, "Spoon.Dialog.PromptToSave.Message", fileName ) ); } else { messageBox.setMessage( BaseMessages.getString( PKG, "Spoon.Dialog.PromptSave.Message" ) ); } messageBox.setButtons( new Integer[] { SWT.YES, SWT.NO, SWT.CANCEL } ); return messageBox; } }
public void init( Repository repository ) throws ControllerInitializationException { try { this.repository = repository; mainController = (MainController) this.getXulDomContainer().getEventHandler( "mainController" ); //$NON-NLS-1$ browseController = (BrowseController) this.getXulDomContainer().getEventHandler( "browseController" ); //$NON-NLS-1$ bf = new DefaultBindingFactory(); bf.setDocument( this.getXulDomContainer().getDocumentRoot() ); messageBox = (XulMessageBox) document.createElement( "messagebox" ); //$NON-NLS-1$ createBindings(); } catch ( Exception e ) { if ( mainController == null || !mainController.handleLostRepository( e ) ) { throw new ControllerInitializationException( e ); } } }
public void displayRowCount() { if ( this.model.getTable() == null ) { return; } try { GetTableSizeProgressDialog pd = new GetTableSizeProgressDialog( this.dbExplorerDialog.getShell(), this.model.getDatabaseMeta(), this.model.getTable(), model .getSchema() ); Long theCount = pd.open(); if ( theCount != null ) { XulMessageBox theMessageBox = (XulMessageBox) document.createElement( "messagebox" ); theMessageBox.setModalParent( this.dbExplorerDialog.getShell() ); theMessageBox.setTitle( BaseMessages.getString( PKG, "DatabaseExplorerDialog.TableSize.Title" ) ); theMessageBox.setMessage( BaseMessages.getString( PKG, "DatabaseExplorerDialog.TableSize.Message", this.model.getTable(), theCount.toString() ) ); theMessageBox.open(); } } catch ( XulException e ) { LogChannel.GENERAL.logError( "Error displaying row count", e ); } }
public void init( Repository rep ) throws ControllerInitializationException { try { if ( rep != null && rep.hasService( ILockService.class ) ) { repository = rep; service = (ILockService) rep.getService( ILockService.class ); } else { throw new ControllerInitializationException( BaseMessages.getString( PKG, "RepositoryLockController.ERROR_0001_UNABLE_TO_INITIAL_REPOSITORY_SERVICE", ILockService.class ) ); //$NON-NLS-1$ } bindingFactory = new DefaultBindingFactory(); bindingFactory.setDocument( getXulDomContainer().getDocumentRoot() ); XulEventHandler eventHandler = getXulDomContainer().getEventHandler( "browseController" ); //$NON-NLS-1$ if ( eventHandler instanceof BrowseController ) { browseController = (BrowseController) eventHandler; } // Disable row dragging if it is locked and the user does not have permissions fileTable = (XulTree) getXulDomContainer().getDocumentRoot().getElementById( "file-table" ); //$NON-NLS-1$ folderTree = (XulTree) document.getElementById( "folder-tree" ); //$NON-NLS-1$ lockFileMenuItem = (XulMenuitem) getXulDomContainer().getDocumentRoot().getElementById( "file-context-lock" ); //$NON-NLS-1$ deleteFileMenuItem = (XulMenuitem) getXulDomContainer().getDocumentRoot().getElementById( "file-context-delete" ); //$NON-NLS-1$ renameFileMenuItem = (XulMenuitem) getXulDomContainer().getDocumentRoot().getElementById( "file-context-rename" ); //$NON-NLS-1$ messageBox = (XulMessageBox) document.createElement( "messagebox" ); //$NON-NLS-1$ createBindings(); } catch ( Exception e ) { throw new RuntimeException( e ); } }