当前位置: 首页>>代码示例>>Java>>正文


Java ISelectionChangedListener类代码示例

本文整理汇总了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 ();
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:24,代码来源:SelectConnectionStorePage.java

示例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);
      }
    }
  });
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:26,代码来源:ContainerSelectionPage.java

示例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);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:18,代码来源:ThreeStateComboChoice.java

示例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)));
	}
 
开发者ID:eclipse,项目名称:scanning,代码行数:18,代码来源:ScanView.java

示例5: hookSingleClickAction

import org.eclipse.jface.viewers.ISelectionChangedListener; //导入依赖的package包/类
private void hookSingleClickAction() {
	testTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
		@Override
		public void selectionChanged(SelectionChangedEvent event) {
			singleClickAction.run();
		}
	});
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:9,代码来源:TestResultsView.java

示例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;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:12,代码来源:ChooseImplementationDialog.java

示例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);
		}
	};
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:9,代码来源:SchemaEditorContentPart.java

示例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);
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:16,代码来源:MonitoringEditor.java

示例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);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:38,代码来源:GW4ELaunchConfigurationTab.java

示例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));
	}
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:8,代码来源:TemplateComposite.java

示例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));
	}
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:8,代码来源:GW4EEditor.java

示例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 ) );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:10,代码来源:AbstractSelectionProvider.java

示例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);
	}

}
 
开发者ID:eclipse,项目名称:scanning,代码行数:38,代码来源:ModelView.java

示例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 );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:21,代码来源:ChartEditor.java

示例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);
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:28,代码来源:SelectionPage.java


注:本文中的org.eclipse.jface.viewers.ISelectionChangedListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。