Search in sources :

Example 1 with CategoryAdapter

use of org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter in project webtools.sourceediting by eclipse.

the class XSDSchemaEditPart method getCategoryEditPart.

protected EditPart getCategoryEditPart(int kind) {
    for (Iterator j = getChildren().iterator(); j.hasNext(); ) {
        EditPart row = (EditPart) j.next();
        for (Iterator i = row.getChildren().iterator(); i.hasNext(); ) {
            EditPart editPart = (EditPart) i.next();
            if (editPart instanceof CategoryEditPart) {
                CategoryEditPart categoryEditPart = (CategoryEditPart) editPart;
                CategoryAdapter adapter = (CategoryAdapter) categoryEditPart.getModel();
                if (adapter.getGroupType() == kind) {
                    return editPart;
                }
            }
        }
    }
    return null;
}
Also used : CategoryAdapter(org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter) Iterator(java.util.Iterator) BaseEditPart(org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart) EditPart(org.eclipse.gef.EditPart)

Example 2 with CategoryAdapter

use of org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter in project webtools.sourceediting by eclipse.

the class CategoryEditPart method getModelChildren.

protected List getModelChildren() {
    CategoryAdapter adapter = (CategoryAdapter) getModel();
    List children = new ArrayList(Arrays.asList(adapter.getAllChildren()));
    return children;
}
Also used : CategoryAdapter(org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List)

Example 3 with CategoryAdapter

use of org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter in project webtools.sourceediting by eclipse.

the class ADTContentOutlineRefreshJob method doRefresh.

private void doRefresh(final IADTObject adtObject) {
    final Display display = PlatformUI.getWorkbench().getDisplay();
    display.asyncExec(new Runnable() {

        public void run() {
            boolean isValidViewer = viewer != null && !viewer.getControl().isDisposed();
            if (isValidViewer) {
                viewer.refresh(adtObject);
                if (!(adtObject instanceof CategoryAdapter)) {
                    viewer.reveal(adtObject);
                }
            }
        }
    });
}
Also used : CategoryAdapter(org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter) Display(org.eclipse.swt.widgets.Display)

Aggregations

CategoryAdapter (org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter)3 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 List (java.util.List)1 EditPart (org.eclipse.gef.EditPart)1 Display (org.eclipse.swt.widgets.Display)1 BaseEditPart (org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart)1