blob: 4ac4b096208606459d89b539847c01c8de6ab8f2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
*
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
*
*****************************************************************************/
package org.eclipse.papyrus.uml.properties.tabbed.profile.imagesection;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.papyrus.uml.properties.tabbed.profile.AbstractViewSection;
import org.eclipse.papyrus.uml.properties.tabbed.profile.composite.ExprTextComposite;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
/**
* The Image Location section on the element tab.
*/
public class ImageExpressionSection extends AbstractViewSection {
/**
*
*/
private ExprTextComposite exprComposite;
/**
*
* @see org.eclipse.ui.views.properties.tabbed.AbstractPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)
*
* @param parent
* @param tabbedPropertySheetPage
*/
@Override
public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
super.createControls(parent, tabbedPropertySheetPage);
exprComposite = new ExprTextComposite("Expr:");
exprComposite.createContent(parent, tabbedPropertySheetPage.getWidgetFactory());
}
/**
* {@inheritDoc}
*/
@Override
public void refresh() {
exprComposite.refresh();
}
/**
*
* @see org.eclipse.papyrus.uml.properties.tabbed.profile.AbstractViewSection#setInput(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*
* @param part
* @param selection
*/
@Override
public void setInput(IWorkbenchPart part, ISelection selection) {
super.setInput(part, selection);
if (getElement()!=null) {
exprComposite.setElement(getElement());
}
}
/**
* {@inheritDoc}
*/
public void dispose() {
super.dispose();
if (exprComposite != null) {
exprComposite.dispose();
}
}
}
|