org.pentaho.ui.xul.dom.Document.createElement()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(13.8k)|赞(0)|评价(0)|浏览(189)

本文整理了Java中org.pentaho.ui.xul.dom.Document.createElement()方法的一些代码示例,展示了Document.createElement()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Document.createElement()方法的具体详情如下:
包路径:org.pentaho.ui.xul.dom.Document
类名称:Document
方法名:createElement

Document.createElement介绍

暂无

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

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();
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

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() );
  }
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

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 );
  }
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

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();
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

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 );
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

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;
}

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * 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 ) {
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * 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 ) {
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

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 );
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

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;
}

代码示例来源:origin: pentaho/pentaho-kettle

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();
}

代码示例来源:origin: pentaho/pentaho-kettle

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;
}

代码示例来源:origin: pentaho/pentaho-kettle

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;
}

代码示例来源:origin: pentaho/pentaho-kettle

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() );
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

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;
}

代码示例来源:origin: pentaho/pentaho-kettle

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();
}

代码示例来源:origin: pentaho/pentaho-kettle

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;
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

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 );
  }
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

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 );
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

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 );
 }
}

相关文章