org.pentaho.ui.xul.containers.XulWindow Java Examples

The following examples show how to use org.pentaho.ui.xul.containers.XulWindow. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ExportHandlerTest.java    From pentaho-aggdesigner with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Tests all of the copy* methods.
 */
@Test
public void testCopyToClipboard() throws Exception {
  final XulTextbox textbox = context.mock(XulTextbox.class);
  final XulWindow window = context.mock(XulWindow.class);
  final String stringToCopy = "ignored"; //$NON-NLS-1$
  context.checking(new Expectations() {
    {
      exactly(3).of(doc).getElementById(with(any(String.class)));
      will(returnValue(textbox));
      exactly(3).of(textbox).getValue();
      will(returnValue(stringToCopy));
      exactly(3).of(doc).getRootElement();
      will(returnValue(window));
      exactly(3).of(window).copy(with(equal(stringToCopy)));
    }
  });
  controller.copyDdlToClipboard();
  controller.copyDmlToClipboard();
  controller.copyToClipboardMultiDimPreview();
}
 
Example #2
Source File: DataHandler.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
private void close() {
  XulComponent window = document.getElementById( "general-datasource-window" );

  if ( window == null ) { // window must be root
    window = document.getRootElement();
  }
  if ( window instanceof XulDialog ) {
    ( (XulDialog) window ).hide();
  } else if ( window instanceof XulWindow ) {
    ( (XulWindow) window ).close();
  }
}
 
Example #3
Source File: DataHandler.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
private boolean windowClosed() {
  boolean closedWindow = true;
  XulComponent window = document.getElementById( "general-datasource-window" );

  if ( window == null ) { // window must be root
    window = document.getRootElement();
  }
  if ( window instanceof XulWindow ) {
    closedWindow = ( (XulWindow) window ).isClosed();
  }
  return closedWindow;
}
 
Example #4
Source File: ExportHandler.java    From pentaho-aggdesigner with GNU General Public License v2.0 5 votes vote down vote up
public void copyDdlToClipboard() {
  try {
    XulTextbox ddlField = (XulTextbox) document.getElementById(ELEM_ID_DDL_FIELD);
    Assert.notNull(ddlField, "could not find element with id '" + ELEM_ID_DDL_FIELD + "'");
    ((XulWindow) document.getRootElement()).copy(ddlField.getValue());

  } catch (XulException e) {
    if (logger.isErrorEnabled()) {
      logger.error("an exception occurred", e);
    }
  }
}
 
Example #5
Source File: ExportHandler.java    From pentaho-aggdesigner with GNU General Public License v2.0 5 votes vote down vote up
public void copyDmlToClipboard() {

    try {
      XulTextbox dmlField = (XulTextbox) document.getElementById(ELEM_ID_DML_FIELD);
      Assert.notNull(dmlField, "could not find element with id '" + ELEM_ID_DML_FIELD + "'");
      ((XulWindow) document.getRootElement()).copy(dmlField.getValue());

    } catch (XulException e) {
      if (logger.isErrorEnabled()) {
        logger.error("an exception occurred", e);
      }
    }
  }
 
Example #6
Source File: ExportHandler.java    From pentaho-aggdesigner with GNU General Public License v2.0 5 votes vote down vote up
public void copyToClipboardMultiDimPreview() {
  XulTextbox multiDimSchemaField = (XulTextbox) document.getElementById("multiDimSchemaField");
  try {
    ((XulWindow) document.getRootElement()).copy(multiDimSchemaField.getValue());
  } catch (XulException e) {
    if (logger.isErrorEnabled()) {
      logger.error("an exception occurred", e);
    }
  }
}
 
Example #7
Source File: MainController.java    From pentaho-aggdesigner with GNU General Public License v2.0 5 votes vote down vote up
public void cut() {
  try {
    ((XulWindow) this.getXulDomContainer().getDocumentRoot().getRootElement()).cut();
    paste.setDisabled(false);
  } catch (XulException e) {
    logger.error(e.getMessage(), e);
  }
}
 
Example #8
Source File: MainController.java    From pentaho-aggdesigner with GNU General Public License v2.0 5 votes vote down vote up
public void copy() {
  try {
    ((XulWindow) this.getXulDomContainer().getDocumentRoot().getRootElement()).copy();
    paste.setDisabled(false);
  } catch (XulException e) {
    logger.error(e.getMessage(), e);
  }
}
 
Example #9
Source File: MainController.java    From pentaho-aggdesigner with GNU General Public License v2.0 5 votes vote down vote up
public void paste() {
  try {
    ((XulWindow) this.getXulDomContainer().getDocumentRoot().getRootElement()).paste();
    paste.setDisabled(false);
  } catch (XulException e) {
    logger.error(e.getMessage(), e);
  }
}
 
Example #10
Source File: XulDesignerFrame.java    From pentaho-reporting with GNU Lesser General Public License v2.1 4 votes vote down vote up
public XulWindow getWindow() {
  return window;
}