Search in sources :

Example 1 with PropertySheet

use of org.eclipse.ui.views.properties.PropertySheet in project tdi-studio-se by Talend.

the class AbstractJvmPropertySection method getPropertySheet.

/**
     * Gets the property sheet.
     * 
     * @param pageSite The page site
     * @return The property sheet, or <tt>null</tt> if not accessible
     */
private static PropertySheet getPropertySheet(PageSite pageSite) {
    try {
        //$NON-NLS-1$
        Field field = PageSite.class.getDeclaredField("parentSite");
        field.setAccessible(true);
        return (PropertySheet) ((IViewSite) field.get(pageSite)).getPart();
    } catch (Exception e) {
        //$NON-NLS-1$
        Activator.log(IStatus.ERROR, "", e);
    }
    return null;
}
Also used : Field(java.lang.reflect.Field) PropertySheet(org.eclipse.ui.views.properties.PropertySheet)

Example 2 with PropertySheet

use of org.eclipse.ui.views.properties.PropertySheet in project tdi-studio-se by Talend.

the class StartMonitorJobAction method showPropertiesView.

public void showPropertiesView(IActiveJvm jvm) {
    try {
        List<PropertySheet> views = getProperriesView();
        // check if there are no properties views
        if (views.size() == 0) {
            openPropertiesView(jvm);
            return;
        }
        // check if there is a corresponding properties view
        PropertySheet view = getPropertiesView(jvm, views);
        if (view != null) {
            brindPropertiesViewToFront(view);
            return;
        }
        // check if there is non-pinned properties view
        view = getNonPinnedPropertiesView(views);
        if (view != null) {
            brindPropertiesViewToFront(view);
            return;
        }
        openPropertiesView(jvm);
    } catch (PartInitException e) {
        Activator.log(IStatus.ERROR, Messages.bringPropertiesViewToFrontFailedMsg, e);
    }
}
Also used : PropertySheet(org.eclipse.ui.views.properties.PropertySheet) PartInitException(org.eclipse.ui.PartInitException)

Example 3 with PropertySheet

use of org.eclipse.ui.views.properties.PropertySheet in project tdi-studio-se by Talend.

the class AbstractElementPropertySectionController method fixedCursorPosition.

/**
     * qzhang Comment method "fixedCursorPosition".
     *
     * @param param
     * @param labelText
     * @param value
     * @param valueChanged
     */
protected void fixedCursorPosition(IElementParameter param, Control labelText, Object value, boolean valueChanged) {
    IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    IWorkbenchPart workbenchPart = page.getActivePart();
    if ((workbenchPart instanceof PropertySheet) || (workbenchPart instanceof JobSettingsView) || (workbenchPart instanceof ComponentSettingsView)) {
        Object control = editionControlHelper.undoRedoHelper.typedTextCommandExecutor.getActiveControl();
        if (param.getName().equals(control) && valueChanged && !param.isRepositoryValueUsed()) {
            String previousText = editionControlHelper.undoRedoHelper.typedTextCommandExecutor.getPreviousText2();
            String currentText = String.valueOf(value);
            labelText.setFocus();
            ControlUtils.setCursorPosition(labelText, getcursorPosition(previousText, currentText));
        }
    }
}
Also used : JobSettingsView(org.talend.designer.core.ui.views.jobsettings.JobSettingsView) PropertySheet(org.eclipse.ui.views.properties.PropertySheet) IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) ComponentSettingsView(org.talend.designer.core.ui.views.properties.ComponentSettingsView)

Example 4 with PropertySheet

use of org.eclipse.ui.views.properties.PropertySheet in project tdi-studio-se by Talend.

the class FindDialog method getFindTarget.

/**
     * Gets the target for find action.
     * 
     * @return The target for find action
     */
