View | Details | Raw Unified | Return to bug 251245
Collapse All | Expand All

(-)src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/WSDLActionBarContributor.java (-1 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2001, 2008 IBM Corporation and others.
2
 * Copyright (c) 2001, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 119-124 Link Here
119
          actionBars.setGlobalActionHandler(GEFActionConstants.ZOOM_IN, registry.getAction(GEFActionConstants.ZOOM_IN));
119
          actionBars.setGlobalActionHandler(GEFActionConstants.ZOOM_IN, registry.getAction(GEFActionConstants.ZOOM_IN));
120
          actionBars.setGlobalActionHandler(GEFActionConstants.ZOOM_OUT, registry.getAction(GEFActionConstants.ZOOM_OUT));
120
          actionBars.setGlobalActionHandler(GEFActionConstants.ZOOM_OUT, registry.getAction(GEFActionConstants.ZOOM_OUT));
121
          actionBars.setGlobalActionHandler(ActionFactory.PRINT.getId(), registry.getAction(ActionFactory.PRINT.getId()));
121
          actionBars.setGlobalActionHandler(ActionFactory.PRINT.getId(), registry.getAction(ActionFactory.PRINT.getId()));
122
          actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), registry.getAction(ActionFactory.SELECT_ALL.getId()));
122
          zoomInRetargetAction.setEnabled(true);
123
          zoomInRetargetAction.setEnabled(true);
123
          zoomOutRetargetAction.setEnabled(true);
124
          zoomOutRetargetAction.setEnabled(true);
124
          captureScreenAction.setEnabled(true);
125
          captureScreenAction.setEnabled(true);
(-)src-asd-wsdl11/org/eclipse/wst/wsdl/ui/internal/InternalWSDLMultiPageEditor.java (-1 / +6 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2001, 2008 IBM Corporation and others.
2
 * Copyright (c) 2001, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 60-65 Link Here
60
import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Type;
60
import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Type;
61
import org.eclipse.wst.wsdl.ui.internal.asd.ASDMultiPageEditor;
61
import org.eclipse.wst.wsdl.ui.internal.asd.ASDMultiPageEditor;
62
import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddMessageAction;
62
import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDAddMessageAction;
63
import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDDesignSelectAll;
63
import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDDirectEditAction;
64
import org.eclipse.wst.wsdl.ui.internal.asd.actions.ASDDirectEditAction;
64
import org.eclipse.wst.wsdl.ui.internal.asd.actions.BaseSelectionAction;
65
import org.eclipse.wst.wsdl.ui.internal.asd.actions.BaseSelectionAction;
65
import org.eclipse.wst.wsdl.ui.internal.asd.design.DesignViewGraphicalViewer;
66
import org.eclipse.wst.wsdl.ui.internal.asd.design.DesignViewGraphicalViewer;
Lines 457-462 Link Here
457
    ActionRegistry registry = getActionRegistry();
458
    ActionRegistry registry = getActionRegistry();
458
    BaseSelectionAction action;
459
    BaseSelectionAction action;
459
    if (!isFileReadOnly()) {
460
    if (!isFileReadOnly()) {
461
        action = new ASDDesignSelectAll(this);
462
        action.setSelectionProvider(getSelectionManager());
463
        registry.registerAction(action);
464
        
460
	    action = new ASDAddMessageAction(this);
465
	    action = new ASDAddMessageAction(this);
461
	    action.setSelectionProvider(getSelectionManager());
466
	    action.setSelectionProvider(getSelectionManager());
462
	    registry.registerAction(action);
467
	    registry.registerAction(action);
(-)src-asd/org/eclipse/wst/wsdl/ui/internal/asd/actions/ASDDesignSelectAll.java (+62 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.wst.wsdl.ui.internal.asd.actions;
12
13
import java.util.ArrayList;
14
import java.util.Iterator;
15
import java.util.List;
16
17
import org.eclipse.gef.EditPart;
18
import org.eclipse.gef.GraphicalEditPart;
19
import org.eclipse.gef.GraphicalViewer;
20
import org.eclipse.jface.viewers.StructuredSelection;
21
import org.eclipse.ui.IWorkbenchPart;
22
import org.eclipse.ui.actions.ActionFactory;
23
import org.eclipse.wst.xsd.ui.internal.adt.editor.CommonMultiPageEditor;
24
import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
25
26
public class ASDDesignSelectAll extends BaseSelectionAction {
27
	private GraphicalViewer graphicalViewer;
28
	private List selected;
29
30
	public ASDDesignSelectAll(IWorkbenchPart part) {
31
		super(part);
32
		setId(ActionFactory.SELECT_ALL.getId());
33
		setText(Messages._UI_ACTION_SELECT_ALL);
34
	}
35
36
	public void run() {
37
		super.run();
38
39
		IWorkbenchPart part = getWorkbenchPart();
40
		selected = new ArrayList();
41
		if (part instanceof CommonMultiPageEditor) {
42
			graphicalViewer = (GraphicalViewer) ((CommonMultiPageEditor) part).getAdapter(GraphicalViewer.class);
43
			if (graphicalViewer != null) {
44
				EditPart editPart = graphicalViewer.getContents();
45
				doSelectChildren(editPart);
46
47
				graphicalViewer.setSelection(new StructuredSelection(selected));
48
			}
49
		}
50
	}
51
52
	private void doSelectChildren(EditPart editPart) {
53
		List list = editPart.getChildren();
54
		for (Iterator i = list.iterator(); i.hasNext();) {
55
			Object o = i.next();
56
			if (o instanceof GraphicalEditPart) {
57
				selected.add(o);
58
				doSelectChildren((GraphicalEditPart) o);
59
			}
60
		}
61
	}
62
}

Return to bug 251245