01: /*
02: * The contents of this file are subject to the terms of the Common Development
03: * and Distribution License (the License). You may not use this file except in
04: * compliance with the License.
05: *
06: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
07: * or http://www.netbeans.org/cddl.txt.
08: *
09: * When distributing Covered Code, include this CDDL Header Notice in each file
10: * and include the License file at http://www.netbeans.org/cddl.txt.
11: * If applicable, add the following below the CDDL Header, with the fields
12: * enclosed by brackets [] replaced by your own identifying information:
13: * "Portions Copyrighted [year] [name of copyright owner]"
14: *
15: * The Original Software is NetBeans. The Initial Developer of the Original
16: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17: * Microsystems, Inc. All Rights Reserved.
18: */
19:
20: package org.netbeans.modules.bpel.mapper.tree;
21:
22: import javax.swing.Icon;
23: import javax.swing.JPopupMenu;
24: import org.netbeans.modules.bpel.mapper.model.BpelMapperModel;
25: import org.netbeans.modules.soa.mappercore.DefaultMapperContext;
26: import org.netbeans.modules.soa.mappercore.model.MapperModel;
27:
28: /**
29: * The default implementation of the MapperContext interface for the BPEL Mapper.
30: *
31: * @author nk160297
32: */
33: public class BpelMapperContext extends DefaultMapperContext {
34:
35: @Override
36: public String getLeftDysplayText(MapperModel model, Object value) {
37: return ((MapperSwingTreeModel) model.getLeftTreeModel())
38: .getDisplayName(value);
39: }
40:
41: @Override
42: public Icon getLeftIcon(MapperModel model, Object value,
43: Icon defaultIcon) {
44: return ((MapperSwingTreeModel) model.getLeftTreeModel())
45: .getIcon(value);
46: }
47:
48: @Override
49: public JPopupMenu getLeftPopupMenu(MapperModel model, Object value) {
50: return ((MapperSwingTreeModel) model.getLeftTreeModel())
51: .getPopupMenu(value);
52: }
53:
54: @Override
55: public String getLeftToolTipText(MapperModel mode, Object value) {
56: return ((MapperSwingTreeModel) mode.getLeftTreeModel())
57: .getToolTipText(value);
58: }
59:
60: //==========================================================================
61:
62: @Override
63: public String getRightDysplayText(MapperModel model, Object value) {
64: assert model instanceof BpelMapperModel;
65: return ((BpelMapperModel) model).getRightTreeModel()
66: .getDisplayName(value);
67: }
68:
69: @Override
70: public Icon getRightIcon(MapperModel model, Object value,
71: Icon defaultIcon) {
72: assert model instanceof BpelMapperModel;
73: return ((BpelMapperModel) model).getRightTreeModel().getIcon(
74: value);
75: }
76:
77: @Override
78: public JPopupMenu getRightPopupMenu(MapperModel model, Object value) {
79: return ((BpelMapperModel) model).getRightTreeModel()
80: .getPopupMenu(value);
81: }
82:
83: @Override
84: public String getRightToolTipText(MapperModel mode, Object value) {
85: return ((BpelMapperModel) mode).getRightTreeModel()
86: .getToolTipText(value);
87: }
88:
89: }
|