private static IFindTarget getFindTarget() {
    IWorkbenchPart activePart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
    if (activePart instanceof IFindTarget) {
        return (IFindTarget) activePart;
    }
    PropertySheet part = (PropertySheet) activePart;
    if (part == null) {
        return null;
    }
    IPage page = part.getCurrentPage();
    if (!(page instanceof TabbedPropertySheetPage)) {
        return null;
    }
    TabbedPropertySheetPage propertySheetPage = (TabbedPropertySheetPage) page;
    ISection[] sections = propertySheetPage.getCurrentTab().getSections();
    if (sections.length != 1) {
        return null;
    }
    ISection section = sections[0];
    if (!(section instanceof IFindTarget)) {
        return null;
    }
    return (IFindTarget) section;
}
Also used : ISection(org.eclipse.ui.views.properties.tabbed.ISection) IFindTarget(org.talend.designer.runtime.visualization.internal.ui.properties.cpu.actions.FindAction.IFindTarget) IPage(org.eclipse.ui.part.IPage) PropertySheet(org.eclipse.ui.views.properties.PropertySheet) IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) TabbedPropertySheetPage(org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)

Example 5 with PropertySheet

use of org.eclipse.ui.views.properties.PropertySheet in project linuxtools by eclipse.

the class DockerContainersViewSWTBotTest method shouldShowSelectedContainerInPropertiesView.

@Test
public void shouldShowSelectedContainerInPropertiesView() {
    // given
    final DockerClient client = MockDockerClientFactory.container(MockContainerFactory.name("angry_bar").status("Stopped").build(), MockContainerInfoFactory.networkMode("host").build()).build();
    final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
    DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
    final PropertySheet propertySheet = SWTUtils.syncExec(() -> SWTUtils.getView(bot, "org.eclipse.ui.views.PropertySheet", true));
    this.dockerContainersView.setFocus();
    // select the container in the table
    selectContainerInTable("angry_bar");
    // then the properties view should have a selected tab with container
    // info
    assertThat(propertySheet.getCurrentPage()).isInstanceOf(TabbedPropertySheetPage.class);
    final TabbedPropertySheetPage currentPage = (TabbedPropertySheetPage) propertySheet.getCurrentPage();
    TabDescriptorAssertions.assertThat(currentPage.getSelectedTab()).isNotNull().hasId("org.eclipse.linuxtools.docker.ui.properties.container.info");
}
Also used : DockerConnection(org.eclipse.linuxtools.internal.docker.core.DockerConnection) DockerClient(com.spotify.docker.client.DockerClient) PropertySheet(org.eclipse.ui.views.properties.PropertySheet) TabbedPropertySheetPage(org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) Test(org.junit.Test)

Aggregations

PropertySheet (org.eclipse.ui.views.properties.PropertySheet)18 TabbedPropertySheetPage (org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)8 Test (org.junit.Test)6 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)5 PartInitException (org.eclipse.ui.PartInitException)5 DockerClient (com.spotify.docker.client.DockerClient)4 DockerConnection (org.eclipse.linuxtools.internal.docker.core.DockerConnection)4 IViewReference (org.eclipse.ui.IViewReference)4 IViewPart (org.eclipse.ui.IViewPart)3 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)3 ISelection (org.eclipse.jface.viewers.ISelection)2 PropertyShowInContext (org.eclipse.ui.views.properties.PropertyShowInContext)2 TabbedPropertySheetPage (com.centurylink.mdw.plugin.designer.properties.TabbedPropertySheetPage)1 ProcessExplorerView (com.centurylink.mdw.plugin.designer.views.ProcessExplorerView)1 TransformationMessage (eu.esdihumboldt.hale.common.align.transformation.report.TransformationMessage)1 InstanceSelection (eu.esdihumboldt.hale.ui.selection.InstanceSelection)1 DefaultInstanceSelection (eu.esdihumboldt.hale.ui.selection.impl.DefaultInstanceSelection)1 AlignmentService (eu.esdihumboldt.hale.ui.service.align.AlignmentService)1 TransformedDataView (eu.esdihumboldt.hale.ui.views.data.TransformedDataView)1 MappingView (eu.esdihumboldt.hale.ui.views.mapping.MappingView)1