当前位置: 首页>>代码示例>>Java>>正文


Java Document类代码示例

本文整理汇总了Java中org.pentaho.ui.xul.dom.Document的典型用法代码示例。如果您正苦于以下问题:Java Document类的具体用法?Java Document怎么用?Java Document使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Document类属于org.pentaho.ui.xul.dom包,在下文中一共展示了Document类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUp

import org.pentaho.ui.xul.dom.Document; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  controller = spy( new GitController() );
  controller.setAuthorName( "test <[email protected]>" );
  controller.setCommitMessage( "test" );
  uiGit = mock( UIGit.class );
  controller.setVCS( uiGit );
  doNothing().when( controller ).fireSourceChanged();
  doReturn( false ).when( controller ).anyChangedTabs();
  doNothing().when( controller ).addGraph( any( EngineMetaInterface.class ), anyString() );
  doNothing().when( controller ).loadMainPerspective();

  DocumentFactory.registerElementClass( ElementDom4J.class );
  document = mock( Document.class );
  XulDomContainer xulDomContainer = mock( XulDomContainer.class );
  when( xulDomContainer.getDocumentRoot() ).thenReturn( document );
  controller.setXulDomContainer( xulDomContainer );
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:19,代码来源:GitControllerTest.java

示例2: removePerspective

import org.pentaho.ui.xul.dom.Document; //导入依赖的package包/类
public void removePerspective(SpoonPerspective per) {
  perspectives.remove(per);
  orderedPerspectives.remove(per);
  Document document = domContainer.getDocumentRoot();

  XulComponent comp = document.getElementById("perspective-" + per.getId());
  comp.getParent().removeChild(comp);

  comp = document.getElementById("perspective-btn-" + per.getId());
  comp.getParent().removeChild(comp);
  XulToolbar mainToolbar = (XulToolbar) domContainer.getDocumentRoot().getElementById("main-toolbar");
  ((Composite) mainToolbar.getManagedObject()).layout(true, true);

  deck.setSelectedIndex(0);

}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:17,代码来源:SpoonPerspectiveManager.java

示例3: removePerspective

import org.pentaho.ui.xul.dom.Document; //导入依赖的package包/类
public void removePerspective( SpoonPerspective per ) {
  perspectives.remove( per );
  orderedPerspectives.remove( per );
  Document document = domContainer.getDocumentRoot();

  XulComponent comp = document.getElementById( "perspective-" + per.getId() );
  comp.getParent().removeChild( comp );

  comp = document.getElementById( "perspective-btn-" + per.getId() );
  comp.getParent().removeChild( comp );
  XulToolbar mainToolbar = (XulToolbar) domContainer.getDocumentRoot().getElementById( "main-toolbar" );
  ( (Composite) mainToolbar.getManagedObject() ).layout( true, true );

  deck.setSelectedIndex( 0 );

}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:17,代码来源:SpoonPerspectiveManager.java

示例4: updateMenu

import org.pentaho.ui.xul.dom.Document; //导入依赖的package包/类
public void updateMenu(Document doc) {
	
//	  boolean isDisabled = !isValidEntrySelected();
//	  XulComponent menuItem = getXulDomContainer().getDocumentRoot().getElementById("trans-graph-entry-model");
//	  if (menuItem != null) {
//		  menuItem.setDisabled(isDisabled);
//	  }
//
//	  menuItem = getXulDomContainer().getDocumentRoot().getElementById("trans-graph-entry-visualize");
//	  if (menuItem != null) {
//		  menuItem.setDisabled(isDisabled);
//	  }
  }
 
开发者ID:pentaho,项目名称:pdi-agile-bi-plugin,代码行数:14,代码来源:ModelerHelper.java

示例5: JobGraphJobEntryMenuExtension

