當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。