这是交易.我以编程方式在eclipse rcp中创建了一个项目.然后我添加一些持久性属性.现在,我想在项目浏览器视图中右键单击项目,然后单击属性选项卡.应该有我的属性页面.这是我有的:
<extension
point="org.eclipse.ui.propertyPages">
<page
adaptable="false"
class="bg.bulsi.rcp.first.properties.SamplePropertyPage"
id="bg.bulsi.rcp.first.properties.samplePropertyPage"
name="Sample Page"
nameFilter="*.*"
objectClass="org.eclipse.core.resources.IProject"
selectionFilter="single">
<enabledWhen>
<instanceof
value="org.eclipse.core.resources.IProject">
</instanceof>
</enabledWhen>
</page>
</extension>
Run Code Online (Sandbox Code Playgroud)
为什么这个页面不显示在项目的属性中?
我没有编译错误,但我的代码没有输出任何保存的文件.代码确实创建了文件,但它们是空的.有人看到我做错了吗?
public class CellAutomataTest {
public static void main(String[] args)
{
int rule = 120;//Integer.parseInt(args[0]);
int numGen = 5;//Integer.parseInt(args[1]);
String fileStem = "ca";//args[2];
int width = 400;//Integer.parseInt(args[3]);
int height = 400;//Integer.parseInt(args[4]);
CellAutomata test = new CellAutomata(numGen, rule);
PrintWriter writer = null;
try {
writer = new PrintWriter(new FileWriter(fileStem + ".js"));
} catch (IOException ex) {
Logger.getLogger(CellAutomataTest.class.getName()).log(Level.SEVERE, null, ex);
}
PrintWriter writer2 = null;
try {
writer2 = new PrintWriter(new FileWriter(fileStem + ".html"));
} catch (IOException ex) {
Logger.getLogger(CellAutomataTest.class.getName()).log(Level.SEVERE, null, ex); …
Run Code Online (Sandbox Code Playgroud) 说我有以下两个类:
public class MyClass {
public String getDescription() {
return "MyClass";
}
}
Run Code Online (Sandbox Code Playgroud)
和
public class MyClassLoader {
public static void main (String[] argv) throws ClassNotFoundException {
Class.forName("MyClass");
System.out.println("MyClass class was successfully loaded");
}
}
Run Code Online (Sandbox Code Playgroud)
如果这两个类都在默认包中,它运行正常,类加载,世界是美丽的.(如果我要删除课程MyClass
,我会ClassNotFoundException
按预期得到一个.
但是,如果它们都在一个包中(假设它是Eclipse中的一个包),并且有
package myClassTestPackage;
Run Code Online (Sandbox Code Playgroud)
在两者中声明,ClassNotFoundException
当我尝试运行它时,我得到了一个.
导致此问题的原因是什么?如何解决?这是我能够重现我在一个更大的程序中遇到的错误的最简单方法.
我通过https发送POST时遇到问题.在上面的代码片段中,第一部分(已注释)运行良好.下一部分不会:它不发送任何请求.我需要解决什么问题?
Ps也许问题出在我的Lib boost不支持HTTPS的事实上.
#include "stdafx.h"
#include <iostream>
#include <boost/asio.hpp>
#include <conio.h>
#include <stdio.h>
#include <fstream>
char buffer [9999999];
int main()
{
boost::asio::ip::tcp::iostream stream;
stream.expires_from_now(boost::posix_time::seconds(60));
stream.connect("www.mail.ru","http");
//stream << "GET / HTTP/1.1\r\n";
//stream << "Host mail.ru\r\n";
//stream << "User-Agent Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11\r\n";
//stream << "Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n" ;
//stream << "Accept-Encoding gzip,deflate,sdch\r\n";
//stream << "Accept-Language en-US,en;q=0.8\r\n";
//stream <<"Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.3\r\n";
//stream << "Cookie \r\n\r\n";
stream << "POST https://auth.mail.ru/cgi-bin/auth HTTP/1.1\r\n";
stream << "Host: auth.mail.ru\r\n";
stream << "User-Agent: …
Run Code Online (Sandbox Code Playgroud) 我正在我的eclipse-rcp应用程序中开发一个搜索对话框.
在搜索对话框中,我有一个组合框,如下所示:
comboImp = new CCombo(grpColSpet, SWT.BORDER | SWT.READ_ONLY);
comboImp.setBounds(556, 46, 184, 27);
comboImpViewer = new ComboViewer(comboImp);
comboImpViewer.setContentProvider(new ArrayContentProvider());
comboImpViewer.setInput(ImpContentProvider.getInstance().getImps());
comboImpViewer.setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
return ((Imp)element).getImpName();
}
});
Run Code Online (Sandbox Code Playgroud)
Imp
是一个数据库实体,ManyToOne到被搜索的主实体,是ImpContentProvider
通过jpa/hibernate与嵌入式sqlite数据库对话的模型类.
这个组合框应该包含所有实例Imp
,但也要包含空选择 ; 它的值绑定到服务bean,如下所示:
IObservableValue comboImpSelectionObserveWidget =
ViewersObservables.observeSingleSelection(comboImpViewer);
IObservableValue filterByImpObserveValue =
BeansObservables.observeValue(searchPrep, "imp");
bindingContext.bindValue(comboImpSelectionObserveWidget, filterByImpObserveValue
, null, null);
Run Code Online (Sandbox Code Playgroud)
一旦用户点击组合,就会产生一个选择(第一个元素):我可以看到对我在查看器上添加的selectionlistener的调用.我的问题是:
ImpContentProvider
?返回的列表中吗?或者我应该实施替代方案ArrayContentProvider
?另外一个相关问题是:
deselectAll()
和clearSelection()
组合不会为绑定bean设置空值?我有一个带有嵌入式 tomcat 的 spring-boot web 应用程序,运行在端口 28081 上,httpd 配置为这样的代理:
ProxyPass / http://localhost:28081/
ProxyPassReverse / http://localhost:28081/
Run Code Online (Sandbox Code Playgroud)
然后在 jsp 页面中,我需要将完整的请求 URL 传递给 Silverlight 小部件;但是
${pageContext.request.serverName}:${pageContext.request.serverPort}
Run Code Online (Sandbox Code Playgroud)
将解决http://localhost:28081
。
所以我想依靠X-Forwarded-Host
,但有些情况下它确实包含多个代理地址,用逗号分隔。我不确定相信地址的顺序将被保留是否安全。
有没有更好的方法来做到这一点,是在 jsp 中,在 httpd 配置中还是在控制器代码中?
我有很多子文件夹,只有一些包含tar文件.即:
folder1/
folder2/this-is-a.tar
folder3/
folder4/this-is-another.tar
Run Code Online (Sandbox Code Playgroud)
我可以通过简单的方式找到哪些dirs有tar ls */*.tar
.
我想要实现的是以某种方式找到所有.tar文件,然后在找到它们的同一目录中提取它们,然后删除.tars.
我已经尝试ls */*.tar | xargs -n1 tar xvf
但是在我所在的目录中提取了tars,而不是找到了tars的目录.
任何帮助将不胜感激.
java ×4
eclipse-rcp ×2
apache ×1
automation ×1
bash ×1
boost-asio ×1
c++ ×1
centos ×1
classloader ×1
combobox ×1
data-binding ×1
eclipse ×1
el ×1
exception ×1
httprequest ×1
https ×1
jface ×1
linux ×1
printwriter ×1
project ×1
properties ×1
proxypass ×1
spring-boot ×1
tar ×1