本文整理汇总了Java中org.eclipse.jface.viewers.ISelectionChangedListener类的典型用法代码示例。如果您正苦于以下问题:Java ISelectionChangedListener类的具体用法?Java ISelectionChangedListener怎么用?Java ISelectionChangedListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISelectionChangedListener类属于org.eclipse.jface.viewers包,在下文中一共展示了ISelectionChangedListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createControl
import org.eclipse.jface.viewers.ISelectionChangedListener; //导入依赖的package包/类
@Override
public void createControl ( final Composite parent )
{
// stores must not be disposed!
this.stores = Activator.getDefault ().getStoresSet ();
this.tableViewer = new TableViewer ( parent );
setControl ( this.tableViewer.getControl () );
this.tableViewer.setContentProvider ( new ObservableSetContentProvider () );
this.tableViewer.setLabelProvider ( new ConnectionLabelProvider () );
this.tableViewer.setInput ( this.stores );
this.tableViewer.addSelectionChangedListener ( new ISelectionChangedListener () {
@Override
public void selectionChanged ( final SelectionChangedEvent event )
{
update ();
}
} );
update ();
}
示例2: createControl
import org.eclipse.jface.viewers.ISelectionChangedListener; //导入依赖的package包/类
@Override
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NONE);
setControl(container);
container.setLayout(new FillLayout(SWT.HORIZONTAL));
treeViewer = new TreeViewer(container, SWT.BORDER);
treeViewer.setUseHashlookup(true);
treeViewer.setLabelProvider(new SigTypeLabelProvider());
treeViewer.setContentProvider(new SigTypeContentProvider());
treeViewer.setInput(ResourcesPlugin.getWorkspace().getRoot().getProjects());
treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
if (((TreeSelection) event.getSelection()).getFirstElement() instanceof IMarker) {
selection = event.getSelection();
ContainerSelectionPage.this.setPageComplete(true);
} else {
ContainerSelectionPage.this.setPageComplete(false);
}
}
});
}
示例3: ThreeStateComboChoice
import org.eclipse.jface.viewers.ISelectionChangedListener; //导入依赖的package包/类
public ThreeStateComboChoice(Composite parent,ISelectionChangedListener listener) {
super(parent, SWT.READ_ONLY);
setContentProvider(ArrayContentProvider.getInstance());
setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
if (element instanceof ThreeStateChoice) {
ThreeStateChoice choice = (ThreeStateChoice) element;
return choice.getLabel();
}
return "";
}
});
addSelectionChangedListener(listener);
setInput(choices);
}
示例4: setPositionSelected
import org.eclipse.jface.viewers.ISelectionChangedListener; //导入依赖的package包/类
protected void setPositionSelected(Composite position, List<Composite> positions, String propName, DelegatingSelectionProvider prov) {
position.setFocus();
seriesTable.deselectAll();
for (Composite composite : positions) composite.setBackground(position.getDisplay().getSystemColor(SWT.COLOR_WHITE));
position.setBackground(position.getDisplay().getSystemColor(SWT.COLOR_TITLE_BACKGROUND));
seriesTable.addSelectionListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
position.setBackground(position.getDisplay().getSystemColor(SWT.COLOR_WHITE));
seriesTable.removeSelectionListener(this);
}
});
if (trees.containsKey(propName)) prov.fireSelection(new StructuredSelection(trees.get(propName)));
}
示例5: hookSingleClickAction
import org.eclipse.jface.viewers.ISelectionChangedListener; //导入依赖的package包/类
private void hookSingleClickAction() {
testTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
singleClickAction.run();
}
});
}
示例6: createDialogArea
import org.eclipse.jface.viewers.ISelectionChangedListener; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite container) {
final Control control = super.createDialogArea(container);
getTableViewer().addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
getOkButton().setEnabled(!getTableViewer().getSelection().isEmpty());
}
});
return control;
}
示例7: init
import org.eclipse.jface.viewers.ISelectionChangedListener; //导入依赖的package包/类
private void init() {
internalSelectionListener = new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
fireSelectionChangedEvent(getSelection(), SchemaEditorContentPart.this);
}
};
}
示例8: setSelection
import org.eclipse.jface.viewers.ISelectionChangedListener; //导入依赖的package包/类
/**
* This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection.
* Calling this result will notify the listeners.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSelection(ISelection selection) {
editorSelection = selection;
for (ISelectionChangedListener listener : selectionChangedListeners) {
listener.selectionChanged(new SelectionChangedEvent(this, selection));
}
setStatusLineManager(selection);
}
示例9: createTestContainerSelectionGroup
import org.eclipse.jface.viewers.ISelectionChangedListener; //导入依赖的package包/类
private void createTestContainerSelectionGroup (Composite parent) {
Label fTestLabel = new Label(parent, SWT.NONE);
GridData gd = new GridData( );
gd.horizontalAlignment = SWT.RIGHT;
gd.horizontalIndent = 25;
gd.verticalAlignment=SWT.TOP;
fTestLabel.setLayoutData(gd);
fTestLabel.setText(MessageUtil.getString("mainTestExecutionContext"));
fMainTestExecutionComboViewer = new ComboViewer(parent,SWT.DROP_DOWN);
Combo combo = fMainTestExecutionComboViewer.getCombo();
combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
fMainTestExecutionComboViewer.setContentProvider(new IStructuredContentProvider(){
@Override
public Object[] getElements(Object inputElement) {
String projectName= (String) inputElement;
loadMainExecutionContextTests(projectName);
return mainExecutionContexts;
}
});
ILabelProvider labelProvider = new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_QUALIFIED);
fMainTestExecutionComboViewer.setLabelProvider(labelProvider);
fMainTestExecutionComboViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
fAdditionalTestViewer.setInput(null);
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
if (selection.size() > 0){
resetDoHint();
IType type = (IType) selection.getFirstElement();
fAdditionalTestViewer.setInput(type);
validatePage();
}
}
});
combo.setData(GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4E_LAUNCH_TEST_CONFIGURATION_MAIN_TEST);
}
示例10: setSelection
import org.eclipse.jface.viewers.ISelectionChangedListener; //导入依赖的package包/类
@Override
public void setSelection(ISelection selection) {
this.selection = selection;
for (ISelectionChangedListener iSelectionChangedListener : listeners) {
iSelectionChangedListener.selectionChanged(new SelectionChangedEvent(this, selection));
}
}
示例11: setSelection
import org.eclipse.jface.viewers.ISelectionChangedListener; //导入依赖的package包/类
@Override
public void setSelection(ISelection selection) {
currentEditorSelection = selection;
for (ISelectionChangedListener listener : selectionChangedListeners) {
listener.selectionChanged(new SelectionChangedEvent(this, selection));
}
}
示例12: setSelection
import org.eclipse.jface.viewers.ISelectionChangedListener; //导入依赖的package包/类
@Override
public void setSelection ( final ISelection selection )
{
this.selection = selection;
for ( final ISelectionChangedListener listener : this.listeners )
{
listener.selectionChanged ( new SelectionChangedEvent ( this, selection ) );
}
}
示例13: createPartControl
import org.eclipse.jface.viewers.ISelectionChangedListener; //导入依赖的package包/类
@Override
public void createPartControl(Composite parent) {
this.parent = parent;
try {
final Composite content = new Composite(parent, SWT.NONE);
content.setLayout(new GridLayout(1, false));
GridUtils.removeMargins(content);
modelEditor = ServiceHolder.getInterfaceService().createModelViewer();
modelEditor.setViewSite(getViewSite());
modelEditor.createPartControl(content);
GridUtils.setVisible(modelEditor.getControl(), true);
final DelegatingSelectionProvider prov = new DelegatingSelectionProvider((ISelectionProvider)modelEditor);
getSite().setSelectionProvider(prov);
IScannableDeviceService cservice = ServiceHolder.getEventService().createRemoteService(new URI(CommandConstants.getScanningBrokerUri()), IScannableDeviceService.class);
treeViewer = new ControlTreeViewer(cservice, ControlViewerMode.INDIRECT_NO_SET_VALUE);
treeViewer.createPartControl(content, new ControlTree(), getViewSite().getActionBars().getMenuManager(), getViewSite().getActionBars().getToolBarManager());
GridUtils.setVisible(treeViewer.getControl(), false);
treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
prov.fireSelection(event.getSelection());
}
});
setActionsVisible(false);
PageUtil.getPage(getSite()).addSelectionListener(this);
} catch (Exception ne) {
logger.error("Unable to create model table!", ne);
}
}
示例14: setSelection
import org.eclipse.jface.viewers.ISelectionChangedListener; //导入依赖的package包/类
/**
* This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to
* set this editor's overall selection.
* Calling this result will notify the listeners.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setSelection ( final ISelection selection )
{
this.editorSelection = selection;
for ( final ISelectionChangedListener listener : this.selectionChangedListeners )
{
listener.selectionChanged ( new SelectionChangedEvent ( this, selection ) );
}
setStatusLineManager ( selection );
}
示例15: createControl
import org.eclipse.jface.viewers.ISelectionChangedListener; //导入依赖的package包/类
@Override
public void createControl(final Composite parent) {
final Composite container = new Composite(parent, SWT.NONE);
setControl(container);
container.setLayout(new FillLayout(SWT.HORIZONTAL));
treeViewer = new TreeViewer(container, SWT.BORDER);
treeViewer.setUseHashlookup(true);
treeViewer.setLabelProvider(new CreatingAtomWizardLabelProvider());
treeViewer.setContentProvider(new CreatingAtomWizardContentProvider());
treeViewer.setInput(ResourcesPlugin.getWorkspace().getRoot().getProjects());
treeViewer.setFilters(new ViewerFilter[] {new CreatingAtomWizardFilter()});
treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(final SelectionChangedEvent event) {
if (((TreeSelection) event.getSelection()).getFirstElement() instanceof IMarker) {
SelectionPage.this.setPageComplete(true);
} else {
SelectionPage.this.setPageComplete(false);
}
}
});
setPageComplete(false);
}