Java 类org.eclipse.ui.forms.IFormPart 实例源码

项目:eclox    文件:DetailsPage.java   
/**
 * @see org.eclipse.ui.forms.IPartSelectionListener#selectionChanged(org.eclipse.ui.forms.IFormPart, org.eclipse.jface.viewers.ISelection)
 */
public void selectionChanged(IFormPart part, ISelection newSelection) {
    // Pre-condition
    assert (newSelection instanceof NavigableSelection);

    // Retreieves the node that is provided by the selection.
    /*if( part != this )*/ {
        selection = (NavigableSelection) newSelection;
        Object object = selection.getFirstElement();
        Setting setting = (object instanceof Setting) ? (Setting) object : null;
        String text = setting.getProperty(Setting.TEXT);

        // Checks that the setting has a text property.
        if (text == null) {
            Plugin.log(setting.getIdentifier() + ": missing TEXT property.");
            text = new String(setting.getIdentifier());
        }

        // Updates the form controls.
        this.selectNote(setting);
        this.selectEditor(setting);
        this.section.setText(text);
        this.section.layout(true, true);
    }
}
项目:OpenSPIFe    文件:EMFDetailSheet.java   
@Override
public boolean setInput(Object input) {
    ColumnLayout layout = new ColumnLayout();
    layout.topMargin = 0;
    layout.bottomMargin = 0;
    layout.verticalSpacing = 0;
    layout.maxNumColumns = 4;
    body.setLayout(layout);
    if (!(input instanceof EObject)) {
        return false;
    }
    FormToolkit toolkit = getToolkit();
    EObject object = (EObject) input;
    List<IFormPart> formParts = EMFDetailFormPart.getFormParts(toolkit, object, true, selectionProvider);
    for (IFormPart formPart : formParts) {
        addPart(formPart);
    }
    boolean result = super.setInput(input);
    ScrolledForm form = getForm();
    form.reflow(true);
    form.setOrigin(0, 0);
    checkParts(layout, formParts, input);
    return result;
}
项目:OpenSPIFe    文件:EMFDetailSheet.java   
private void checkParts(ColumnLayout layout, List<IFormPart> formParts, Object input) {
    for (IFormPart part : formParts) {
        Composite composite = null;
        if (part instanceof EMFDetailFormPart) {
            EMFDetailFormPart emfDetailFormPart = (EMFDetailFormPart) part;
            composite = emfDetailFormPart.getComposite();
        }
        if (part instanceof EMFTitleFormPart) {
            EMFTitleFormPart emfTitleFormPart = (EMFTitleFormPart) part;
            composite = emfTitleFormPart.getComposite();
        }
        if (composite != null) {
            checkControl(part, layout, composite, input);
        }
    }
}
项目:cft    文件:ApplicationDetailsPart.java   
public void selectionChanged(IFormPart part, ISelection selection) {
    IStructuredSelection sel = (IStructuredSelection) selection;
    module = (IModule) sel.getFirstElement();

    refreshUI();
    editorPage.refresh(RefreshArea.DETAIL);
}
项目:NEXCORE-UML-Modeler    文件:OverviewPage.java   
/**
 * Page에 추가된 섹션들 반환
 * 
 * @return IFormPart[]
 */
public IFormPart[] getSections() {
    if (managedForm != null) {
        return managedForm.getParts();
    }

    return null;
}
项目:NEXCORE-UML-Modeler    文件:DetailsPage.java   
/**
 * Page에 추가된 섹션들 반환
 * 
 * @return IFormPart[]
 */
public IFormPart[] getSections() {
    if (managedForm != null) {
        return managedForm.getParts();
    }

    return null;
}
项目:NEXCORE-UML-Modeler    文件:FragmentDiagramPage.java   
/**
 * Page에 추가된 섹션들 반환
 * 
 * @return IFormPart[]
 */
public IFormPart[] getSections() {
    if (managedForm != null) {
        return managedForm.getParts();
    }

    return null;
}
项目:yamcs-studio    文件:ThemeColorDetailsPage.java   
@Override
public void selectionChanged(IFormPart part, ISelection selection) {
    IStructuredSelection ssel = (IStructuredSelection) selection;
    if (ssel.size() == 1) {
        input = (ThemeColor) ssel.getFirstElement();
    } else
        input = null;
    update();
}
项目:dockerfoundry    文件:ApplicationDetailsPart.java   
public void selectionChanged(IFormPart part, ISelection selection) {
    IStructuredSelection sel = (IStructuredSelection) selection;
    module = (IModule) sel.getFirstElement();

    refreshUI();
    editorPage.refresh(RefreshArea.DETAIL);
}
项目:eclox    文件:MasterPart.java   
/**
 * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
 */
