private void disableButtons() { document.getElementById( OPEN_REVISION_BUTTON ).setDisabled( true ); document.getElementById( RESTORE_REVISION_BUTTON ).setDisabled( true ); }
protected void loadDatabaseOptionsFragment( String fragmentUri ) throws XulException { XulComponent groupElement = document.getElementById( "database-options-box" ); XulComponent parentElement = groupElement.getParent(); XulDomContainer fragmentContainer; try { // Get new group box fragment ... // This will effectively set up the SWT parent child relationship... fragmentContainer = this.xulDomContainer.loadFragment( fragmentUri, Messages.getBundle() ); XulComponent newGroup = fragmentContainer.getDocumentRoot().getFirstChild(); parentElement.replaceChild( groupElement, newGroup ); } catch ( XulException e ) { e.printStackTrace(); throw e; } }
public Shell getShell() { XulDialog dialog = (XulDialog) container.getDocumentRoot().getElementById( "repository-login-dialog" ); return (Shell) dialog.getRootObject(); } }
protected void initializeXul( XulLoader loader, BindingFactory bindingFactory, XulRunner runner, Object parent ) throws XulException { bf = bindingFactory; this.runner = runner; loader.registerClassLoader( getClass().getClassLoader() ); loader.setSettingsManager( getSettingsManager() ); loader.setOuterContext( parent ); container = loader.loadXul( xulFile, getResourceBundle() ); bf.setDocument( container.getDocumentRoot() ); for ( XulEventHandler h : getEventHandlers() ) { container.addEventHandler( h ); } this.runner.addContainer( container ); // try and get the dialog xulDialog = (XulDialog) container.getDocumentRoot().getRootElement(); runner.initialize(); }
public void hide() { XulDialog dialog = (XulDialog) container.getDocumentRoot().getElementById( "repository-config-dialog" ); //$NON-NLS-1$ dialog.hide(); }
public void enableMenuItem( String itemId ) { XulMenuitem item = (XulMenuitem) mainSpoonContainer.getDocumentRoot().getElementById( itemId ); item.setDisabled( false ); }
public void dispose() { SwtDialog dialog = (SwtDialog) container.getDocumentRoot().getElementById( "repository-explorer-dialog" ); dialog.dispose(); initialized = false; }
public void setMenuBarVisible( boolean visible ) { mainSpoonContainer.getDocumentRoot().getElementById( "edit" ).setVisible( visible ); mainSpoonContainer.getDocumentRoot().getElementById( "file" ).setVisible( visible ); mainSpoonContainer.getDocumentRoot().getElementById( "view" ).setVisible( visible ); mainSpoonContainer.getDocumentRoot().getElementById( "action" ).setVisible( visible ); mainSpoonContainer.getDocumentRoot().getElementById( "tools" ).setVisible( visible ); mainSpoonContainer.getDocumentRoot().getElementById( "help" ).setVisible( visible ); MenuManager menuManager = getMenuBarManager(); menuManager.getMenu().setVisible( visible ); menuManager.updateAll( true ); }
public void init() { xulDialog = ( (XulDialog) getXulDomContainer().getDocumentRoot().getRootElement() ); if ( bf != null ) { bind(); } }
public void dispose() { super.dispose(); List<XulComponent> pops = xulDomContainer.getDocumentRoot().getElementsByTagName( "menupopup" ); for ( XulComponent pop : pops ) { ( (MenuManager) pop.getManagedObject() ).dispose(); } } }
private Document getDocumentRoot() { initMainSpoonContainer(); if ( spoonXulContainer != null ) { return spoonXulContainer.getDocumentRoot(); } else { return null; } }
public boolean setFocus() { xulDomContainer.addEventHandler( this ); return super.setFocus(); }
private void traverseDomSetReadOnly( XulComponent component, boolean readonly ) { component.setDisabled( readonly ); List<XulComponent> children = component.getChildNodes(); if ( children != null && children.size() > 0 ) { for ( XulComponent child : children ) { child.setDisabled( readonly ); traverseDomSetReadOnly( child, readonly ); } } }
public void initControllers( Repository rep ) throws ControllerInitializationException { for ( String name : controllerNames ) { try { IUISupportController controller = (IUISupportController) container.getEventHandler( name ); controller.init( rep ); } catch ( XulException e ) { throw new ControllerInitializationException( e ); } } }
private void unloadPerspective( SpoonPerspective per ) { per.setActive( false ); List<XulOverlay> overlays = per.getOverlays(); if ( overlays != null ) { for ( XulOverlay overlay : overlays ) { try { domContainer.removeOverlay( overlay.getOverlayUri() ); } catch ( XulException e ) { log.logError( "Error unload perspective", e ); } } } getSpoon().enableMenus(); }
protected void confirm( String title, String message ) throws XulException { String ok = BaseMessages.getString( PKG, "Dialog.Ok" ); try { confirmDialog( title, message, ok ); } catch ( Exception e ) { throw new XulException( e ); } }
/** * Retrieve file from original path. */ private static InputStream getResourceInputStream( String resource, XulDomContainer container ) throws IOException { return ( (KettleXulLoader) container.getXulLoader() ).getOriginalResourceAsStream( resource ); }
protected void initializeXul( XulLoader loader, BindingFactory bindingFactory, XulRunner runner, Object parent ) throws XulException { bf = bindingFactory; this.runner = runner; loader.registerClassLoader( getClass().getClassLoader() ); loader.setSettingsManager( getSettingsManager() ); loader.setOuterContext( parent ); container = loader.loadXul( xulFile, getResourceBundle() ); bf.setDocument( container.getDocumentRoot() ); for ( XulEventHandler h : getEventHandlers() ) { container.addEventHandler( h ); } this.runner.addContainer( container ); // try and get the dialog xulDialog = (XulDialog) container.getDocumentRoot().getRootElement(); runner.initialize(); }
private void disableMenuItem( org.pentaho.ui.xul.dom.Document doc, String itemId, boolean disable ) { XulComponent menuItem = doc.getElementById( itemId ); if ( menuItem != null ) { menuItem.setDisabled( disable ); } else { log.logError( "Non-Fatal error : Menu Item with id = " + itemId + " does not exist! Check 'menubar.xul'" ); } }
protected void confirm( String title, String message, final Callable<Void> onAccept ) throws XulException { String yes = BaseMessages.getString( PKG, "Dialog.YesDelete" ); String no = BaseMessages.getString( PKG, "Dialog.No" ); try { confirmDialog( onAccept, BaseMessages.getString( PKG, title ), BaseMessages.getString( PKG, message ), yes, no ); } catch ( Exception e ) { throw new XulException( e ); } }