Package org.dyno.visual.swing.plugin.spi

Examples of org.dyno.visual.swing.plugin.spi.WidgetEvent


      jcomp.setComponentPopupMenu(null);
      WidgetAdapter widgetAdapter = WidgetAdapter.getWidgetAdapter(widget);
      widgetAdapter.setDirty(true);
      widgetAdapter.addNotify();
      popupAdapter.deleteNotify();
      WidgetEvent we = new WidgetEvent(widgetAdapter, popupAdapter);
      for(IWidgetListener listener:ExtensionRegistry.getWidgetListeners()){
        listener.widgetRemoved(we);
      }
      widgetAdapter.repaintDesigner();
    }
View Full Code Here


      parentAdapter.doLayout();
      parentAdapter.getWidget().validate();
      if (success){
        parentAdapter.setDirty(true);
        adapter.addNotify();
        WidgetEvent we = new WidgetEvent(parentAdapter, adapter);
        for(IWidgetListener listener:ExtensionRegistry.getWidgetListeners()){
          listener.widgetRemoved(we);
        }
      }
    }
View Full Code Here

                operationHistory.execute(operation, null, null);
              } catch (ExecutionException e) {
                VisualSwingPlugin.getLogger().error(e);
              }
              for (WidgetAdapter wa : designer.getSelectedWidget()) {
                WidgetEvent we = new WidgetEvent(lastParent, compositeAdapter, wa);
                for (IWidgetListener listener : widgetListeners) {
                  listener.widgetMoved(we);
                }
              }
            } else {
              for (WidgetAdapter wa : designer.getSelectedWidget()) {
                WidgetEvent we = new WidgetEvent(compositeAdapter, wa);
                for (IWidgetListener listener : widgetListeners) {
                  listener.widgetAdded(we);
                }
              }
            }
            designer.fireDirty();
            adapter.addNotify();
          } else {
            if (lastParent != null) {
              List<WidgetAdapter> selectedWidget = designer.getSelectedWidget();
              for (int i = 0; i < selectedWidget.size(); i++) {
                WidgetAdapter wa = selectedWidget.get(i);
                Object constraints = lastConstraints.get(i);
                lastParent.addChildByConstraints(wa.getWidget(), constraints);
              }
            }
          }
        }
      } else {
        glassPlane.setHotspotPoint(null);
        if (lastParent != null) {
          IOperationHistory operationHistory = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
          List<Component> children = new ArrayList<Component>();
          for (WidgetAdapter wa : designer.getSelectedWidget()) {
            children.add(wa.getParentContainer());
          }
          IUndoableOperation operation = new DragDropOperation(lastParent, children, lastConstraints);
          operation.addContext(designer.getUndoContext());
          try {
            operationHistory.execute(operation, null, null);
          } catch (ExecutionException e) {
            VisualSwingPlugin.getLogger().error(e);
          }
          lastParent.setDirty(true);
          designer.fireDirty();
          for (WidgetAdapter wa : designer.getSelectedWidget()) {
            WidgetEvent we = new WidgetEvent(lastParent, wa);
            for (IWidgetListener listener : widgetListeners) {
              listener.widgetRemoved(we);
            }
          }
        }
      }
    } else if (currentAdapters != null) {
      WidgetAdapter adapter = currentAdapters.get(0);
      hoveredAdapter = adapter;
      IDesignOperation design = (IDesignOperation) hoveredAdapter.getAdapter(IDesignOperation.class);
      if (design != null && design.drop(adapter.convertToLocal(p))) {
        if (lastParent != null) {
          IOperationHistory operationHistory = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
          List<Component> children = new ArrayList<Component>();
          List<Object> new_constraints = new ArrayList<Object>();
          for (WidgetAdapter wa : designer.getSelectedWidget()) {
            Component child = wa.getParentContainer();
            children.add(child);
            new_constraints.add(((CompositeAdapter) adapter).getChildConstraints(child));
          }
          IUndoableOperation operation = new MoveResizeOperation(lastParent, ((CompositeAdapter) adapter), children, lastConstraints, new_constraints);
          operation.addContext(designer.getUndoContext());
          try {
            operationHistory.execute(operation, null, null);
          } catch (ExecutionException e) {
            VisualSwingPlugin.getLogger().error(e);
          }
          for (WidgetAdapter wa : designer.getSelectedWidget()) {
            WidgetEvent we = new WidgetEvent(lastParent, (CompositeAdapter) adapter, wa);
            for (IWidgetListener listener : widgetListeners) {
              listener.widgetResized(we);
            }
          }
        }
View Full Code Here

TOP

Related Classes of org.dyno.visual.swing.plugin.spi.WidgetEvent

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.