import org.pentaho.ui.xul.dom.Document; //导入依赖的package包/类
public JobGraphJobEntryMenuExtension( XulDomContainer xulDomContainer, Document doc, JobMeta jobMeta,
  JobEntryCopy jobEntry, JobGraph jobGraph ) {
  this.xulDomContainer = xulDomContainer;
  this.doc = doc;
  this.jobMeta = jobMeta;
  this.jobEntry = jobEntry;
  this.jobGraph = jobGraph;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:9,代码来源:JobGraphJobEntryMenuExtension.java

示例6: setUp

import org.pentaho.ui.xul.dom.Document; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  DocumentFactory.registerElementClass( ElementDom4J.class );

  controller = new BrowseController();

  controller.setRepositoryDirectory( mock( UIRepositoryDirectory.class ) );

  directoryMap = new HashMap<>( 8 );
  controller.setDirMap( directoryMap );

  document = mock( Document.class );
  XulDomContainer xulDomContainer = mock( XulDomContainer.class );
  when( xulDomContainer.getDocumentRoot() ).thenReturn( document );
  controller.setXulDomContainer( xulDomContainer );

  UIRepositoryDirectory someDirectory = mock( UIRepositoryDirectory.class );
  selectedFolder = mock( UIRepositoryDirectory.class );
  when( selectedFolder.createFolder( FOLDER_NAME ) ).thenReturn( someDirectory );

  XulTree folderTree = mock( XulTree.class );
  when( folderTree.getSelectedItems() ).thenReturn( Collections.<Object>singleton( selectedFolder ) );
  controller.setFolderTree( folderTree );

  directoryBinding = mock( Binding.class );
  controller.setDirectoryBinding( directoryBinding );

  selectedItemsBinding = mock( Binding.class );
  controller.setSelectedItemsBinding( selectedItemsBinding );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:31,代码来源:BrowseControllerTest.java

示例7: testInitializeXulMenu

import org.pentaho.ui.xul.dom.Document; //导入依赖的package包/类
@SuppressWarnings( "unchecked" )
@Test
public void testInitializeXulMenu() throws KettleException {
  StepMeta stepMeta = mock( StepMeta.class );
  TransGraph transGraph = mock( TransGraph.class );
  TransMeta transMeta = mock( TransMeta.class );
  Document document = mock( Document.class );
  XulMenuitem xulItem = mock( XulMenuitem.class );
  XulMenu xulMenu = mock( XulMenu.class );
  StepErrorMeta stepErrorMeta = mock( StepErrorMeta.class );
  Spoon spoon = mock( Spoon.class );
  List<StepMeta> selection = Arrays.asList( new StepMeta(), stepMeta, new StepMeta() );

  doCallRealMethod().when( transGraph ).setTransMeta( any( TransMeta.class ) );
  doCallRealMethod().when( transGraph ).setSpoon( any( Spoon.class ) );
  transGraph.setTransMeta( transMeta );
  transGraph.setSpoon( spoon );

  when( stepMeta.getStepErrorMeta() ).thenReturn( stepErrorMeta );
  when( stepMeta.isDrawn() ).thenReturn( true );
  when( document.getElementById( any( String.class ) ) ).thenReturn( xulItem );
  when( document.getElementById( TransGraph.TRANS_GRAPH_ENTRY_AGAIN ) ).thenReturn( xulMenu );
  when( document.getElementById( TransGraph.TRANS_GRAPH_ENTRY_SNIFF ) ).thenReturn( xulMenu );

  doCallRealMethod().when( transGraph ).initializeXulMenu( any( Document.class ),
    any( List.class ), any( StepMeta.class ) );

  transGraph.initializeXulMenu( document, selection, stepMeta );
  verify( transMeta ).isAnySelectedStepUsedInTransHops();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:31,代码来源:TransGraphTest.java

示例8: setUp

import org.pentaho.ui.xul.dom.Document; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  fragmentHandler = new FragmentHandler();

  xulDomContainer = mock( XulDomContainer.class );

  document = mock( Document.class );
  when( xulDomContainer.getDocumentRoot() ).thenReturn( document );
  fragmentHandler.setXulDomContainer( xulDomContainer );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:11,代码来源:FragmentHandlerTest.java

示例9: testRefreshOptions

import org.pentaho.ui.xul.dom.Document; //导入依赖的package包/类
@Test
public void testRefreshOptions() throws Exception {
  XulListbox connectionBox = mock( XulListbox.class );
  when( document.getElementById( "connection-type-list" ) ).thenReturn( connectionBox );
  when( connectionBox.getSelectedItem() ).thenReturn( "myDb" );
  XulListbox accessBox = mock( XulListbox.class );
  when( document.getElementById( "access-type-list" ) ).thenReturn( accessBox );
  when( accessBox.getSelectedItem() ).thenReturn( "Native" );
  DataHandler dataHandler = mock( DataHandler.class );
  when( xulDomContainer.getEventHandler( "dataHandler" ) ).thenReturn( dataHandler );
  DatabaseInterface dbInterface = mock( DatabaseInterface.class );
  when( dbInterface.getDefaultDatabasePort() ).thenReturn( 5309 );
  DataHandler.connectionMap.put( "myDb", dbInterface );

  XulComponent component = mock( XulComponent.class );
  XulComponent parent = mock( XulComponent.class );
  when( component.getParent() ).thenReturn( parent );
  when( document.getElementById( "database-options-box" ) ).thenReturn( component );
  XulDomContainer fragmentContainer = mock( XulDomContainer.class );
  Document mockDoc = mock( Document.class );
  XulComponent firstChild = mock( XulComponent.class );
  when( mockDoc.getFirstChild() ).thenReturn( firstChild );
  when( fragmentContainer.getDocumentRoot() ).thenReturn( mockDoc );
  when( xulDomContainer.loadFragment( anyString(), any( Object.class ) ) ).thenReturn( fragmentContainer );

  XulTextbox portBox = mock( XulTextbox.class );
  when( document.getElementById( "port-number-text" ) ).thenReturn( portBox );

  fragmentHandler.refreshOptions();

  // Iterate through the other database access types
  when( accessBox.getSelectedItem() ).thenReturn( "JNDI" );
  fragmentHandler.refreshOptions();
  when( accessBox.getSelectedItem() ).thenReturn( "ODBC" );
  fragmentHandler.refreshOptions();
  when( accessBox.getSelectedItem() ).thenReturn( "OCI" );
  fragmentHandler.refreshOptions();
  when( accessBox.getSelectedItem() ).thenReturn( "Plugin" );
  fragmentHandler.refreshOptions();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:41,代码来源:FragmentHandlerTest.java

示例10: testLoadDatabaseOptionsFragment

import org.pentaho.ui.xul.dom.Document; //导入依赖的package包/类
@Test
public void testLoadDatabaseOptionsFragment() throws Exception {
  XulComponent component = mock( XulComponent.class );
  XulComponent parent = mock( XulComponent.class );
  when( component.getParent() ).thenReturn( parent );
  when( document.getElementById( "database-options-box" ) ).thenReturn( component );
  XulDomContainer fragmentContainer = mock( XulDomContainer.class );
  Document mockDoc = mock( Document.class );
  XulComponent firstChild = mock( XulComponent.class );
  when( mockDoc.getFirstChild() ).thenReturn( firstChild );
  when( fragmentContainer.getDocumentRoot() ).thenReturn( mockDoc );
  when( xulDomContainer.loadFragment( anyString(), any( Object.class ) ) ).thenReturn( fragmentContainer );
  fragmentHandler.loadDatabaseOptionsFragment( null );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:15,代码来源:FragmentHandlerTest.java

示例11: updateMenu

import org.pentaho.ui.xul.dom.Document; //导入依赖的package包/类
public void updateMenu( Document doc ) {
  try {
    Spoon spoon = Spoon.getInstance();

    // If we are working with an Enterprise Repository
    if ( ( spoon != null ) && ( spoon.getRepository() != null ) && ( spoon.getRepository() instanceof PurRepository ) ) {
      ILockService service = getService( spoon.getRepository() );

      EngineMetaInterface meta = spoon.getActiveMeta();

      // If (meta is not null) and (meta is either a Transformation or Job)
      if ( ( meta != null ) && ( meta instanceof ILockable ) ) {

        RepositoryLock repoLock = null;
        if ( service != null && meta.getObjectId() != null ) {
          if ( meta instanceof EEJobMeta ) {
            repoLock = service.getJobLock( meta.getObjectId() );
          } else {
            repoLock = service.getTransformationLock( meta.getObjectId() );
          }
        }
        // If (there is a lock on this item) and (the UserInfo does not have permission to unlock this file)
        if ( repoLock != null ) {
          if ( !service.canUnlockFileById( meta.getObjectId() ) ) {
            // User does not have modify permissions on this file
            ( (XulToolbarbutton) doc.getElementById( "toolbar-file-save" ) ).setDisabled( true ); //$NON-NLS-1$
            ( (XulMenuitem) doc.getElementById( "file-save" ) ).setDisabled( true ); //$NON-NLS-1$  
          }
        }
      }
    }
  } catch ( Exception e ) {
    throw new RuntimeException( e );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:36,代码来源:SpoonMenuLockController.java

示例12: getDocumentRoot

import org.pentaho.ui.xul.dom.Document; //导入依赖的package包/类
private Document getDocumentRoot() {
  initMainSpoonContainer();
  if ( spoonXulContainer != null ) {
    return spoonXulContainer.getDocumentRoot();
  } else {
    return null;
  }

}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:10,代码来源:EESpoonPlugin.java

示例13: setUp

import org.pentaho.ui.xul.dom.Document; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  controller = new ExportHandler();
  context = new JUnit4Mockery() {
    {
      // only here to mock types that are not interfaces
      setImposteriser(ClassImposteriser.INSTANCE);
    }
  };
  doc = context.mock(Document.class);
  container = context.mock(XulDomContainer.class);
  outputService = context.mock(OutputService.class);
  executor = context.mock(SqlExecutor.class);

  aggList = new AggListImpl();

  controller.setOutputService(outputService);
  controller.setAggList(aggList);
  controller.setDdlDmlExecutor(executor);

  // need some expectations here as setXulDomContainer calls getDocumentRoot on the container
  context.checking(new Expectations() {
    {
      one(container).getDocumentRoot();
      will(returnValue(doc));
    }
  });

  controller.setXulDomContainer(container);

}
 
开发者ID:pentaho,项目名称:pentaho-aggdesigner,代码行数:32,代码来源:ExportHandlerTest.java

示例14: setUp

import org.pentaho.ui.xul.dom.Document; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  controller = new ConnectionController();
  context = new JUnit4Mockery();
  doc = context.mock(Document.class);
  container = context.mock(XulDomContainer.class);
  dataHandler = context.mock(XulEventHandler.class);
  model = context.mock(ConnectionModel.class);
  controller.setConnectionModel(model);
  workspace = new Workspace();
  controller.setWorkspace(workspace);
  outputService = context.mock(OutputService.class);
  controller.setOutputService(outputService);
  aSchemaProvider = context.mock(SchemaProviderUiExtension.class);
  cubeNames = Arrays.asList("testCube1", "testCube2");
  providerModel = context.mock(SchemaModel.class);

  // need some expectations here as setXulDomContainer calls getDocumentRoot on the container
  context.checking(new Expectations() {
    {
      one(container).getDocumentRoot();
      will(returnValue(doc));
      allowing(doc).invokeLater(with(any(Runnable.class))); //don't care if the controller uses invokeLater or not
    }
  });

  controller.setXulDomContainer(container);
  controller.setDataHandler(dataHandler);
}
 
开发者ID:pentaho,项目名称:pentaho-aggdesigner,代码行数:30,代码来源:ConnectionControllerTest.java

示例15: setUp

import org.pentaho.ui.xul.dom.Document; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  controller = new AggListController();
  context = new JUnit4Mockery() {
    {
      // only here to mock types that are not interfaces
      setImposteriser(ClassImposteriser.INSTANCE);
    }
  };
  doc = context.mock(Document.class);
  container = context.mock(XulDomContainer.class);
  outputService = context.mock(OutputService.class);
  workspace = context.mock(Workspace.class);
  connModel = context.mock(ConnectionModel.class);
  schema = context.mock(Schema.class);
  uiExt = context.mock(AlgorithmUiExtension.class);
  algo = context.mock(Algorithm.class);
  aggregateSummaryModel = context.mock(AggregateSummaryModel.class);

  aggList = new AggListImpl();

  controller.setOutputService(outputService);
  controller.setAggList(aggList);
  controller.setAlgorithmUiExtension(uiExt);
  controller.setAlgorithm(algo);

  // need some expectations here as setXulDomContainer calls getDocumentRoot on the container
  context.checking(new Expectations() {
    {
      one(container).getDocumentRoot();
      will(returnValue(doc));
    }
  });

  controller.setXulDomContainer(container);
  controller.setWorkspace(workspace);
  controller.setConnectionModel(connModel);
  controller.setAggregateSummaryModel(aggregateSummaryModel);
  
}
 
开发者ID:pentaho,项目名称:pentaho-aggdesigner,代码行数:41,代码来源:AggListControllerTest.java


注:本文中的org.pentaho.ui.xul.dom.Document类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。