本文整理汇总了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 );
}
示例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);
}
示例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 );
}
示例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);
// }
}
示例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;
}
示例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 );
}
示例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();
}
示例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 );
}
示例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();
}
示例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 );
}
示例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 );
}
}
示例12: getDocumentRoot
import org.pentaho.ui.xul.dom.Document; //导入依赖的package包/类
private Document getDocumentRoot() {
initMainSpoonContainer();
if ( spoonXulContainer != null ) {
return spoonXulContainer.getDocumentRoot();
} else {
return null;
}
}
示例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);
}
示例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);
}
示例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);
}