Java 类org.eclipse.jface.viewers.StructuredSelection 实例源码

项目:time4sys    文件:TimingPropertiesEditionPartImpl.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.hrm.parts.TimingPropertiesEditionPart#setInputClock(EObject
 *      newValue)
 * 
 */
public void setInputClock(EObject newValue) {
    if (newValue != null) {
        inputClock.setSelection(new StructuredSelection(newValue));
    } else {
        inputClock.setSelection(new StructuredSelection()); // $NON-NLS-1$
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(HrmViewsRepository.Timing.TimingProperties.inputClock);
    if (eefElementEditorReadOnlyState && inputClock.isEnabled()) {
        inputClock.setEnabled(false);
        inputClock.setToolTipText(HrmMessages.Timing_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !inputClock.isEnabled()) {
        inputClock.setEnabled(true);
    }

}
项目:time4sys    文件:TwcaEventModelPropertiesEditionPartImpl.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.analysis.parts.TwcaEventModelPropertiesEditionPart#setParent_(EObject newValue)
 * @generated
 */
public void setParent_(EObject newValue) {
    if (newValue != null) {
        parent_.setSelection(new StructuredSelection(newValue));
    } else {
        parent_.setSelection(new StructuredSelection()); //$NON-NLS-1$
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(AnalysisViewsRepository.TwcaEventModel.Properties.parent_);
    if (eefElementEditorReadOnlyState && parent_.isEnabled()) {
        parent_.setEnabled(false);
        parent_.setToolTipText(AnalysisMessages.TwcaEventModel_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !parent_.isEnabled()) {
        parent_.setEnabled(true);
    }   

}
项目:n4js    文件:N4JSNavigatorActionProvider.java   
@Override
public void setContext(final ActionContext context) {
    super.setContext(context);

    projectGroup.setContext(context);

    // context is null if disposal of the provider is triggered
    if (null != context) {
        StructuredSelection selection = (StructuredSelection) context.getSelection();
        List<Object> selectedElements = Arrays.asList(selection.toArray());

        selectionContainsWorkingSet = selectedElements.stream()
                .anyMatch(element -> element instanceof WorkingSet);

        // try to minimize number of context updates for working set action provider
        if (selectionContainsWorkingSet) {
            workingSetActionProvider.setContext(context);
        }

        assignWorkingSetsAction.selectionChanged(selection);
    }
}
项目:time4sys    文件:SchedulerPropertiesEditionPartForm.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.analysis.parts.SchedulerPropertiesEditionPart#setUsedBy(EObject newValue)
 * @generated
 */
public void setUsedBy(EObject newValue) {
    if (newValue != null) {
        usedBy.setSelection(new StructuredSelection(newValue));
    } else {
        usedBy.setSelection(new StructuredSelection()); //$NON-NLS-1$
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(AnalysisViewsRepository.Scheduler.Properties.usedBy);
    if (eefElementEditorReadOnlyState && usedBy.isEnabled()) {
        usedBy.setEnabled(false);
        usedBy.setToolTipText(AnalysisMessages.Scheduler_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !usedBy.isEnabled()) {
        usedBy.setEnabled(true);
    }   

}
项目:time4sys    文件:GeneralPropertiesEditionPartImpl.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.grm.parts.GeneralPropertiesEditionPart#setSet(EObject
 *      newValue)
 * 
 */
public void setSet(EObject newValue) {
    if (newValue != null) {
        set.setSelection(new StructuredSelection(newValue));
    } else {
        set.setSelection(new StructuredSelection()); // $NON-NLS-1$
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(GrmViewsRepository.General.Properties.set);
    if (eefElementEditorReadOnlyState && set.isEnabled()) {
        set.setEnabled(false);
        set.setToolTipText(GrmMessages.General_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !set.isEnabled()) {
        set.setEnabled(true);
    }

}
项目:time4sys    文件:GeneralPropertiesEditionPartForm.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.hrm.parts.GeneralPropertiesEditionPart#setTargetPort(EObject
 *      newValue)
 * 
 */
public void setTargetPort(EObject newValue) {
    if (newValue != null) {
        targetPort.setSelection(new StructuredSelection(newValue));
    } else {
        targetPort.setSelection(new StructuredSelection()); // $NON-NLS-1$
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(HrmViewsRepository.General.Properties.targetPort);
    if (eefElementEditorReadOnlyState && targetPort.isEnabled()) {
        targetPort.setEnabled(false);
        targetPort.setToolTipText(HrmMessages.General_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !targetPort.isEnabled()) {
        targetPort.setEnabled(true);
    }

}
项目:SimQRI    文件:StorageOutputFlowPropertiesEditionPartForm.java   
/**
 * {@inheritDoc}
 * 
 * @see be.cetic.simqri.metamodel.parts.StorageOutputFlowPropertiesEditionPart#setDestination(EObject newValue)
 * 
 */
public void setDestination(EObject newValue) {
    if (newValue != null) {
        destination.setSelection(new StructuredSelection(newValue));
    } else {
        destination.setSelection(new StructuredSelection()); //$NON-NLS-1$
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(MetamodelViewsRepository.StorageOutputFlow.Properties.destination);
    if (eefElementEditorReadOnlyState && destination.isEnabled()) {
        destination.setEnabled(false);
        destination.setToolTipText(MetamodelMessages.StorageOutputFlow_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !destination.isEnabled()) {
        destination.setEnabled(true);
    }   

}
项目:OCCI-Studio    文件:CrtpEditor.java   
/**
 * This sets the selection into whichever viewer is active.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setSelectionToViewer(Collection<?> collection) {
    final Collection<?> theSelection = collection;
    // Make sure it's okay.
    //
    if (theSelection != null && !theSelection.isEmpty()) {
        Runnable runnable =
            new Runnable() {
                public void run() {
                    // Try to select the items in the current content viewer of the editor.
                    //
                    if (currentViewer != null) {
                        currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
                    }
                }
            };
        getSite().getShell().getDisplay().asyncExec(runnable);
    }
}
项目:time4sys    文件:InputPortPropertiesEditionPartForm.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.analysis.parts.InputPortPropertiesEditionPart#setParent_(EObject newValue)
 * @generated
 */
public void setParent_(EObject newValue) {
    if (newValue != null) {
        parent_.setSelection(new StructuredSelection(newValue));
    } else {
        parent_.setSelection(new StructuredSelection()); //$NON-NLS-1$
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(AnalysisViewsRepository.InputPort.Properties.parent_);
    if (eefElementEditorReadOnlyState && parent_.isEnabled()) {
        parent_.setEnabled(false);
        parent_.setToolTipText(AnalysisMessages.InputPort_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !parent_.isEnabled()) {
        parent_.setEnabled(true);
    }   

}
项目:time4sys    文件:ComputingResourcePropertiesEditionPartImpl.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.analysis.parts.ComputingResourcePropertiesEditionPart#setScheduler(EObject newValue)
 * @generated
 */
public void setScheduler(EObject newValue) {
    if (newValue != null) {
        scheduler.setSelection(new StructuredSelection(newValue));
    } else {
        scheduler.setSelection(new StructuredSelection()); //$NON-NLS-1$
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(AnalysisViewsRepository.ComputingResource.Properties.scheduler);
    if (eefElementEditorReadOnlyState && scheduler.isEnabled()) {
        scheduler.setEnabled(false);
        scheduler.setToolTipText(AnalysisMessages.ComputingResource_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !scheduler.isEnabled()) {
        scheduler.setEnabled(true);
    }   

}
项目:time4sys    文件:TraceEditor.java   
/**
 * This sets the selection into whichever viewer is active.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setSelectionToViewer(Collection<?> collection) {
    final Collection<?> theSelection = collection;
    // Make sure it's okay.
    //
    if (theSelection != null && !theSelection.isEmpty()) {
        Runnable runnable =
            new Runnable() {
                public void run() {
                    // Try to select the items in the current content viewer of the editor.
                    //
                    if (currentViewer != null) {
                        currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
                    }
                }
            };
        getSite().getShell().getDisplay().asyncExec(runnable);
    }
}
项目:time4sys    文件:GeneralPropertiesEditionPartImpl.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.gqam.parts.GeneralPropertiesEditionPart#setRelRes(EObject
 *      newValue)
 * 
 */
public void setRelRes(EObject newValue) {
    if (newValue != null) {
        relRes.setSelection(new StructuredSelection(newValue));
    } else {
        relRes.setSelection(new StructuredSelection()); // $NON-NLS-1$
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(GqamViewsRepository.General.Properties.relRes);
    if (eefElementEditorReadOnlyState && relRes.isEnabled()) {
        relRes.setEnabled(false);
        relRes.setToolTipText(GqamMessages.General_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !relRes.isEnabled()) {
        relRes.setEnabled(true);
    }

}
项目:time4sys    文件:GeneralPropertiesEditionPartImpl.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.srm.parts.GeneralPropertiesEditionPart#setTargetPort(EObject
 *      newValue)
 * 
 */
public void setTargetPort(EObject newValue) {
    if (newValue != null) {
        targetPort.setSelection(new StructuredSelection(newValue));
    } else {
        targetPort.setSelection(new StructuredSelection()); // $NON-NLS-1$
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(SrmViewsRepository.General.Properties.targetPort);
    if (eefElementEditorReadOnlyState && targetPort.isEnabled()) {
        targetPort.setEnabled(false);
        targetPort.setToolTipText(SrmMessages.General_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !targetPort.isEnabled()) {
        targetPort.setEnabled(true);
    }

}
项目:time4sys    文件:GqamEditor.java   
/**
 * This sets the selection into whichever viewer is active.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setSelectionToViewer(Collection<?> collection) {
    final Collection<?> theSelection = collection;
    // Make sure it's okay.
    //
    if (theSelection != null && !theSelection.isEmpty()) {
        Runnable runnable =
            new Runnable() {
                public void run() {
                    // Try to select the items in the current content viewer of the editor.
                    //
                    if (currentViewer != null) {
                        currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
                    }
                }
            };
        getSite().getShell().getDisplay().asyncExec(runnable);
    }
}
项目:neoscada    文件:LoginDialog.java   
/**
 * Load the current state from the dialog settings
 */
private void loadFrom ()
{
    this.flagCredentialsAsProperties = this.dialogSettings.getBoolean ( SETTING_AS_PROPERTIES );
    final String user = this.dialogSettings.get ( SETTING_USER );
    final String contextId = this.dialogSettings.get ( SETTING_CONTEXT );
    if ( user != null && contextId != null )
    {
        this.userText.setText ( user );
        for ( final LoginContext context : this.contexts )
        {
            if ( context.getId ().equals ( contextId ) )
            {
                this.contextSelector.setSelection ( new StructuredSelection ( context ), true );
            }
        }
        this.passwordText.setFocus ();
    }
    else
    {
        this.contextSelector.getControl ().setFocus ();
    }
}
项目:time4sys    文件:GeneralPropertiesEditionPartForm.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.srm.parts.GeneralPropertiesEditionPart#setHost(EObject
 *      newValue)
 * 
 */
public void setHost(EObject newValue) {
    if (newValue != null) {
        host.setSelection(new StructuredSelection(newValue));
    } else {
        host.setSelection(new StructuredSelection()); // $NON-NLS-1$
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(SrmViewsRepository.General.Properties.host);
    if (eefElementEditorReadOnlyState && host.isEnabled()) {
        host.setEnabled(false);
        host.setToolTipText(SrmMessages.General_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !host.isEnabled()) {
        host.setEnabled(true);
    }

}
项目:time4sys    文件:RequiredProtectionParameterPropertiesEditionPartForm.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.analysis.parts.RequiredProtectionParameterPropertiesEditionPart#setParent_(EObject newValue)
 * @generated
 */
public void setParent_(EObject newValue) {
    if (newValue != null) {
        parent_.setSelection(new StructuredSelection(newValue));
    } else {
        parent_.setSelection(new StructuredSelection()); //$NON-NLS-1$
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(AnalysisViewsRepository.RequiredProtectionParameter.Properties.parent_);
    if (eefElementEditorReadOnlyState && parent_.isEnabled()) {
        parent_.setEnabled(false);
        parent_.setToolTipText(AnalysisMessages.RequiredProtectionParameter_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !parent_.isEnabled()) {
        parent_.setEnabled(true);
    }   

}
项目:time4sys    文件:CommunicationResourcePropertiesEditionPartImpl.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.analysis.parts.CommunicationResourcePropertiesEditionPart#setParent_(EObject newValue)
 * @generated
 */
public void setParent_(EObject newValue) {
    if (newValue != null) {
        parent_.setSelection(new StructuredSelection(newValue));
    } else {
        parent_.setSelection(new StructuredSelection()); //$NON-NLS-1$
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(AnalysisViewsRepository.CommunicationResource.Properties.parent_);
    if (eefElementEditorReadOnlyState && parent_.isEnabled()) {
        parent_.setEnabled(false);
        parent_.setToolTipText(AnalysisMessages.CommunicationResource_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !parent_.isEnabled()) {
        parent_.setEnabled(true);
    }   

}
项目:time4sys    文件:GeneralPropertiesEditionPartForm.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.grm.parts.GeneralPropertiesEditionPart#setSet(EObject
 *      newValue)
 * 
 */
public void setSet(EObject newValue) {
    if (newValue != null) {
        set.setSelection(new StructuredSelection(newValue));
    } else {
        set.setSelection(new StructuredSelection()); // $NON-NLS-1$
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(GrmViewsRepository.General.Properties.set);
    if (eefElementEditorReadOnlyState && set.isEnabled()) {
        set.setEnabled(false);
        set.setToolTipText(GrmMessages.General_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !set.isEnabled()) {
        set.setEnabled(true);
    }

}
项目:time4sys    文件:FragmentPropertiesEditionPartImpl.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.analysis.parts.FragmentPropertiesEditionPart#setPrevious(EObject newValue)
 * @generated
 */
public void setPrevious(EObject newValue) {
    if (newValue != null) {
        previous.setSelection(new StructuredSelection(newValue));
    } else {
        previous.setSelection(new StructuredSelection()); //$NON-NLS-1$
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(AnalysisViewsRepository.Fragment.Properties.previous);
    if (eefElementEditorReadOnlyState && previous.isEnabled()) {
        previous.setEnabled(false);
        previous.setToolTipText(AnalysisMessages.Fragment_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !previous.isEnabled()) {
        previous.setEnabled(true);
    }   

}
项目:time4sys    文件:FragmentPropertiesEditionPartForm.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.analysis.parts.FragmentPropertiesEditionPart#setTask(EObject newValue)
 * @generated
 */
public void setTask(EObject newValue) {
    if (newValue != null) {
        task.setSelection(new StructuredSelection(newValue));
    } else {
        task.setSelection(new StructuredSelection()); //$NON-NLS-1$
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(AnalysisViewsRepository.Fragment.Properties.task);
    if (eefElementEditorReadOnlyState && task.isEnabled()) {
        task.setEnabled(false);
        task.setToolTipText(AnalysisMessages.Fragment_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !task.isEnabled()) {
        task.setEnabled(true);
    }   

}
项目:time4sys    文件:CommunicationPropertiesEditionPartImpl.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.analysis.parts.CommunicationPropertiesEditionPart#setScheduledBy(EObject newValue)
 * @generated
 */
public void setScheduledBy(EObject newValue) {
    if (newValue != null) {
        scheduledBy.setSelection(new StructuredSelection(newValue));
    } else {
        scheduledBy.setSelection(new StructuredSelection()); //$NON-NLS-1$
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(AnalysisViewsRepository.Communication.Properties.scheduledBy);
    if (eefElementEditorReadOnlyState && scheduledBy.isEnabled()) {
        scheduledBy.setEnabled(false);
        scheduledBy.setToolTipText(AnalysisMessages.Communication_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !scheduledBy.isEnabled()) {
        scheduledBy.setEnabled(true);
    }   

}
项目:time4sys    文件:GeneralPropertiesEditionPartImpl.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.nfp.parts.GeneralPropertiesEditionPart#setMax(EObject newValue)
 * 
 */
public void setMax(EObject newValue) {
    if (newValue != null) {
        max.setSelection(new StructuredSelection(newValue));
    } else {
        max.setSelection(new StructuredSelection()); //$NON-NLS-1$
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(NfpViewsRepository.General.Properties.max);
    if (eefElementEditorReadOnlyState && max.isEnabled()) {
        max.setEnabled(false);
        max.setToolTipText(NfpMessages.General_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !max.isEnabled()) {
        max.setEnabled(true);
    }   

}
项目:time4sys    文件:GeneralPropertiesEditionPartForm.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.gqam.parts.GeneralPropertiesEditionPart#setInputRel(EObject
 *      newValue)
 * 
 */
public void setInputRel(EObject newValue) {
    if (newValue != null) {
        inputRel.setSelection(new StructuredSelection(newValue));
    } else {
        inputRel.setSelection(new StructuredSelection()); // $NON-NLS-1$
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(GqamViewsRepository.General.Properties.inputRel);
    if (eefElementEditorReadOnlyState && inputRel.isEnabled()) {
        inputRel.setEnabled(false);
        inputRel.setToolTipText(GqamMessages.General_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !inputRel.isEnabled()) {
        inputRel.setEnabled(true);
    }

}
项目:neoscada    文件:OsgiEditor.java   
/**
 * This sets the selection into whichever viewer is active.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setSelectionToViewer ( Collection<?> collection )
{
    final Collection<?> theSelection = collection;
    // Make sure it's okay.
    //
    if ( theSelection != null && !theSelection.isEmpty () )
    {
        Runnable runnable = new Runnable () {
            public void run ()
            {
                // Try to select the items in the current content viewer of the editor.
                //
                if ( currentViewer != null )
                {
                    currentViewer.setSelection ( new StructuredSelection ( theSelection.toArray () ), true );
                }
            }
        };
        getSite ().getShell ().getDisplay ().asyncExec ( runnable );
    }
}
项目:time4sys    文件:GeneralPropertiesEditionPartImpl.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.hrm.parts.GeneralPropertiesEditionPart#getMainScheduler()
 * 
 */
public EObject getMainScheduler() {
    if (mainScheduler.getSelection() instanceof StructuredSelection) {
        Object firstElement = ((StructuredSelection) mainScheduler.getSelection()).getFirstElement();
        if (firstElement instanceof EObject)
            return (EObject) firstElement;
    }
    return null;
}
项目:time4sys    文件:GeneralPropertiesEditionPartImpl.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.nfp.parts.GeneralPropertiesEditionPart#initUnit(Object input, Enumerator current)
 */
public void initUnit(Object input, Enumerator current) {
    unit.setInput(input);
    unit.modelUpdating(new StructuredSelection(current));
    boolean eefElementEditorReadOnlyState = isReadOnly(NfpViewsRepository.General.Properties.unit);
    if (eefElementEditorReadOnlyState && unit.isEnabled()) {
        unit.setEnabled(false);
        unit.setToolTipText(NfpMessages.General_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !unit.isEnabled()) {
        unit.setEnabled(true);
    }   

}
项目:time4sys    文件:GeneralPropertiesEditionPartForm.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.grm.parts.GeneralPropertiesEditionPart#initDependentScheduler(EObjectFlatComboSettings)
 */
public void initDependentScheduler(EObjectFlatComboSettings settings) {
    dependentScheduler.setInput(settings);
    if (current != null) {
        dependentScheduler.setSelection(new StructuredSelection(settings.getValue()));
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(GrmViewsRepository.General.Properties.dependentScheduler);
    if (eefElementEditorReadOnlyState && dependentScheduler.isEnabled()) {
        dependentScheduler.setEnabled(false);
        dependentScheduler.setToolTipText(GrmMessages.General_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !dependentScheduler.isEnabled()) {
        dependentScheduler.setEnabled(true);
    }

}
项目:time4sys    文件:GeneralPropertiesEditionPartForm.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.srm.parts.GeneralPropertiesEditionPart#initGet(EObjectFlatComboSettings)
 */
public void initGet(EObjectFlatComboSettings settings) {
    get.setInput(settings);
    if (current != null) {
        get.setSelection(new StructuredSelection(settings.getValue()));
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(SrmViewsRepository.General.Properties.get);
    if (eefElementEditorReadOnlyState && get.isEnabled()) {
        get.setEnabled(false);
        get.setToolTipText(SrmMessages.General_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !get.isEnabled()) {
        get.setEnabled(true);
    }

}
项目:time4sys    文件:GeneralPropertiesEditionPartForm.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.gqam.parts.GeneralPropertiesEditionPart#getEndToEndScenario()
 * 
 */
public EObject getEndToEndScenario() {
    if (endToEndScenario.getSelection() instanceof StructuredSelection) {
        Object firstElement = ((StructuredSelection) endToEndScenario.getSelection()).getFirstElement();
        if (firstElement instanceof EObject)
            return (EObject) firstElement;
    }
    return null;
}
项目:time4sys    文件:GeneralPropertiesEditionPartImpl.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.gqam.parts.GeneralPropertiesEditionPart#getRelRes()
 * 
 */
public EObject getRelRes() {
    if (relRes.getSelection() instanceof StructuredSelection) {
        Object firstElement = ((StructuredSelection) relRes.getSelection()).getFirstElement();
        if (firstElement instanceof EObject)
            return (EObject) firstElement;
    }
    return null;
}
项目:time4sys    文件:InputStimulusPropertiesEditionPartImpl.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.analysis.parts.InputStimulusPropertiesEditionPart#initParent_(EObjectFlatComboSettings)
 */
public void initParent_(EObjectFlatComboSettings settings) {
    parent_.setInput(settings);
    if (current != null) {
        parent_.setSelection(new StructuredSelection(settings.getValue()));
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(AnalysisViewsRepository.InputStimulus.Properties.parent_);
    if (eefElementEditorReadOnlyState && parent_.isEnabled()) {
        parent_.setEnabled(false);
        parent_.setToolTipText(AnalysisMessages.InputStimulus_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !parent_.isEnabled()) {
        parent_.setEnabled(true);
    }   

}
项目:time4sys    文件:RequiredProtectionParameterPropertiesEditionPartImpl.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.analysis.parts.RequiredProtectionParameterPropertiesEditionPart#getParent_()
 * @generated
 */
public EObject getParent_() {
    if (parent_.getSelection() instanceof StructuredSelection) {
        Object firstElement = ((StructuredSelection) parent_.getSelection()).getFirstElement();
        if (firstElement instanceof EObject)
            return (EObject) firstElement;
    }
    return null;
}
项目:SimQRI    文件:OutputPropertiesEditionPartForm.java   
/**
 * {@inheritDoc}
 * 
 * @see be.cetic.simqri.metamodel.parts.OutputPropertiesEditionPart#initType(Object input, Enumerator current)
 */
public void initType(Object input, Enumerator current) {
    type.setInput(input);
    type.modelUpdating(new StructuredSelection(current));
    boolean eefElementEditorReadOnlyState = isReadOnly(MetamodelViewsRepository.Output.Properties.type);
    if (eefElementEditorReadOnlyState && type.isEnabled()) {
        type.setEnabled(false);
        type.setToolTipText(MetamodelMessages.Output_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !type.isEnabled()) {
        type.setEnabled(true);
    }   

}
项目:time4sys    文件:GeneralPropertiesEditionPartImpl.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.grm.parts.GeneralPropertiesEditionPart#getHost()
 * 
 */
public EObject getHost() {
    if (host.getSelection() instanceof StructuredSelection) {
        Object firstElement = ((StructuredSelection) host.getSelection()).getFirstElement();
        if (firstElement instanceof EObject)
            return (EObject) firstElement;
    }
    return null;
}
项目:convertigo-eclipse    文件:NamedSourceSelectorEditorComposite.java   
@Override
public void performPostDialogCreation() {
    if (selectedTVObject != null) {
        ISelection selection = new StructuredSelection(selectedTVObject);
        viewer.setSelection(selection, true);
    } else {
        if (sourcedObjectName != null && !sourcedObjectName.isEmpty()) {
            ConvertigoPlugin.logError("Source not found ('" + sourcedObjectName + "'). "
                    + "Please verify and choose another source.", true);
        }
        parentDialog.enableOK(false);
    }
}
项目:neoscada    文件:SecurityEditor.java   
/**
 * This deals with how we want selection in the outliner to affect the other views.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void handleContentOutlineSelection ( ISelection selection )
{
    if ( currentViewerPane != null && !selection.isEmpty () && selection instanceof IStructuredSelection )
    {
        Iterator<?> selectedElements = ( (IStructuredSelection)selection ).iterator ();
        if ( selectedElements.hasNext () )
        {
            // Get the first selected element.
            //
            Object selectedElement = selectedElements.next ();

            // If it's the selection viewer, then we want it to select the same selection as this selection.
            //
            if ( currentViewerPane.getViewer () == selectionViewer )
            {
                ArrayList<Object> selectionList = new ArrayList<Object> ();
                selectionList.add ( selectedElement );
                while ( selectedElements.hasNext () )
                {
                    selectionList.add ( selectedElements.next () );
                }

                // Set the selection to the widget.
                //
                selectionViewer.setSelection ( new StructuredSelection ( selectionList ) );
            }
            else
            {
                // Set the input to the widget.
                //
                if ( currentViewerPane.getViewer ().getInput () != selectedElement )
                {
                    currentViewerPane.getViewer ().setInput ( selectedElement );
                    currentViewerPane.setTitle ( selectedElement );
                }
            }
        }
    }
}
项目:time4sys    文件:ConstraintContainerPropertiesEditionPartForm.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.analysis.parts.ConstraintContainerPropertiesEditionPart#getAnalyzedSystem()
 * @generated
 */
public EObject getAnalyzedSystem() {
    if (analyzedSystem.getSelection() instanceof StructuredSelection) {
        Object firstElement = ((StructuredSelection) analyzedSystem.getSelection()).getFirstElement();
        if (firstElement instanceof EObject)
            return (EObject) firstElement;
    }
    return null;
}
项目:time4sys    文件:OtherPropertiesEditionPartForm.java   
/**
 * {@inheritDoc}
 * 
 * @see org.polarsys.time4sys.ui.hrm.parts.OtherPropertiesEditionPart#setDirection(Enumerator
 *      newValue)
 * 
 */
public void setDirection(Enumerator newValue) {
    direction.modelUpdating(new StructuredSelection(newValue));
    boolean eefElementEditorReadOnlyState = isReadOnly(HrmViewsRepository.Other.Properties.direction);
    if (eefElementEditorReadOnlyState && direction.isEnabled()) {
        direction.setEnabled(false);
        direction.setToolTipText(HrmMessages.Other_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !direction.isEnabled()) {
        direction.setEnabled(true);
    }

}
项目:SimQRI    文件:StorageOutputFlowPropertiesEditionPartForm.java   
/**
 * {@inheritDoc}
 * 
 * @see be.cetic.simqri.metamodel.parts.StorageOutputFlowPropertiesEditionPart#initDestination(EObjectFlatComboSettings)
 */
public void initDestination(EObjectFlatComboSettings settings) {
    destination.setInput(settings);
    if (current != null) {
        destination.setSelection(new StructuredSelection(settings.getValue()));
    }
    boolean eefElementEditorReadOnlyState = isReadOnly(MetamodelViewsRepository.StorageOutputFlow.Properties.destination);
    if (eefElementEditorReadOnlyState && destination.isEnabled()) {
        destination.setEnabled(false);
        destination.setToolTipText(MetamodelMessages.StorageOutputFlow_ReadOnly);
    } else if (!eefElementEditorReadOnlyState && !destination.isEnabled()) {
        destination.setEnabled(true);
    }   

}