本文整理汇总了Java中org.eclipse.jface.viewers.StructuredSelection类的典型用法代码示例。如果您正苦于以下问题:Java StructuredSelection类的具体用法?Java StructuredSelection怎么用?Java StructuredSelection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StructuredSelection类属于org.eclipse.jface.viewers包,在下文中一共展示了StructuredSelection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setInputClock
import org.eclipse.jface.viewers.StructuredSelection; //导入依赖的package包/类
/**
* {@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);
}
}
示例2: setParent_
import org.eclipse.jface.viewers.StructuredSelection; //导入依赖的package包/类
/**
* {@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);
}
}
示例3: setContext
import org.eclipse.jface.viewers.StructuredSelection; //导入依赖的package包/类
@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);
}
}
示例4: setUsedBy
import org.eclipse.jface.viewers.StructuredSelection; //导入依赖的package包/类
/**
* {@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);
}
}
示例5: setSet
import org.eclipse.jface.viewers.StructuredSelection; //导入依赖的package包/类
/**
* {@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);
}
}
示例6: setTargetPort
import org.eclipse.jface.viewers.StructuredSelection; //导入依赖的package包/类
/**
* {@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);
}
}
示例7: setDestination
import org.eclipse.jface.viewers.StructuredSelection; //导入依赖的package包/类
/**
* {@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);
}
}
示例8: setSelectionToViewer
import org.eclipse.jface.viewers.StructuredSelection; //导入依赖的package包/类
/**
* 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);
}
}
示例9: setParent_
import org.eclipse.jface.viewers.StructuredSelection; //导入依赖的package包/类
/**
* {@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);
}
}
示例10: setScheduler
import org.eclipse.jface.viewers.StructuredSelection; //导入依赖的package包/类
/**
* {@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);
}
}
示例11: setRelRes
import org.eclipse.jface.viewers.StructuredSelection; //导入依赖的package包/类
/**
* {@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);
}
}
示例12: setTargetPort
import org.eclipse.jface.viewers.StructuredSelection; //导入依赖的package包/类
/**
* {@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);
}
}
示例13: loadFrom
import org.eclipse.jface.viewers.StructuredSelection; //导入依赖的package包/类
/**
* 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 ();
}
}
示例14: setHost
import org.eclipse.jface.viewers.StructuredSelection; //导入依赖的package包/类
/**
* {@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);
}
}
示例15: setParent_
import org.eclipse.jface.viewers.StructuredSelection; //导入依赖的package包/类
/**
* {@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);
}
}