本文整理匯總了Java中org.eclipse.jface.viewers.ComboViewer.getInput方法的典型用法代碼示例。如果您正苦於以下問題:Java ComboViewer.getInput方法的具體用法?Java ComboViewer.getInput怎麽用?Java ComboViewer.getInput使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.viewers.ComboViewer
的用法示例。
在下文中一共展示了ComboViewer.getInput方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setConfigComboViewer
import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
/**
* @param subtypeCMB_Main_viewer2
* @param string
*/
private void setConfigComboViewer(ComboViewer viewer, String inputString) {
Object input = viewer.getInput();
if (input instanceof BTSConfigItem) {
for (BTSConfig i : ((BTSConfig) input).getChildren()) {
if (i instanceof BTSConfigItem
&& inputString
.equals(((BTSConfigItem) i).getValue())) {
viewer.setSelection(new StructuredSelection(i));
return;
}
}
BTSConfigItem cci = BtsmodelFactory.eINSTANCE
.createBTSConfigItem();
cci.setLabel(BtsmodelFactory.eINSTANCE.createBTSTranslations());
cci.getLabel().setTranslation(inputString, "en");
cci.setValue(inputString);
((BTSConfig) input).getChildren().add(cci);
viewer.setSelection(new StructuredSelection( cci));
return;
}
}
示例2: findJdbcDriverInfo
import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
/**
* Find specified driver name in driverChooserViewer ComboViewer
*
* @param driverChooserViewer
* @param driverName
* @return
*/
private JDBCDriverInformation findJdbcDriverInfo(
ComboViewer driverChooserViewer, String driverName )
{
JDBCDriverInformation info = null;
ArrayList infoList = (ArrayList) driverChooserViewer.getInput( );
// The retrieved name is of the format DriverName (version)
if ( infoList != null )
{
for ( int i = 0; i < infoList.size( ); i++ )
{
JDBCDriverInformation jdbcDriverInfo = (JDBCDriverInformation) infoList.get( i );
if ( jdbcDriverInfo.getDriverClassName( ).equals( driverName ) )
{
info = jdbcDriverInfo;
break;
}
}
}
return info;
}
示例3: updateComboSelection
import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
private void updateComboSelection(String value, ComboViewer comboViewer)
{
if (comboViewer != null)
{
LabelValuePair[] pairs = (LabelValuePair[]) comboViewer.getInput();
if (pairs != null)
{
for (LabelValuePair pair : pairs)
{
if (pair.getValue().equals(value))
{
comboViewer.setSelection(new StructuredSelection(pair));
}
}
}
}
}
示例4: selectComboValue
import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
public static void selectComboValue(ComboViewer viewer, String key, IPreferenceStore store)
{
String[] input = (String[]) viewer.getInput();
try
{
viewer.setSelection(new StructuredSelection(input[store.getInt(key)]));
}
catch (Exception ex)
{
viewer.setSelection(new StructuredSelection(input[0]));
}
}