public void doubleClick(DoubleClickEvent event) {
    IManagedForm managedForm = getManagedForm();

    // Searchs for the details part in the managed form and set the focus on it.
    IFormPart parts[] = managedForm.getParts();
    for (int i = 0; i < parts.length; ++i) {
        IFormPart currentPart = parts[i];
        if (currentPart instanceof DetailsPart) {
            currentPart.setFocus();
            break;
        }
    }
}
项目:eclox    文件:MasterPart.java   
/**
 * @see org.eclipse.ui.forms.IPartSelectionListener#selectionChanged(org.eclipse.ui.forms.IFormPart, org.eclipse.jface.viewers.ISelection)
 */
public void selectionChanged(IFormPart part, ISelection selection) {
    assert selection instanceof NavigableSelection;

    currentSelection = (NavigableSelection) selection;

    // Activates the default filter.
    activateFilter(defaultFilter);
    revealObject(currentSelection.getFirstElement());

    // Updates the navigation actions.
    goBack.selectionChanged(selection);
    goForward.selectionChanged(selection);
}
项目:HMM    文件:AbstractPage.java   
@Override
public void selectionChanged(IFormPart part, ISelection selection) {
    automationBlock.setShowingPage(this);
    IStructuredSelection ss = (IStructuredSelection) selection;
    if(!ss.isEmpty()) {
        TreeNode node = (TreeNode) ss.getFirstElement();
        setTreeModelFromSelection(node);
        setWidgetValues();
        addRemoveValidatorMessages();
    }
}
项目:OpenSPIFe    文件:EMFDetailFormPart.java   
public static List<IFormPart> getFormParts(FormToolkit toolkit, EObject object, boolean showTitle, ISelectionProvider selectionProvider) {
    IItemPropertySource source = null;
    if (object instanceof MultiEObject) {
        source = ((MultiEObject)object).getSource();
    } else {
        source = EMFUtils.adapt(object, IItemPropertySource.class);
    }
    List<IFormPart> formParts = new ArrayList<IFormPart>();
    if (source != null) {
        List<IItemPropertyDescriptor> pds = new ArrayList<IItemPropertyDescriptor>();
        for (PropertyDescriptorContributor c : PROPERTY_DESCRIPTOR_CONTRIBUTOR) {
            pds.addAll(c.getPropertyDescriptors(object));
        }
        pds.addAll(source.getPropertyDescriptors(object));
        Map<String, List<IItemPropertyDescriptor>> map = EMFDetailUtils.groupByCategory(object, pds);

        PropertyDescriptorSorter sorter = getPropertyDescriptorSorter(toolkit, object);
        if (sorter != null) {
            sorter.sort(object, (LinkedHashMap<String, List<IItemPropertyDescriptor>>) map);
        }
        for (List<IItemPropertyDescriptor> descriptors : map.values()) {
            if (!EMFDetailUtils.isCategoryEmpty(object, descriptors))
                formParts.add(new EMFDetailFormPart(toolkit, descriptors, showTitle, selectionProvider));
            showTitle = false;
        }
        if (showTitle) {
            formParts.add(new EMFTitleFormPart());
        }
    }
    return formParts;
}
项目:OpenSPIFe    文件:EMFDetailSheet.java   
private void checkControl(IFormPart emfDetailFormPart, Layout layout, Control control, Object input) {
    Object layoutData = control.getLayoutData();
    if (layoutData != null) {
        String mismatch = null;
        if ((layout instanceof ColumnLayout) && !(layoutData instanceof ColumnLayoutData)) {
            mismatch = "ColumnLayout is incompatible with " + layoutData;
        }
        if ((layout instanceof GridLayout) && !(layoutData instanceof GridData)) {
            mismatch = "GridLayout is incompatible with " + layoutData;
        }
        if ((layout instanceof TableWrapLayout) && !(layoutData instanceof TableWrapData)) {
            mismatch = "TableWrapLayout is incompatible with " + layoutData;
        }
        if (mismatch != null) {
            StringBuilder message = new StringBuilder(mismatch);
            message.append('\n');
            message.append("clearing invalid layout data on control " + control + " in form part: " + emfDetailFormPart);
            message.append('\n');
            message.append("the input was: " + input);
            LogUtil.error(message);
            control.setLayoutData(null);
        }
    }
    if (control instanceof Composite) {
        Composite composite = (Composite) control;
        Control[] children = composite.getChildren();
        for (Control child : children) {
            checkControl(emfDetailFormPart, composite.getLayout(), child, input);
        }
    }
}
项目:mule-tooling-incubator    文件:GenericDetailsPage.java   
@SuppressWarnings("unchecked")
public void selectionChanged(IFormPart part, ISelection selection) {
    IStructuredSelection ssel = (IStructuredSelection) selection;
    if (ssel.size() == 1) {
        input = (T) ssel.getFirstElement();
        section.setText(input.getClass().getSimpleName() + " Page");
    } else
        input = null;
    update();
}
项目:mule-tooling-incubator    文件:AbstractBaseEditorDetailsPage.java   
@Override
public void selectionChanged(IFormPart part, ISelection selection) {
    refresh();
}