Package org.eclipse.jst.pagedesigner.dnd

Examples of org.eclipse.jst.pagedesigner.dnd.ILocalDropHandler


   * @see org.eclipse.gef.commands.Command#execute()
   */
  public void execute() {
    if (_feedbackToHandlers.size() == 1) {
      // only have one choice.
      ILocalDropHandler handler = (ILocalDropHandler) _feedbackToHandlers
          .values().toArray()[0];
      if (handler.useWizard(_localObject, _viewer)) {
        IWizard wizard;
        if (_widget != null) {
          wizard = handler.getWizard(_localObject, _widget, _viewer);
        } else {
          wizard = handler
              .getWizard(_localObject, _position, _viewer);
        }
        CommonWizardDialog wizardDialog = new CommonWizardDialog(
            getShell(), wizard);
        wizardDialog.setTitle(Messages
            .getString("LocalDropCommand.DropHandler")); //$NON-NLS-1$
        wizardDialog.create();
        wizardDialog.open();
      } else {
        if (_widget != null) {
          handler.doUpdateWidget(_localObject, _widget, _viewer);
        } else {
          handler.doInsertElements(_localObject, _position, _viewer);
        }
      }
    } else {
      CommonWizardDialog wizardDialog = new CommonWizardDialog(
          getShell(), getWizard());
View Full Code Here


  /**
   * @param obj
   * @return
   */
  private Object getWizardNodeOrHandler(Object obj) {
    final ILocalDropHandler dropHandler = (ILocalDropHandler) _feedbackToHandlers
        .get(obj);
    if (dropHandler.useWizard(_localData, _viewer)) {
      return new IWizardNode() {
        IWizard _wizard = null;

        public void dispose() {
                    // nothing to dispose
        }

        public Point getExtent() {
          return null;
        }

        public IWizard getWizard() {
          if (_wizard == null) {
            if (_updateWidget) {
              _wizard = dropHandler.getWizard(_localData,
                  _widget, _viewer);
            } else {
              _wizard = dropHandler.getWizard(_localData,
                  _position, _viewer);
            }
          }
          return _wizard;
        }
View Full Code Here

   */
  public boolean performFinish() {
    if (getContainer().getCurrentPage() == _firstPage) {
      Object obj = _firstPage.getCurrentHandler();
      if (obj instanceof ILocalDropHandler) {
        ILocalDropHandler handler = (ILocalDropHandler) obj;
        if (_updateWidget) {
          handler.doUpdateWidget(_localData, _widget, _viewer);
        } else {
          handler.doInsertElements(_localData, _position, _viewer);
        }
        return true;
      }
    }
    return true;
View Full Code Here

TOP

Related Classes of org.eclipse.jst.pagedesigner.dnd.ILocalDropHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.