本文整理汇总了Java中org.pentaho.ui.xul.swt.SwtXulLoader.loadXul方法的典型用法代码示例。如果您正苦于以下问题:Java SwtXulLoader.loadXul方法的具体用法?Java SwtXulLoader.loadXul怎么用?Java SwtXulLoader.loadXul使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.ui.xul.swt.SwtXulLoader
的用法示例。
在下文中一共展示了SwtXulLoader.loadXul方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInstance
import org.pentaho.ui.xul.swt.SwtXulLoader; //导入方法依赖的package包/类
public static FileOverwriteDialogController getInstance(Shell shell, List<UIRepositoryObject> objects) {
try {
SwtXulLoader swtLoader = new SwtXulLoader();
swtLoader.setOuterContext(shell);
swtLoader.setSettingsManager(XulSpoonSettingsManager.getInstance());
XulDomContainer container = swtLoader.loadXul("org/pentaho/di/ui/repository/repositoryexplorer/xul/file-overwrite-dialog.xul", resourceBundle); //$NON-NLS-1$
final XulRunner runner = new SwtXulRunner();
runner.addContainer(container);
FileOverwriteDialogController dialogController = new FileOverwriteDialogController(container, objects);
container.addEventHandler(dialogController);
runner.initialize();
return dialogController;
} catch (Exception e) {
return null;
}
}
示例2: initializeXul
import org.pentaho.ui.xul.swt.SwtXulLoader; //导入方法依赖的package包/类
private void initializeXul() throws XulException {
SwtXulLoader loader = new SwtXulLoader();
loader.registerClassLoader(getClass().getClassLoader());
loader.setSettingsManager(XulSpoonSettingsManager.getInstance());
loader.setOuterContext(parentShell);
container = loader.loadXul( xulFile, new XulSpoonResourceBundle(getClassForMessages()));
bf.setDocument(container.getDocumentRoot());
for(XulEventHandler h : getEventHandlers()){
container.addEventHandler(h);
}
runner = new SwtXulRunner();
runner.addContainer(container);
// try and get the dialog
xulDialog = (XulDialog) container.getDocumentRoot().getRootElement();
dialogShell = (Shell) xulDialog.getRootObject();
runner.initialize();
}
示例3: open
import org.pentaho.ui.xul.swt.SwtXulLoader; //导入方法依赖的package包/类
public void open() {
try {
SwtXulLoader theLoader = new SwtXulLoader();
theLoader.setSettingsManager(XulSpoonSettingsManager.getInstance());
theLoader.setOuterContext(this.shell);
this.container = theLoader.loadXul(XUL);
this.controller = new XulPreviewRowsController(this.shell, this.databaseMeta, this.schema, this.table, this.limit);
this.container.addEventHandler(this.controller);
this.runner = new SwtXulRunner();
this.runner.addContainer(this.container);
this.runner.initialize();
XulDialog thePreviewDialog = (XulDialog) this.container.getDocumentRoot().getElementById("previewRowsDialog");
thePreviewDialog.show();
} catch (Exception e) {
logger.info(e);
}
}
示例4: open
import org.pentaho.ui.xul.swt.SwtXulLoader; //导入方法依赖的package包/类
public void open(boolean isAcceptButtonHidden) {
try {
SwtXulLoader theLoader = new SwtXulLoader();
theLoader.setOuterContext(this.shell);
theLoader.setSettingsManager(XulSpoonSettingsManager.getInstance());
this.container = theLoader.loadXul(XUL);
this.controller = new XulStepFieldsController(this.shell, this.databaseMeta, this.schemaTableCombo, this.rowMeta);
this.controller.setShowAcceptButton(isAcceptButtonHidden);
this.container.addEventHandler(this.controller);
this.runner = new SwtXulRunner();
this.runner.addContainer(this.container);
this.runner.initialize();
XulDialog thePreviewDialog = (XulDialog) this.container.getDocumentRoot().getElementById("stepFieldsDialog");
thePreviewDialog.show();
((SwtDialog)thePreviewDialog).dispose();
} catch (Exception e) {
logger.info(e);
}
}
示例5: preview
import org.pentaho.ui.xul.swt.SwtXulLoader; //导入方法依赖的package包/类
public void preview() {
try {
AbstractReportDefinition element = processWizardSpecification();
SwtXulLoader theXulLoader = new SwtXulLoader();
theXulLoader.registerClassLoader(getClass().getClassLoader());
theXulLoader.setOuterContext(((XulRoot) document.getRootElement()).getRootObject());
theXulLoader.register("PRPT", "org.pentaho.agilebi.spoon.visualizations.xul.PrptViewerTag");
theXulContainer = theXulLoader.loadXul("org/pentaho/agilebi/spoon/wizard/prptPreview.xul");
theXulContainer.addEventHandler(new PreviewCloseHandler());
SwtXulRunner theRunner = new SwtXulRunner();
theRunner.addContainer(theXulContainer);
theRunner.initialize();
PrptViewerTag thePrptViewerTag = (PrptViewerTag) theXulContainer.getDocumentRoot().getElementById("prptViewer");
thePrptViewerTag.setMasterReport((MasterReport) element);
XulDialog theDialog = (XulDialog) theXulContainer.getDocumentRoot().getElementById("prpt-preview");
theDialog.show();
} catch (Exception e) {
e.printStackTrace();
logger.error("error previewing", e);
}
}
示例6: testPrptSrc
import org.pentaho.ui.xul.swt.SwtXulLoader; //导入方法依赖的package包/类
@Test
public void testPrptSrc() throws Exception{
if(ClassicEngineBoot.getInstance().isBootDone() == false){
ClassicEngineBoot engineBoot = ClassicEngineBoot.getInstance();
engineBoot.start();
}
SwtXulLoader loader = new SwtXulLoader();
loader.register("PRPT", PrptViewerTag.class.getCanonicalName());
XulDomContainer container = loader.loadXul("org/pentaho/agilebi/test/res/prpt.xul");
PrptViewerTag prpt = (PrptViewerTag) container.getDocumentRoot().getElementById("prptViewer");
prpt.setSrc("test-res/test.prpt");
}
示例7: getSwtInstance
import org.pentaho.ui.xul.swt.SwtXulLoader; //导入方法依赖的package包/类
public XulDomContainer getSwtInstance(Shell shell) throws XulException {
XulDomContainer container = null;
SwtXulLoader loader = new SwtXulLoader();
Iterable<String> keyIterable = extendedClasses.keySet();
for (Object key : keyIterable) {
loader.register((String) key, extendedClasses.get(key));
}
loader.setOuterContext(shell);
container = loader.loadXul(DIALOG_DEFINITION_FILE, Messages.getBundle());
container.initialize();
return container;
}
示例8: getSwtInstance
import org.pentaho.ui.xul.swt.SwtXulLoader; //导入方法依赖的package包/类
public XulDomContainer getSwtInstance( SwtXulLoader loader, Shell shell ) throws XulException {
XulDomContainer container = null;
Iterable<String> keyIterable = extendedClasses.keySet();
for ( Object key : keyIterable ) {
loader.register( (String) key, extendedClasses.get( key ) );
}
loader.setOuterContext( shell );
container = loader.loadXul( DIALOG_DEFINITION_FILE, Messages.getBundle() );
container.initialize();
return container;
}
示例9: XulUI
import org.pentaho.ui.xul.swt.SwtXulLoader; //导入方法依赖的package包/类
public XulUI( Shell shell, ModelerWorkspace model) throws ModelerException {
try{
SwtXulLoader loader = new SwtXulLoader();
loader.registerClassLoader(getClass().getClassLoader());
loader.setOuterContext(shell);
container = loader.loadXul("org/pentaho/agilebi/modeler/res/panel.xul", new PDIMessages(ModelerWorkspace.class)); //$NON-NLS-1$
controller = new SpoonModelerController(model);
this.meta = new ModelerEngineMeta(controller);
BindingFactory bf = new SwtBindingFactory();
bf.setDocument(container.getDocumentRoot());
container.addEventHandler(controller);
controller.setBindingFactory(bf);
controller.setWorkspaceHelper(new SpoonModelerWorkspaceHelper());
ModelerUiHelper.configureControllers(container, model, bf, controller, new ColResolverController());
runner = new SwtXulRunner();
runner.addContainer(container);
runner.initialize();
container.loadPerspective("ov1");
} catch(Exception e){
logger.info("error initializing", e);
throw new ModelerException(e);
}
}
示例10: initDialogController
import org.pentaho.ui.xul.swt.SwtXulLoader; //导入方法依赖的package包/类
/**
* Initializes a dialog using the specified xul document and dialog id. If
* an event handler is not provided the dialog class will be added as an
* event handler
* @param xulPath Path to the XUL document
* @param dialogId Id of the dialog to create
* @param eventHandler Optional event handler to register
* @param perspective Optional perspective to load
* @throws XulException
*/
public void initDialogController( String xulPath, String dialogId, XulEventHandler eventHandler, String perspective ) throws XulException {
SwtXulLoader loader = new SwtXulLoader();
loader.registerClassLoader(getClass().getClassLoader());
loader.setSettingsManager(XulSpoonSettingsManager.getInstance());
loader.setOuterContext(shell);
container = loader.loadXul( xulPath );
if( eventHandler != null ) {
container.addEventHandler(eventHandler);
} else {
container.addEventHandler(this);
}
runner = new SwtXulRunner();
runner.addContainer(container);
// try and get the dialog
xulDialog = (XulDialog) container.getDocumentRoot().getRootElement().getElementById( dialogId );
swtDialog = (Composite) container.getDocumentRoot().getRootElement().getElementById( dialogId ).getManagedObject();
runner.initialize();
if( perspective != null ) {
container.loadPerspective( perspective );
}
}
示例11: createVisualizationFromModel
import org.pentaho.ui.xul.swt.SwtXulLoader; //导入方法依赖的package包/类
public void createVisualizationFromModel(ModelerWorkspace model, boolean tempModel) {
Spoon spoon = ((Spoon)SpoonFactory.getInstance());
try {
if(tempModel){
ModelerHelper theHelper = ModelerHelper.getInstance();
model = theHelper.clone(model);
}
SwtXulLoader theXulLoader = new SwtXulLoader();
theXulLoader.registerClassLoader(getClass().getClassLoader());
String theFileName = model.getFileName();
if(theFileName == null) {
theFileName = "models/" + model.getModelName() + ".xmi";
}
// flush the cache before creating an analyzer visualization
flushAnalyzerCache();
AnalyzerVisualizationController theController = new AnalyzerVisualizationController(spoon.tabfolder.getSwtTabset(), this, theFileName, model.getModelName(), null, null);
theController.setModel(model);
XulDomContainer theXulContainer = theXulLoader.loadXul(WEB_VISUALIZATION, new PDIMessages(IVisualization.class));
theXulContainer.addEventHandler(theController);
Composite theMainBox = (Composite) theXulContainer.getDocumentRoot().getElementById("mainVBox").getManagedObject();
SwtXulRunner theRunner = new SwtXulRunner();
theRunner.addContainer(theXulContainer);
theRunner.initialize();
createTabForBrowser(theMainBox, theController, model);
reportName = "Unsaved Report"; //$NON-NLS-1$
String contentId = AgileBiVisualizationPerspective.PERSPECTIVE_ID+"\t"+theController.toString(); //$NON-NLS-1$
// TODO - JD enable this in Spoon 4.4
// Spoon.getInstance().addCaller(callerId, contentId);
} catch (Throwable e) {
throw new RuntimeException(e);
}
}
示例12: open
import org.pentaho.ui.xul.swt.SwtXulLoader; //导入方法依赖的package包/类
public boolean open(Node transNode, String fname, boolean importfile) {
Spoon spoon = ((Spoon)SpoonFactory.getInstance());
try {
File f = new File( fname );
reportName = f.getName();
reportName = reportName.substring(0, reportName.indexOf(".xanalyzer")); //$NON-NLS-1$
FileInputStream in = new FileInputStream( f );
StringBuilder sb = new StringBuilder();
byte b[] = new byte[2048];
int n = in.read(b);
while( n != -1 ) {
sb.append( new String(b, 0, n) );
n = in.read(b);
}
Document doc = DocumentHelper.parseText(sb.toString());
Dom4jXPath xpath = new Dom4jXPath( "//@catalog"); //$NON-NLS-1$
Dom4jXPath xpath2 = new Dom4jXPath( "//@cube"); //$NON-NLS-1$
HashMap map = new HashMap();
map.put( "pho", "http://www.pentaho.com"); //$NON-NLS-1$ //$NON-NLS-2$
xpath.setNamespaceContext( new SimpleNamespaceContext( map));
xpath2.setNamespaceContext( new SimpleNamespaceContext( map));
org.dom4j.Node node = (org.dom4j.Node) xpath.selectSingleNode( doc);
org.dom4j.Node node2 = (org.dom4j.Node) xpath2.selectSingleNode( doc);
String modelFileName = node.getText();
String modelId = node2.getText();
SwtXulLoader theXulLoader = new SwtXulLoader();
theXulLoader.registerClassLoader(getClass().getClassLoader());
AnalyzerVisualizationController theController = new AnalyzerVisualizationController(spoon.tabfolder.getSwtTabset(), this, modelFileName, modelId, f.toString(), f.getName());
theController.setDirty(false);
XulDomContainer theXulContainer = theXulLoader.loadXul(WEB_VISUALIZATION, new PDIMessages(IVisualization.class));
theXulContainer.addEventHandler(theController);
Composite theMainBox = (Composite) theXulContainer.getDocumentRoot().getElementById("mainVBox").getManagedObject(); //$NON-NLS-1$
SwtXulRunner theRunner = new SwtXulRunner();
theRunner.addContainer(theXulContainer);
theRunner.initialize();
ModelerWorkspace model = new ModelerWorkspace(new SpoonModelerWorkspaceHelper(), SpoonModelerWorkspaceHelper.initGeoContext());
XmiParser parser = new XmiParser();
FileInputStream inputStream = new FileInputStream(new File(modelFileName));
Domain domain = parser.parseXmi(inputStream);
inputStream.close();
if(model.getDomain() != null) {
LogicalModel logical = model.getLogicalModel(ModelerPerspective.ANALYSIS);
Object property = logical.getProperty("source_type"); //$NON-NLS-1$
if( property != null ) {
IModelerSource theSource = ModelerSourceFactory.generateSource(property.toString());
theSource.initialize(domain);
model.setModelSource(theSource);
}
}
if (domain.getId() == null) {
domain.setId(modelId);
}
model.setDomain(domain);
model.setModelName(domain.getId());
model.setFileName(modelFileName);
model.setTemporary(false);
theController.setModel(model);
theXulContainer.addEventHandler(theController);
createTabForBrowser(theMainBox, theController, model);
// flush the cache before opening an analyzer visualization
flushAnalyzerCache();
theController.openReport(fname);
String fullPath = f.getAbsolutePath();
spoon.getProperties().addLastFile("Analyzer", fullPath, null, false, null); //$NON-NLS-1$
spoon.addMenuLast();
} catch (Throwable e) {
throw new RuntimeException(e);
} return true;
}
示例13: open
import org.pentaho.ui.xul.swt.SwtXulLoader; //导入方法依赖的package包/类
public boolean open(Node transNode, String fname, boolean importfile) {
try {
if(ClassicEngineBoot.getInstance().isBootDone() == false){
ObjectUtilities.setClassLoader(getClass().getClassLoader());
ObjectUtilities.setClassLoaderSource(ObjectUtilities.CLASS_CONTEXT);
LibLoaderBoot.getInstance().start();
LibFontBoot.getInstance().start();
ClassicEngineBoot.getInstance().start();
}
ResourceManager theResourceManager = new ResourceManager();
theResourceManager.registerDefaults();
File theReportFile = new File(fname);
Resource theResource = theResourceManager.createDirectly(theReportFile, MasterReport.class);
MasterReport masterReport = (MasterReport) theResource.getResource();
XulTabAndPanel tabAndPanel = AgileBiVisualizationPerspective.getInstance().createTab();
AgileBiVisualizationPerspective.getInstance().setNameForTab(tabAndPanel.tab, getPathAndFilename(fname)[1].replace(".prpt", "")); //$NON-NLS-1$ //$NON-NLS-2$
SpoonPerspectiveManager.getInstance().activatePerspective(AgileBiVisualizationPerspective.class);
SwtXulLoader theXulLoader = new SwtXulLoader();
theXulLoader.registerClassLoader(getClass().getClassLoader());
theXulLoader.register("PRPT", "org.pentaho.agilebi.spoon.visualizations.xul.PrptViewerTag"); //$NON-NLS-1$ //$NON-NLS-2$
XulDomContainer theXulContainer = theXulLoader.loadXul("org/pentaho/agilebi/spoon/visualizations/prpt/prptVisualization.xul", new PDIMessages(IVisualization.class)); //$NON-NLS-1$
PRPTMeta meta = new PRPTMeta();
meta.setTab(tabAndPanel.tab);
AgileBiVisualizationPerspective.getInstance().setMetaForTab(tabAndPanel.tab, meta);
PRPTVisualizationController controller = new PRPTVisualizationController(meta, masterReport);
controller.setFileName(fname);
controller.setDirty(false);
PmdDataFactory theDataFactory = (PmdDataFactory) masterReport.getDataFactory();
String theXmiFile = theDataFactory.getXmiFile();
ModelerWorkspace model = new ModelerWorkspace(new SpoonModelerWorkspaceHelper(), SpoonModelerWorkspaceHelper.initGeoContext());
XmiParser parser = new XmiParser();
FileInputStream inputStream = new FileInputStream(new File(theXmiFile));
Domain domain = parser.parseXmi(inputStream);
inputStream.close();
LogicalModel logical = domain.getLogicalModels().get(0);
Object property = logical.getProperty("source_type"); //$NON-NLS-1$
if( property != null ) {
IModelerSource theSource = ModelerSourceFactory.generateSource(property.toString());
theSource.initialize(domain);
model.setModelSource(theSource);
}
model.setDomain(domain);
model.setModelName(domain.getId());
model.setFileName(theXmiFile);
model.setTemporary(false);
controller.setModel(model);
theXulContainer.addEventHandler(controller);
Composite theMainBox = (Composite) theXulContainer.getDocumentRoot().getElementById("mainContainer").getManagedObject(); //$NON-NLS-1$
SwtXulRunner theRunner = new SwtXulRunner();
theRunner.addContainer(theXulContainer);
theRunner.initialize();
theMainBox.setParent((Composite) tabAndPanel.panel.getManagedObject());
((Composite) tabAndPanel.panel.getManagedObject()).layout(true);
AgileBiVisualizationPerspective.getInstance().setSelectedMeta(meta);
return true;
} catch(Exception e){
e.printStackTrace();
}
return false;
}
示例14: createVisualizationFromMasterReport
import org.pentaho.ui.xul.swt.SwtXulLoader; //导入方法依赖的package包/类
public void createVisualizationFromMasterReport(MasterReport rpt, boolean tempModel){
try{
if(ClassicEngineBoot.getInstance().isBootDone() == false){
LibLoaderBoot.getInstance().start();
LibFontBoot.getInstance().start();
ClassicEngineBoot.getInstance().start();
}
XulTabAndPanel tabAndPanel = AgileBiVisualizationPerspective.getInstance().createTab();
AgileBiVisualizationPerspective.getInstance().setNameForTab(tabAndPanel.tab, "Untitled Report"); //$NON-NLS-1$
SpoonPerspectiveManager.getInstance().activatePerspective(AgileBiVisualizationPerspective.class);
SwtXulLoader theXulLoader = new SwtXulLoader();
theXulLoader.registerClassLoader(getClass().getClassLoader());
theXulLoader.register("PRPT", "org.pentaho.agilebi.spoon.visualizations.xul.PrptViewerTag"); //$NON-NLS-1$ //$NON-NLS-2$
XulDomContainer theXulContainer = theXulLoader.loadXul("org/pentaho/agilebi/spoon/visualizations/prpt/prptVisualization.xul", new PDIMessages(IVisualization.class)); //$NON-NLS-1$
Composite theMainBox = (Composite) theXulContainer.getDocumentRoot().getElementById("mainContainer").getManagedObject(); //$NON-NLS-1$
PRPTMeta meta = new PRPTMeta();
AgileBiVisualizationPerspective.getInstance().setMetaForTab(tabAndPanel.tab, meta);
meta.setTab(tabAndPanel.tab);
PRPTVisualizationController controller = new PRPTVisualizationController(meta, rpt);
PmdDataFactory theDataFactory = (PmdDataFactory) rpt.getDataFactory();
String theXmiFile = theDataFactory.getXmiFile();
XmiParser parser = new XmiParser();
FileInputStream inputStream = new FileInputStream(new File(theXmiFile));
Domain domain = parser.parseXmi(inputStream);
inputStream.close();
ModelerWorkspace model = new ModelerWorkspace(new SpoonModelerWorkspaceHelper(), SpoonModelerWorkspaceHelper.initGeoContext());
LogicalModel logical = domain.getLogicalModels().get(0);
Object property = logical.getProperty("source_type"); //$NON-NLS-1$
if( property != null ) {
IModelerSource theSource = ModelerSourceFactory.generateSource(property.toString());
theSource.initialize(domain);
model.setModelSource(theSource);
}
model.setDomain(domain);
model.setModelName(domain.getLogicalModels().get(0).getName(LocalizedString.DEFAULT_LOCALE));
model.setFileName(theXmiFile);
model.setTemporary(tempModel);
controller.setModel(model);
theXulContainer.addEventHandler(controller);
SwtXulRunner theRunner = new SwtXulRunner();
theRunner.addContainer(theXulContainer);
theRunner.initialize();
theMainBox.setParent((Composite) tabAndPanel.panel.getManagedObject());
((Composite) tabAndPanel.panel.getManagedObject()).layout(true);
AgileBiVisualizationPerspective.getInstance().setSelectedMeta(meta);
Spoon.getInstance().enableMenus();
} catch(Exception e){
logger.error("Error creating visualization", e);
}
}
示例15: open
import org.pentaho.ui.xul.swt.SwtXulLoader; //导入方法依赖的package包/类
public boolean open() {
try {
SwtXulLoader theLoader = new SwtXulLoader();
theLoader.setSettingsManager(XulSpoonSettingsManager.getInstance());
theLoader.setSettingsManager(new DefaultSettingsManager(new File(Const.getKettleDirectory() + Const.FILE_SEPARATOR + "xulSettings.properties")));
theLoader.setOuterContext(this.shell);
this.container = theLoader.loadXul(XUL, new XulDatabaseExplorerResourceBundle());
XulDialog theExplorerDialog = (XulDialog) this.container.getDocumentRoot().getElementById("databaseExplorerDialog");
SpoonPluginManager.getInstance().applyPluginsForContainer("database_dialog", container);
this.controller = new XulDatabaseExplorerController((Shell) theExplorerDialog.getRootObject(), this.databaseMeta, this.databases, look);
this.container.addEventHandler(this.controller);
this.runner = new SwtXulRunner();
this.runner.addContainer(this.container);
this.runner.initialize();
this.controller.setSelectedSchemaAndTable(schemaName, selectedTable);
theExplorerDialog.show();
} catch (Exception e) {
logger.info(e);
e.printStackTrace();
}
return this.controller.getSelectedTable() != null;
}