org.eclipse.swt.events.SelectionEvent#getSource ( )源码实例Demo

下面列出了org.eclipse.swt.events.SelectionEvent#getSource ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: eclipse-cs   文件: EnhancedTableViewer.java
@Override
public void widgetSelected(SelectionEvent e) {

  if (e.getSource() instanceof TableColumn) {

    TableColumn col = (TableColumn) e.getSource();
    Table table = col.getParent();

    int colIndex = table.indexOf(col);

    if (colIndex == mSortedColumnIndex) {
      mSortDirection = mSortDirection * DIRECTION_REVERSE;
    } else {
      mSortedColumnIndex = colIndex;
      mSortDirection = DIRECTION_FORWARD;
    }

    resort();
    saveState();
  }
}
 
源代码2 项目: xds-ide   文件: CompilerWorkingDirectoryBlock.java
public void widgetSelected(SelectionEvent e) {
    Object source= e.getSource();
    if (source == fWorkspaceButton) {
        handleWorkspaceDirBrowseButtonSelected();
    }
    else if (source == fFileSystemButton) {
        handleWorkingDirBrowseButtonSelected();
    } 
    else if (source == fVariablesButton) {
        handleWorkingDirVariablesButtonSelected();
    } 
    
    else if(source == fRbDefaultDir || source == fRbOtherDir) {
        handleRadiobuttonSelected(fRbDefaultDir.getSelection());
        if (actionListener != null) {
            actionListener.actionPerformed(null);
        }
    }
}
 
源代码3 项目: APICloud-Studio   文件: ProjectNaturesPage.java
public void widgetSelected(SelectionEvent e)
{
	Object source = e.getSource();
	if (source == fSetPrimaryMenuItem || source == fMakePrimaryButton)
	{
		ISelection selection = fTableViewer.getSelection();
		if (!selection.isEmpty() && selection instanceof StructuredSelection)
		{
			Object firstElement = ((StructuredSelection) selection).getFirstElement();
			// make the element checked
			fTableViewer.setChecked(firstElement, true);
			// make it as primary
			updatePrimaryNature(firstElement.toString());
			fTableViewer.refresh();
			updateButtons();
		}
	}
}
 
源代码4 项目: APICloud-Studio   文件: SvnWizardAnnotatePage.java
private SelectionListener getSelectionListener() {
	SelectionListener selectionListener = new SelectionAdapter() {
		public void widgetSelected(SelectionEvent e) {
			if (e.getSource() == selectFromRevisionButton) {
				showLog(fromRevisionText);
			}
			else if (e.getSource() == toHeadButton || e.getSource() == toRevisionButton) {
				toRevisionText.setEnabled(toRevisionButton.getSelection());
				selectToRevisionButton.setEnabled(toRevisionButton.getSelection());
				if (toRevisionButton.getSelection()) toRevisionText.setFocus();					
			}
			else if (e.getSource() == selectToRevisionButton) {
				showLog(toRevisionText);					
			}
			setPageComplete(canFinish());
		}	
	};
	return selectionListener;
}
 
源代码5 项目: nebula   文件: SortTreeColumnSelectionListener.java
@Override
protected Tree getParent(SelectionEvent e) {
	// 1) Get tree column which fire this selection event
	TreeColumn treeColumn = (TreeColumn) e.getSource();
	// 2) Get the owner tree
	return treeColumn.getParent();
}
 
源代码6 项目: nebula   文件: SortTreeColumnSelectionListener.java
@Override
protected void sort(SelectionEvent e) {
	// 1) Get tree column which fire this selection event
	TreeColumn treeColumn = (TreeColumn) e.getSource();
	// 2) Get the owner tree
	Tree tree = treeColumn.getParent();
	// 3) Modify the SWT Tree sort
	tree.setSortColumn(treeColumn);
	tree.setSortDirection(getSortDirection());
}
 
public void widgetSelected(SelectionEvent e) {
	// Link was clicked, update the page controller according to the
	// selected
	// link.
	Link hyperlink = (Link) e.getSource();
	int newCurrentPage = 0;
	if (hyperlink == previousLink) {
		newCurrentPage = getController().getCurrentPage() - 1;
	} else if (hyperlink == nextLink) {
		newCurrentPage = getController().getCurrentPage() + 1;
	} else if (hyperlink == pageLinks) {
		newCurrentPage = Integer.parseInt(e.text);
	}
	getController().setCurrentPage(newCurrentPage);
}
 
源代码8 项目: nebula   文件: SortTableColumnSelectionListener.java
@Override
protected Table getParent(SelectionEvent e) {
	// 1) Get table column which fire this selection event
	TableColumn tableColumn = (TableColumn) e.getSource();
	// 2) Get the owner table
	return tableColumn.getParent();
}
 
