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


Java IHost类代码示例

本文整理汇总了Java中org.eclipse.rse.core.model.IHost的典型用法代码示例。如果您正苦于以下问题:Java IHost类的具体用法?Java IHost怎么用?Java IHost使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IHost类属于org.eclipse.rse.core.model包,在下文中一共展示了IHost类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initializeFrom

import org.eclipse.rse.core.model.IHost; //导入依赖的package包/类
@Override
public void initializeFrom(ILaunchConfiguration configuration) {
	IHost[] hosts = getHosts();
	
	try {
		String cfgSystem = configuration.getAttribute(RPIConfigurationAttributes.SYSTEM, ""); //$NON-NLS-1$
		String cfgSystemProfileName = configuration.getAttribute(RPIConfigurationAttributes.SYSTEM_PROFILE, ""); //$NON-NLS-1$
		int cfgSystemDebugPort = configuration.getAttribute(RPIConfigurationAttributes.DEBUG_PORT, RPIConfigurationAttributes.DEFAULT_DEBUG_POST);
		boolean runAsRoot = configuration.getAttribute(RPIConfigurationAttributes.RUN_AS_ROOT, RPIConfigurationAttributes.DEFAULT_RUN_AS_ROOT);
		IHost cfgHost = getHost(hosts, cfgSystemProfileName, cfgSystem);
		String display = configuration.getAttribute(RPIConfigurationAttributes.DISPLAY, RPIConfigurationAttributes.DEFAULT_DISPLAY);
		
		updateRPICombo(hosts, cfgHost);
		debugPortTxt.setText(String.valueOf(cfgSystemDebugPort));
		displayTxt.setText(display);
		runAsRootBtn.setSelection(runAsRoot);
	} catch (CoreException e) {
		LaunchPlugin.reportError(Messages.Start_Failed, e);
	}
	
}
 
开发者ID:tsvetan-stoyanov,项目名称:launchpi,代码行数:22,代码来源:RPITab.java

示例2: performApply

import org.eclipse.rse.core.model.IHost; //导入依赖的package包/类
@Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
	String hostName = null;
	IStructuredSelection selection = (IStructuredSelection) rpiCombo.getSelection();
	if (!selection.isEmpty()) {
		IHost host = (IHost) selection.getFirstElement();
		hostName = host.getName();
		configuration.setAttribute(RPIConfigurationAttributes.SYSTEM, hostName);
		configuration.setAttribute(RPIConfigurationAttributes.SYSTEM_PROFILE, host.getSystemProfileName());
	}
	
	try {
		configuration.setAttribute(RPIConfigurationAttributes.DEBUG_PORT, Integer.valueOf(debugPortTxt.getText()));
	} catch (NumberFormatException ex) {
		
	}

	configuration.setAttribute(RPIConfigurationAttributes.RUN_AS_ROOT, runAsRootBtn.getSelection());
	configuration.setAttribute(RPIConfigurationAttributes.DISPLAY, displayTxt.getText().trim());
	
	Map<String, String> argMap = new HashMap<String, String>();
       argMap.put("hostname", hostName); //$NON-NLS-1$
       argMap.put("port", debugPortTxt.getText()); //$NON-NLS-1$
	configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CONNECT_MAP, argMap);
}
 
开发者ID:tsvetan-stoyanov,项目名称:launchpi,代码行数:26,代码来源:RPITab.java

示例3: createNewHost

import org.eclipse.rse.core.model.IHost; //导入依赖的package包/类
private void createNewHost() {
	final IHost[] hosts = getHosts();
	IInputValidator validator = new HostNameInputValidator(hosts);
	InputDialog inputDialog = new InputDialog(getShell(), Messages.New_RPI_Host, Messages.Enter_Host_Name, "", validator); //$NON-NLS-3$ //$NON-NLS-1$
	int result = inputDialog.open();
	if (result == Dialog.OK) {
		String hostName = inputDialog.getValue();
		inputDialog.close();
		try {
			IHost host = RSECorePlugin.getTheSystemRegistry().createHost(
					RSECorePlugin.getTheCoreRegistry().getSystemTypeById(IRSESystemType.SYSTEMTYPE_SSH_ONLY_ID), hostName, hostName, hostName);
			updateRPICombo(getHosts(), host);
		} catch (Exception ex) {
			LaunchPlugin.reportError(Messages.Create_Config_Failed, ex);
		}
	}

}
 
