Пример #1
0
  @Override
  public void createPartControl(Composite parent) {
    Composite c = new Composite(parent, SWT.NONE);
    c.setLayout(new GridLayout(1, false));
    GridData gd = new GridData(GridData.FILL_BOTH);
    c.setLayoutData(gd);

    mView = new UiAutomatorView(c, SWT.BORDER);
    mView.setLayoutData(new GridData(GridData.FILL_BOTH));

    if (mFilePath == null) {
      return;
    }

    UiAutomatorModel model = null;
    File modelFile = new File(mFilePath);
    try {
      model = new UiAutomatorModel(modelFile);
    } catch (Exception e) {
      MessageDialog.openError(
          parent.getShell(),
          "Error opening " + mFilePath,
          "Unexpected error while parsing input: " + e.getMessage());
      return;
    }

    mView.setModel(model, modelFile, null);
  }
Пример #2
0
 protected void setModel(UiAutomatorModel model, File modelFile, Image screenshot) {
   mView.setModel(model, modelFile, screenshot);
 }