源代码9 项目: nebula   文件: SortTableColumnSelectionListener.java
@Override
protected void sort(SelectionEvent e) {
	// 1) Get table column which fire this selection event
	TableColumn tableColumn = (TableColumn) e.getSource();
	// 2) Get the owner table
	Table table = tableColumn.getParent();
	// 3) Modify the SWT Table sort
	table.setSortColumn(tableColumn);
	table.setSortDirection(getSortDirection());
}
 
源代码10 项目: slr-toolkit   文件: LegendPageBar.java
@Override
public void widgetSelected(SelectionEvent e) {
	if(e.getSource() == scale) {
		
		lblMaxPercent.setText("Max. Percent:  " + scale.getSelection()+ "%");			
		lblMaxPercent.getParent().layout(); 
	}
}
 
源代码11 项目: slr-toolkit   文件: GeneralPageBubble.java
@Override
public void widgetSelected(SelectionEvent e) {
	if(e.getSource() == bubbleScale) {
		lblBubbles.setText("Bubbles Scaling Factor: "+ String.format("%.2f", getScalingFactor()));
	}
	
}
 
源代码12 项目: slr-toolkit   文件: LegendPagePie.java
@Override
public void widgetSelected(SelectionEvent e) {
	if(e.getSource() == scale) {
		
		lblMaxPercent.setText("Max. Percent:  " + scale.getSelection()+ "%");			
		lblMaxPercent.getParent().layout(); 
	}
}
 
private void setManualSelection(SelectionEvent event) {
  Preconditions.checkArgument(event.getSource() instanceof Button);

  Button button = (Button) event.getSource();
  Library clicked = (Library) button.getData();
  if (button.getSelection()) {
    explicitSelectedLibraries.add(clicked);
  } else {
    explicitSelectedLibraries.remove(clicked);
  }
  updateButtons();
  fireSelectionListeners();
}
 
源代码14 项目: xds-ide   文件: AbstractLauncherTab.java
public void widgetSelected(SelectionEvent e) {
    Object source = e.getSource();
    if (source == getBrowseProjectButton()) {
        browseProject();
    } else {
        // read all fields into config and revalidate
        updateLaunchConfigurationDialog(); 
    }
}
 
源代码15 项目: slr-toolkit   文件: GeneralPagePie.java
@Override
public void widgetSelected(SelectionEvent e) {
	if(e.getSource() == explosion) {
		lblExplosion.setText("Explosion: " + String.valueOf(explosion.getSelection()));
	}
	
}
 
源代码16 项目: tlaplus   文件: ValidateableTableSectionPart.java
public void widgetSelected(SelectionEvent e)
{
    Object source = e.getSource();
    if (source == buttonAdd)
    {
        doAdd();
    } else if (source == buttonRemove)
    {
        doRemove();
    } else if (source == buttonEdit)
    {
        doEdit();
    }
}
 
源代码17 项目: typescript.java   文件: AbstractMainTab.java
@Override
public void widgetSelected(SelectionEvent e) {
	setDirty(true);
	Object source = e.getSource();
	if (source == workspaceWorkingDirectoryButton) {
		handleWorkspaceWorkingDirectoryButtonSelected();
	} else if (source == fileWorkingDirectoryButton) {
		handleFileWorkingDirectoryButtonSelected();
	} else if (source == variablesWorkingDirectoryButton) {
		handleVariablesButtonSelected(workDirectoryField);
	}
}
 
源代码18 项目: slr-toolkit   文件: SettingsDialog.java
@Override
public void widgetSelected(SelectionEvent e) {
	if(e.getSource() == closeButton) {
		shell.close();
		return;
	}
	
	if(e.getSource() == applyButton) {			
		collectAndSaveSettings();			
		return;
	}
	
	if(e.getSource() == okButton) {
		collectAndSaveSettings();
		shell.close();
		return;
	}
	
	if(e.getSource() == comboChartSelect) {
		switch (comboChartSelect.getSelectionIndex()) {
			case 0:
				sl_stackComposite.topControl = pageBarChart;
				stackComposite.layout();
				break;
			case 1:
				sl_stackComposite.topControl = pageBubbleChart;
				stackComposite.layout();
				break;
			case 2:
				sl_stackComposite.topControl = pagePieChart;
				stackComposite.layout();
				break;
		}
	}		
}
 
源代码19 项目: APICloud-Studio   文件: FindBarDecorator.java
public void widgetSelected(SelectionEvent e)
{
	Object source = e.getSource();
	handleWidgetSelected(source);
}
 
源代码20 项目: slr-toolkit   文件: TreeDialogBar.java
@Override
public void widgetSelected(SelectionEvent e) {
	if(e.getSource() == tree ) {
		if(!(tree.getSelectionCount() > 1)) {
			
			IStructuredSelection currentSelection = (IStructuredSelection) treeViewer.getSelection();
			
			selectedTerm = (Term) currentSelection.getFirstElement();
			
		}
	}
	
}
 
 同类方法