开发者ID:tsvetan-stoyanov,项目名称:launchpi,代码行数:19,代码来源:RPITab.java

示例4: createSubSystemInternal

import org.eclipse.rse.core.model.IHost; //导入依赖的package包/类
@Override
public ISubSystem createSubSystemInternal(IHost conn) {
	CloudFoundryConnectorService connectorService = (CloudFoundryConnectorService) getConnectorService(conn);
	ISubSystem subsys = new ApplicationSubSystem(conn, connectorService, getFileService(conn),
			getHostFileAdapter(), getSearchService(conn));
	return subsys;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:8,代码来源:ApplicationSubSystemConfiguration.java

示例5: ApplicationSubSystem

import org.eclipse.rse.core.model.IHost; //导入依赖的package包/类
public ApplicationSubSystem(IHost host, IConnectorService connectorService, IFileService hostFileService,
		IHostFileToRemoteFileAdapter fileAdapter, ISearchService searchService) {
	super(host, connectorService, hostFileService, fileAdapter, searchService);
	supportsConnecting = false;
	host.setOffline(true);
	addServerListeners();
}
 
开发者ID:eclipse,项目名称:cft,代码行数:8,代码来源:ApplicationSubSystem.java

示例6: doesServerBelongToHost

import org.eclipse.rse.core.model.IHost; //导入依赖的package包/类
public static boolean doesServerBelongToHost(IServer server, IHost host) {
	if (host != null && server != null) {
		IRSESystemType rseSystem = host.getSystemType();
		IServerType serverType = server.getServerType();
		if (rseSystem != null) {
			String hostSystemType = rseSystem.getId();
			if (serverType != null && serverType.getId() != null) {
				String serverSystemType = CloudFoundryBrandingExtensionPoint.getRemoteSystemTypeId(serverType.getId());
				return (hostSystemType != null && hostSystemType.equals(serverSystemType));
			}
		}
	}
	return false;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:15,代码来源:CloudFoundryRsePlugin.java

示例7: getHost

import org.eclipse.rse.core.model.IHost; //导入依赖的package包/类
private IHost getHost(IHost[] hosts, String systemProfileName, String hostName) {
	for (IHost host : hosts) {
		if (host.getName().equals(hostName)) {
			if (systemProfileName == null || host.getSystemProfileName().equals(systemProfileName)) {
				return host;
			}
		}
	}
	return null;
}
 
开发者ID:tsvetan-stoyanov,项目名称:launchpi,代码行数:11,代码来源:RPITab.java

示例8: getText

import org.eclipse.rse.core.model.IHost; //导入依赖的package包/类
@Override
public String getText(Object element) {
	IHost host = (IHost) element;
	String hostName = host.getName();
	String description = host.getDescription();
	if (description != null && !description.isEmpty() && !description.equals(hostName)) {
		StringBuilder buf = new StringBuilder(description);
		buf.append(" - ").append(hostName); //$NON-NLS-1$
		return buf.toString();
	}
	return hostName;
}
 
开发者ID:tsvetan-stoyanov,项目名称:launchpi,代码行数:13,代码来源:RPITab.java

示例9: createRemoteProcess

import org.eclipse.rse.core.model.IHost; //导入依赖的package包/类
public RemoteProcess createRemoteProcess(IProgressMonitor monitor) throws Exception{
	String cfgSystem = configuration.getAttribute(RPIConfigurationAttributes.SYSTEM, ""); //$NON-NLS-1$
	String cfgSystemProfileName = configuration.getAttribute(RPIConfigurationAttributes.SYSTEM_PROFILE, ""); //$NON-NLS-1$
	
	ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
	IHost host = registry.getHost(registry.getSystemProfile(cfgSystemProfileName), cfgSystem);
	
	if (host == null) {
		throw new IllegalStateException(Messages.Host_Not_Found);
	}
	
	IFileServiceSubSystem fileServiceSubsystem = null;
	try {
		monitor.subTask(Messages.Progress_Init_Connection);
		IRemoteCmdSubSystem cmdSubSystem = RemoteCommandHelpers.getCmdSubSystem(host);
		cmdSubSystem.connect(monitor, false);
		monitor.worked(1);

		fileServiceSubsystem = getFileServiceSubsystem(host);
		IProject project = delegate.getJavaProject(configuration).getProject();
		String workingFolder = getWorkingFolder(fileServiceSubsystem, project);
		String homeFolder = fileServiceSubsystem.getFileService().getUserHome().getAbsolutePath();
		ProjectSynchronizer synchronizer = new ProjectSynchronizer(project, workingFolder, fileServiceSubsystem);
		synchronizer.synchronize(monitor);

		String cmd = buildCommandLine(homeFolder);
		monitor.subTask(Messages.Progress_Launching_Java);
		IShellService shellService = getShellService(host);
		IHostShell shell = shellService.launchShell(workingFolder, new String[0], new NullProgressMonitor()); //$NON-NLS-1$
		configureShell(shell);
		shell.writeToShell(cmd);
		monitor.worked(1);
		return new RemoteProcess(launch, shell, cmdSubSystem);
	} finally {
		if (fileServiceSubsystem != null) {
			fileServiceSubsystem.uninitializeSubSystem(monitor);
		}
	}
}
 
开发者ID:tsvetan-stoyanov,项目名称:launchpi,代码行数:40,代码来源:RemoteProcessFactory.java

示例10: getShellService

import org.eclipse.rse.core.model.IHost; //导入依赖的package包/类
private IShellService getShellService(IHost host) {
	for (ISubSystem subSystem : host.getSubSystems()) {
		if (subSystem instanceof IShellServiceSubSystem) {
			return ((IShellServiceSubSystem) subSystem).getShellService();
		}
	}
	throw new IllegalStateException(Messages.Shell_Service_Not_Found + host.getName());
}
 
开发者ID:tsvetan-stoyanov,项目名称:launchpi,代码行数:9,代码来源:RemoteProcessFactory.java

示例11: getFileServiceSubsystem

import org.eclipse.rse.core.model.IHost; //导入依赖的package包/类
private IFileServiceSubSystem getFileServiceSubsystem(IHost host) {
	for (ISubSystem subSystem : host.getSubSystems()) {
		if (subSystem instanceof IFileServiceSubSystem) {
			return (IFileServiceSubSystem) subSystem;
		}
	}
	throw new IllegalStateException(Messages.File_Service_Not_Found + host.getName());
}
 
开发者ID:tsvetan-stoyanov,项目名称:launchpi,代码行数:9,代码来源:RemoteProcessFactory.java

示例12: createFileService

import org.eclipse.rse.core.model.IHost; //导入依赖的package包/类
public IFileService createFileService(IHost host) {
	return new CloudFoundryFileService(host);
}
 
开发者ID:eclipse,项目名称:cft,代码行数:4,代码来源:ApplicationSubSystemConfiguration.java

示例13: createSearchConfiguration

import org.eclipse.rse.core.model.IHost; //导入依赖的package包/类
public IHostSearchResultConfiguration createSearchConfiguration(IHost host, IHostSearchResultSet resultSet,
		Object searchTarget, SystemSearchString searchString) {
	// TODO Auto-generated method stub
	return null;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:6,代码来源:ApplicationSubSystemConfiguration.java

示例14: createSearchService

import org.eclipse.rse.core.model.IHost; //导入依赖的package包/类
public ISearchService createSearchService(IHost host) {
	// TODO Auto-generated method stub
	return null;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:5,代码来源:ApplicationSubSystemConfiguration.java

示例15: getConnectorService

import org.eclipse.rse.core.model.IHost; //导入依赖的package包/类
public IConnectorService getConnectorService(IHost conn) {
	return CloudFoundryConnectorServiceManager.getInstance().getConnectorService(conn, getServiceImplType());
}
 
开发者ID:eclipse,项目名称:cft,代码行数:4,代码来源:ApplicationSubSystemConfiguration.java


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