@Override
  protected Control createDialogArea(Composite parent) {
    this.getShell().setText(ResourceString.getResourceString(this.getTitle()));

    Composite composite = (Composite) super.createDialogArea(parent);

    try {
      GridLayout layout = new GridLayout();
      layout.numColumns = this.numColumns;
      this.initLayout(layout);

      composite.setLayout(layout);
      composite.setLayoutData(this.createLayoutData());

      this.createErrorComposite(composite);

      this.initialize(composite);

      this.setData();

      this.initialized = true;

    } catch (Exception e) {
      Activator.showExceptionDialog(e);
    }

    return composite;
  }
  public final boolean validate() {
    if (!this.initialized) {
      return true;
    }

    Button okButton = this.getButton(IDialogConstants.OK_ID);
    if (okButton != null) {
      okButton.setEnabled(false);
    }

    String errorMessage = this.getErrorMessage();

    if (errorMessage != null) {
      this.setMessage(ResourceString.getResourceString(errorMessage));
      return false;
    }

    if (okButton != null && this.enabledOkButton) {
      okButton.setEnabled(true);
    }

    this.setMessage(null);

    return true;
  }
  @Override
  protected void buttonPressed(int buttonId) {
    if (buttonId == IDialogConstants.CLOSE_ID
        || buttonId == IDialogConstants.CANCEL_ID
        || buttonId == IDialogConstants.BACK_ID) {
      this.setReturnCode(buttonId);
      this.close();

    } else if (buttonId == IDialogConstants.OK_ID) {
      try {
        if (!validate()) {
          return;
        }

        this.perfomeOK();
        setReturnCode(buttonId);
        close();

      } catch (InputException e) {
        if (e.getMessage() != null) {
          this.setMessage(ResourceString.getResourceString(e.getMessage(), e.getArgs()));
        }
        return;

      } catch (Exception e) {
        Activator.showExceptionDialog(e);
      }
    }

    super.buttonPressed(buttonId);
  }
  public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {

    try {
      String[] ddls = ddl.split(";[\r\n]+");

      monitor.beginTask(ResourceString.getResourceString("dialog.message.drop.table"), ddls.length);

      for (int i = 0; i < ddls.length; i++) {
        String message = ddls[i];
        int index = message.indexOf("\r\n");
        if (index != -1) {
          message = message.substring(0, index);
        }

        monitor.subTask("(" + (i + 1) + "/" + ddls.length + ") " + message);

        this.executeDDL(ddls[i]);
        monitor.worked(1);

        if (monitor.isCanceled()) {
          throw new InterruptedException("Cancel has been requested.");
        }
      }

      this.con.commit();

    } catch (InterruptedException e) {
      throw e;

    } catch (Exception e) {
      this.exception = e;
    }

    monitor.done();
  }
 /** {@inheritDoc} */
 @Override
 protected void refreshOutlineVisuals() {
   this.setWidgetText(
       ResourceString.getResourceString("label.column.group")
           + " ("
           + this.getModelChildren().size()
           + ")");
   this.setWidgetImage(Activator.getImage(ImageKey.DICTIONARY));
 }
  /** {@inheritDoc} */
  @Override
  public boolean validate(ERTable table, NormalColumn column) {
    if (column.getType() == null
        || column.getType().getAlias(table.getDiagram().getDatabase()) == null) {
      ValidateResult validateResult = new ValidateResult();
      validateResult.setMessage(
          ResourceString.getResourceString("error.validate.no.column.type1")
              + table.getPhysicalName()
              + ResourceString.getResourceString("error.validate.no.column.type2")
              + column.getPhysicalName());
      validateResult.setLocation(table.getLogicalName());
      validateResult.setSeverity(IMarker.SEVERITY_WARNING);
      validateResult.setObject(table);

      this.addError(validateResult);
    }

    return true;
  }
Example #7
0
  /**
   * コンストラクタ
   *
   * @param part
   */
  public CopyAction(IWorkbenchPart part) {
    super(part);

    this.setText(ResourceString.getResourceString("action.title.copy"));

    ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
    setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
    setDisabledImageDescriptor(
        sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED));

    this.setId(ActionFactory.COPY.getId());
  }
  /** {@inheritDoc} */
  @Override
  protected Control createDialogArea(Composite parent) {
    this.getShell().setText(ResourceString.getResourceString(this.getTitle()));

    Composite composite = (Composite) super.createDialogArea(parent);

    this.textArea =
        CompositeFactory.createTextArea(
            null, composite, this.getMessage(), 400, 200, 1, false, false);

    composite.setLayout(new GridLayout());

    this.textArea.setText(Format.null2blank(this.getData()));

    return composite;
  }
 public ChangeCapitalAction(ERDiagramEditor editor) {
   super(ID, null, IAction.AS_CHECK_BOX, editor);
   this.setText(ResourceString.getResourceString("action.title.display.capital"));
 }
  public TestDataCreateAction(ERDiagramEditor editor) {
    super(ID, ResourceString.getResourceString("action.title.testdata.create"), editor);

    this.setImageDescriptor(Activator.getImageDescriptor(ImageKey.TEST_DATA));
  }