Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
blob: 62646e2f37ebc5f6fdfbe05fb1f413595bb1cd24 (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
/*******************************************************************************
 * Copyright (c) 2001, 2004 IBM Corporation and others.
 * 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:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.wst.wsdl.ui.internal.properties.section;

import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
import org.eclipse.wst.wsdl.ui.internal.model.ModelAdapterListener;
import org.eclipse.wst.wsdl.ui.internal.viewers.ExtensibilityElementViewer;
import org.eclipse.wst.wsdl.ui.internal.viewers.widgets.AttributesTable;

public class ExtensiblityElementSection extends AbstractSection implements ModelAdapterListener
{
  ExtensibilityElementViewer viewer;
  protected AttributesTable attributesTable;
	/**
	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
	 */
	public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory)
	{
		super.createControls(parent, factory);

		composite =	getWidgetFactory().createFlatFormComposite(parent);
	
//		viewer = new ExtensibilityElementViewer(composite, getActiveEditor(), true);
		attributesTable = new AttributesTable(getActiveEditor(), composite);
		FormData data = new FormData();
		data.left = new FormAttachment(0, 0);
		data.right = new FormAttachment(100, 0);
		data.top = new FormAttachment(0, 0);
		data.bottom = new FormAttachment(100, 0);
		attributesTable.getControl().setLayoutData(data);
//		viewer.getControl().setLayoutData(data);
	}
	
  public void propertyChanged(Object object, String property)
  {
    if (isListenerEnabled())
    {
      setListenerEnabled(false);
      refresh();
      setListenerEnabled(true);
    }
  }  

	/*
	 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
	 */
	public void refresh()
	{
    super.refresh();
    attributesTable.setInput(getElement().getElement());

    Runnable runnable = new Runnable()
    { 
      public void run()
      {           
        if (!attributesTable.getControl().isDisposed())
        {
          attributesTable.refresh();
        }
      }
    };               
    Display.getCurrent().asyncExec(runnable);

	}
}

Back to the top