Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 9b04e7ed84a538c6aeee953297e7e92a94c57a00 (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
83
84
/*****************************************************************************
 * 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.TextCompositeWithModelAccessor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
import org.eclipse.uml2.uml.UMLPackage;


/**
 * The Image Format section on the element tab.
 */
public class ImageFormatSection extends AbstractViewSection {

	/**
	 * 
	 */
	private TextCompositeWithModelAccessor formatComposite;

	/**
	 * 
	 * @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
	 */
	public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {

		super.createControls(parent, tabbedPropertySheetPage);
		formatComposite = new TextCompositeWithModelAccessor("Format:", UMLPackage.IMAGE__FORMAT);
		formatComposite.createContent(parent, tabbedPropertySheetPage.getWidgetFactory());
	}

	/**
	 * 
	 * @see org.eclipse.ui.views.properties.tabbed.AbstractPropertySection#refresh()
	 *
	 */
	public void refresh() {
		formatComposite.refresh();
	}

	/**
	 * 
	 * @see org.eclipse.papyrus.uml.properties.tabbed.profile.AbstractViewSection#setInput(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
	 *
	 * @param part
	 * @param selection
	 */
	public void setInput(IWorkbenchPart part, ISelection selection) {
		super.setInput(part, selection);
		if (getElement()!=null) {
			formatComposite.setElement(getElement());
		}
	}

	/**
	 * 
	 * @see org.eclipse.ui.views.properties.tabbed.AbstractPropertySection#dispose()
	 *
	 */

	public void dispose() {
		 super.dispose();
		 if (formatComposite != null) {
			 formatComposite.dispose();
		 }
	 }
}

Back to the top