本文整理汇总了Java中org.eclipse.scada.utils.str.StringHelper.join方法的典型用法代码示例。如果您正苦于以下问题:Java StringHelper.join方法的具体用法?Java StringHelper.join怎么用?Java StringHelper.join使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.scada.utils.str.StringHelper
的用法示例。
在下文中一共展示了StringHelper.join方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createStatusLabel
import org.eclipse.scada.utils.str.StringHelper; //导入方法依赖的package包/类
protected String createStatusLabel ()
{
final List<String> labels = new LinkedList<String> ();
labels.add ( getLabelForConnection () );
if ( this.currentFilter != null )
{
labels.add ( String.format ( Messages.EventHistoryView_Label_Format_Filter, this.currentFilter.second.replace ( "&", "&&" ) ) ); //$NON-NLS-2$
}
if ( this.queryState.get () == QueryState.LOADING )
{
labels.add ( Messages.EventHistoryView_Label_Format_IsLoading );
}
labels.add ( String.format ( Messages.EventHistoryView_Label_Format_CountEvents, EventHistoryView.this.events.size () ) );
return StringHelper.join ( labels, Messages.EventHistoryView_Sep );
}
示例2: createStatusLabel
import org.eclipse.scada.utils.str.StringHelper; //导入方法依赖的package包/类
protected String createStatusLabel ()
{
final List<String> labels = new LinkedList<String> ();
labels.add ( getLabelForConnection () );
if ( this.monitorSubscriptionState != null )
{
labels.add ( this.monitorSubscriptionState.toString () );
}
if ( this.monitorsId != null )
{
labels.add ( String.format ( Messages.MonitorsView_Label_Format_Monitors, this.monitorsId ) );
}
else
{
labels.add ( Messages.MonitorsView_Label_Format_NoMonitors );
}
labels.add ( String.format ( Messages.MonitorsView_Label_Format_CountMonitors, MonitorsView.this.monitors.size () ) );
return StringHelper.join ( labels, Messages.MonitorsView_Sep );
}
示例3: makeOptions
import org.eclipse.scada.utils.str.StringHelper; //导入方法依赖的package包/类
private String makeOptions ( final SerialToNetworkMapping entry )
{
final List<String> options = new LinkedList<> ();
options.add ( "" + entry.getBaudRate () );
options.add ( entry.getDataBits () + "DATABITS" );
options.add ( MessageFormat.format ( "{0,choice,1#1STOPBIT|1<{0}STOPBITS}", entry.getStopBits () ) );
options.add ( "" + entry.getParity () );
if ( !entry.isBreak () )
{
options.add ( "NOBREAK" );
}
addOption ( options, !entry.isModemControl (), "LOCAL" );
addOption ( options, entry.isXonxoff (), "XONXOFF" );
addOption ( options, entry.isRtscts (), "RTSCTS" );
return StringHelper.join ( options, " " );
}
示例4: makeDependencies
import org.eclipse.scada.utils.str.StringHelper; //导入方法依赖的package包/类
private String makeDependencies ( final Set<String> dependencies )
{
final Set<String> result = new HashSet<> ();
if ( needP2 () )
{
result.add ( "org.eclipse.scada.p2" ); //$NON-NLS-1$
}
result.add ( "org.eclipse.scada.deploy.p2-incubation" ); //$NON-NLS-1$
result.addAll ( this.deploy.getAdditionalDependencies () );
final StartupHandler sh = getStartupHandler ();
if ( sh != null )
{
result.addAll ( sh.getAdditionalPackageDependencies () );
}
result.addAll ( dependencies );
return StringHelper.join ( result, ", " ); //$NON-NLS-1$
}
示例5: makeParents
import org.eclipse.scada.utils.str.StringHelper; //导入方法依赖的package包/类
private String makeParents ( final Object element )
{
if ( ! ( element instanceof EObject ) )
{
return null;
}
final LinkedList<String> hierarchy = new LinkedList<> ();
EObject current = ( (EObject)element ).eContainer ();
while ( current instanceof Level )
{
hierarchy.add ( 0, ( (Level)current ).getName () );
current = current.eContainer ();
}
return StringHelper.join ( hierarchy, "." );
}
示例6: buildMarker
import org.eclipse.scada.utils.str.StringHelper; //导入方法依赖的package包/类
private void buildMarker ( final Item item, final Map<String, List<Item>> itemGroups, final LinkedList<String> hierarchy )
{
if ( hierarchy.isEmpty () )
{
return;
}
final String id = StringHelper.join ( hierarchy, "_" );
List<Item> items = itemGroups.get ( id );
if ( items == null )
{
items = new LinkedList<> ();
itemGroups.put ( id, items );
}
items.add ( item );
}
示例7: makePath
import org.eclipse.scada.utils.str.StringHelper; //导入方法依赖的package包/类
private String makePath ()
{
if ( this.subtargets == null || this.subtargets.isEmpty () )
{
return null;
}
return "/" + StringHelper.join ( this.subtargets, "/" );
}
示例8: createStatusLabel
import org.eclipse.scada.utils.str.StringHelper; //导入方法依赖的package包/类
protected String createStatusLabel ()
{
final List<String> labels = new LinkedList<String> ();
labels.add ( getLabelForConnection () );
if ( this.eventPoolSubscriptionState != null )
{
labels.add ( this.eventPoolSubscriptionState.toString () );
}
if ( this.poolId != null )
{
labels.add ( String.format ( Messages.EventPoolView_Label_Format_Pool, this.poolId ) );
}
else
{
labels.add ( Messages.EventPoolView_Label_Format_NoPool );
}
if ( this.monitorsId != null )
{
labels.add ( String.format ( Messages.EventPoolView_Label_Format_Monitors, this.monitorsId ) );
}
else
{
labels.add ( Messages.EventPoolView_Label_Format_NoMonitors );
}
labels.add ( String.format ( Messages.EventPoolView_Label_Format_CountEvents, EventPoolView.this.pool.size () ) );
final Pair<SearchType, String> filter = this.eventsTable.getFilter ();
if ( filter != null && filter.second != null && !filter.second.isEmpty () )
{
labels.add ( String.format ( Messages.EventPoolView_Label_Format_Filter, filter.second ).replace ( "&", "&&" ) ); //$NON-NLS-2$
}
return StringHelper.join ( labels, Messages.EventPoolView_Sep );
}
示例9: makeFullQualified
import org.eclipse.scada.utils.str.StringHelper; //导入方法依赖的package包/类
public static String makeFullQualified ( final Component component, final String... local )
{
final List<String> hier = Components.makeHierarchy ( component );
if ( component instanceof NamedDocumentable )
{
hier.add ( Names.makeName ( (NamedDocumentable)component ) );
}
hier.addAll ( Arrays.asList ( local ) );
return StringHelper.join ( hier, delimiter );
}
示例10: handleProcess
import org.eclipse.scada.utils.str.StringHelper; //导入方法依赖的package包/类
@Override
protected void handleProcess ( final IFolder nodeDir, final IProgressMonitor monitor, final Map<String, String> properties ) throws Exception
{
if ( this.deploymentContext != null )
{
runSetup ( this.deploy, this.deploymentContext, new SubProgressMonitor ( monitor, 1 ) );
if ( !makeEquinoxList ().isEmpty () )
{
final String data = StringHelper.join ( makeEquinoxList (), "\n" ) + "\n";
this.deploymentContext.addFile ( new StaticContentProvider ( data ), "/etc/eclipsescada/applications", new FileInformation ( 0644, null, null, FileOptions.CONFIGURATION ) );
}
}
}
示例11: makePreDependencies
import org.eclipse.scada.utils.str.StringHelper; //导入方法依赖的package包/类
private String makePreDependencies ( final Collection<String> dependencies )
{
final Set<String> result = new TreeSet<> ( dependencies );
result.add ( "org.eclipse.scada" ); //$NON-NLS-1$
return StringHelper.join ( result, ", " ); //$NON-NLS-1$
}
示例12: makeDependencies
import org.eclipse.scada.utils.str.StringHelper; //导入方法依赖的package包/类
private String makeDependencies ( final Set<String> additional )
{
final Set<String> dependencies = new HashSet<> ();
dependencies.add ( "org.eclipse.scada" );
if ( needP2 () )
{
dependencies.add ( "org.eclipse.scada.p2" ); //$NON-NLS-1$
}
dependencies.add ( "org.eclipse.scada.deploy.p2-incubation" );
dependencies.addAll ( this.deploy.getAdditionalDependencies () );
dependencies.addAll ( additional );
final StartupHandler sh = getStartupHandler ();
if ( sh != null )
{
dependencies.addAll ( sh.getAdditionalPackageDependencies () );
}
final Set<String> result = new HashSet<> ();
for ( final String dep : dependencies )
{
result.add ( "Requires: " + dep );
}
return StringHelper.join ( result, "\n" );
}
示例13: toRegEx
import org.eclipse.scada.utils.str.StringHelper; //导入方法依赖的package包/类
private static String toRegEx ( final Collection<String> parts )
{
return StringHelper.join ( parts, ".*", new Apply<String> () { //$NON-NLS-1$
@Override
public String apply ( final String parameter )
{
return Pattern.quote ( parameter );
}
} );
}
示例14: streamArtifactEntry
import org.eclipse.scada.utils.str.StringHelper; //导入方法依赖的package包/类
protected void streamArtifactEntry ( final HttpServletRequest request, final HttpServletResponse response, final ReadableChannel channel, final ArtifactInformation artifact, final List<String> path ) throws IOException
{
final String localPath = StringHelper.join ( path, "/" );
if ( localPath.isEmpty () )
{
DownloadHelper.streamArtifact ( response, artifact, Optional.empty (), true, channel, null );
return;
}
// TODO: implement cache
if ( !channel.getContext ().stream ( artifact.getId (), ( stream ) -> {
try ( final ZipInputStream zis = new ZipInputStream ( stream ) )
{
ZipEntry entry;
while ( ( entry = zis.getNextEntry () ) != null )
{
if ( entry.getName ().equals ( localPath ) )
{
final String type = this.fileTypeMap.getContentType ( entry.getName () );
response.setContentType ( type );
response.setContentLengthLong ( entry.getSize () );
response.setDateHeader ( "Last-Modified", artifact.getCreationTimestamp ().getTime () );
ByteStreams.copy ( zis, response.getOutputStream () );
break;
}
}
if ( entry == null || !entry.getName ().equals ( localPath ) )
{
handleNotFoundError ( response, String.format ( "File entry '%s' could not be found in artifact '%s'", localPath, artifact.getId () ) );
}
}
} ) )
{
handleNotFoundError ( response, String.format ( "Artifact %s could not be found", artifact.getId () ) );
}
}
示例15: makeHierarchy
import org.eclipse.scada.utils.str.StringHelper; //导入方法依赖的package包/类
public static String makeHierarchy ( final List<String> hierarchy )
{
return StringHelper.join ( hierarchy, delimiter );
}