本文整理匯總了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);
}