Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [bpel-dev] refresh all Activities of bpel-editor

Hey Zhen,

have you tried BPELUtil.regenerateVisuals(Process process, GraphicalViewer viewer)

(I don't really like this method because it's kind of a brute-force-refresh-hack - but I think it should work for you)

Hope that helps...

Mit freundlichen Grüßen / Kind regards

Michael Illiger

Software Developer - BPEL Editor / WID
IBM Software Group, Application and Integration Middleware Software
WSS Business Process Solutions Development 1

Phone: +49-7031-16-1273  IBM Deutschland
E-Mail: milliger@xxxxxxxxxx  Schoenaicher Str. 220
 71032 Boeblingen
 Germany

IBM Deutschland Research & Development GmbH / Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294





From:        zeng zhen <zengzn@xxxxxxxxx>
To:        bpel-dev@xxxxxxxxxxx
Date:        11.02.2010 23:09
Subject:        [bpel-dev] refresh all Activities of bpel-editor
Sent by:        bpel-dev-bounces@xxxxxxxxxxx




hello, Michael,

i have build an extension-point with name "customervisual" in bpel.ui for bpel-editor, the new extension is to change the default behavior of the the activitiy nodes. For exsample, the "
org.eclipse.bpel.ui.editparts.borders.LeafBorder" has an extension class "iaas.bpel.ui.editpart.borders.LeafBorder", the shape of elements border will be adjusted by the extensions:

in the org.eclipse.bpel.ui.editparts.borders.LeafBorder i have made some modifies in paint( ):
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public void paint(IFigure figure, Graphics graphics, Insets insets) {
       if (BPELUIRegistry.ExtensionCustomervisualAktiv == true && extension != null)
        {
            extension.paint(figure, graphics, insets);
        }   
        else
        {   // the original codes of paint() method    
            this.bounds = figure.getBounds();
            this.bounds.x = this.bounds.x;
            .......
        }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

For switching between the "original
visualization" and the "customer viusalization", i have built a actionSet button, which by clicking event will change the value of  "Boolean BPELUIRegistry.ExtensionCustomervisualAktiv".

The poblem is, after click the button "customer viusalization", the value of BPELUIRegistry.ExtensionCustomervisualAktiv has been changed.
But to show the changes,  the bpel-editor need a refresh() of reload() to paint the activity nodes again, i have searched for a long time, but didn't get the point:

the codes in the run() method of the actionSet:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public class customervisualAction implements IWorkbenchWindowActionDelegate {

...
    public void run(IAction action) {

       
        if (BPELUIRegistry.ExtensionCustomervisualAktiv == false)
              BPELUIRegistry.ExtensionCustomervisualAktiv = true;
        else
            BPELUIRegistry.ExtensionCustomervisualAktiv = false;
 

// To refresh() the bpeleditor or repaint the editpait
      
//----------------------------------------------1. trying:----------------------------------------------
// here i have found the actuell bpel editor, and tried to refresh this, but nothing happen.

       IWorkbenchPage page = this.window.getActivePage();
       BPELMultipageEditorPart editorpart = (BPELMultipageEditorPart)page.getActiveEditor();
       org.eclipse.bpel.ui.BPELEditor  bpeleditor =  editorpart.getDesignEditor();   
       bpeleditor.refreshGraphicalViewer();
     
//-----------------------------------------------2. trying------------------------------------------------------
//here i have get the leaf activity node in bpel editor

       RootEditPart  root = editorpart.getDesignEditor().getGraphicalViewer().getRootEditPart();
        List children = root.getChildren();                         // children:  [0]=>processEditPart
       
        ProcessEditPart processEditPart = (ProcessEditPart) children.get(0);
        children = processEditPart.getChildren();          // children :  [0]=>startEditPart [1]=>SequenceEditPart [2]=>EndNodeEditPart
        SequenceEditPart maineditpart =  (SequenceEditPart) children.get(1);
        children =  maineditpart.getChildren();              // children:  [0]=>LeafEditPart [1]=>LeafEditPart [2]=>SequenceEditPart
        LeafEditPart leafeditpart = (LeafEditPart) children.get(0);
        //i have tried to use the following methods  to make the node to refresh it figure, but not work!
        leafeditpart.createFigure();
        leafeditpart.refresh();
        leafeditpart.refreshVisuals();
        leafeditpart.regenerateVisuals();
        leafeditpart.getFigure().repaint();
}

//-----------------------------------------------3. trying------------------------------------------------------
//send a fake event message:
  Activity a = editorpart.getDesignEditor().getProcess().getActivity();
  a.eNotify(new ENotificationImpl((InternalEObject) a,
                Notification.SET, BPELPackage.PROCESS__ACTIVITY,
                a, a));

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

mein question is , how can can i refresh the editor to repaint the activity nodes?

Best regards!


Zhen Zeng

_______________________________________________
bpel-dev mailing list
bpel-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/bpel-dev


Back to the top