Example #1
0
  @Override
  public void createPartControl(Composite parent) {
    mMainFrame = new MainFrame(parent, SWT.NULL);

    ImageViewer imageViewer = mMainFrame.getImageEditorPanel().getImageViewer();
    imageViewer.addUpdateListener(this);

    mNinePatchedImage = imageViewer.loadFile(mFileEditorInput.getPath().toOSString());
    if (mNinePatchedImage.hasNinePatchExtension()) {
      if (!mNinePatchedImage.ensure9Patch() && showConvertMessageBox(mFileName)) {
        // Reload image
        mNinePatchedImage = imageViewer.loadFile(mFileEditorInput.getPath().toOSString());
        mNinePatchedImage.convertToNinePatch();
      }
    } else {
      mNinePatchedImage.convertToNinePatch();
    }

    imageViewer.startDisplay();

    parent.layout();
  }
Example #2
0
 @Override
 public void setFocus() {
   mMainFrame.forceFocus();
 }