3 - 4年前,我使用数据存储技术构建了一个Appengine应用程序.那时,我们使用谷歌插件.我的应用程序非常完美,我能够毫无问题地部署它.
现在,我修改了它但无法部署它.有人告诉我将其迁移到Google工具.这是指南链接
我使用了新的eclipse(Oxygen)并安装了Eclipse的Cloud Tools.现在将我的旧项目转换为App Engine项目.我有一些错误:
- 1ST错误
cvc-complex-type.4: Attribute 'autoGenerate' must appear on element 'datastore-indexes'.
Run Code Online (Sandbox Code Playgroud)
在war\WEBG-INF\appengine生成的datastore-indexes-auto.xml文件中
<!-- Indices written at Fri, 17 Aug 2018 19:43:56 ICT -->
**red mark here** <datastore-indexes>
<!-- Used 1 time in query history -->
<datastore-index kind="Conversation" ancestor="true" source="auto">
<property name="LessonType" direction="asc"/>
<property name="LessonNo" direction="asc"/>
</datastore-index>
<!-- Used 1 time in query history -->
<datastore-index kind="Conversation" ancestor="true" source="auto">
<property name="LessonType" direction="asc"/>
<property name="ConversationNo" direction="asc"/>
<property name="LessonNo" direction="asc"/>
</datastore-index>
<!-- Used 1 …Run Code Online (Sandbox Code Playgroud) java google-app-engine google-cloud-datastore google-cloud-platform
比方说,我有一个VerticalPanel,它有一些添加到其中的小部件(标签,按钮,...).如何循环使用VerticalPanel并访问其中的小部件?
说,我不喜欢使用Anchor或Hyperlink,但更喜欢使用Clickable Label.但是在为Label添加ClickHandler之后,当我鼠标悬停时,我们经常看到使用HyperLink或Anchor时没有一点手动弹出.所以,
使用ClickHandler for Label时如何让小手弹出?
好的,对于标签,我们得到了ClickHandler,也就是说,当我们点击标签时它会做一些事情.
但我想做一些类似于Right-ClickHandler for Label的东西,即当用户右键单击标签时,它会做一些事情.
有人说将小部件放入DeckPanel并在其上执行RightClick Hanler.但是,如果我们有很多标签,那么
每个标签是否必须放入甲板面板?
如果是这种情况,那么代码可能很复杂,所以我想为标签执行RightClick处理程序,就像我使用普通的ClickHandler一样.怎么办?
好吧,我想说:
CheckBox myCheckBox=new CheckBox("http://verylongurlverylonngurl_image.jpg");
Run Code Online (Sandbox Code Playgroud)
我想要隐藏http://verylongurlverylonngurl_复选框文本的一部分,即当看到网站上的复选框时,它会显示"image.jpg"作为复选框的文本,但是当我们获得该复选框的文本时:
myCheckBox.getText();
Run Code Online (Sandbox Code Playgroud)
它将返回字符串" http://verylongurlverylonngurl_image.jpg "
鉴于这个字符串http://verylongurlverylonngurl/image.jpg&我想在最后一个"/"之前切掉所有部分.例如,我想删除http://verylongurlverylonngurl/上面的字符串部分.结果将是"image.jpg".
我必须剪切String"Label"和剪切的代码,String必须在super()关键字内,而super关键字必须是构造函数中的第一个语句.对这段代码感兴趣:
private class TextShortenedCheckBox extends CheckBox{
private String originalText;
public TextShortenedCheckBox(String label, int visibleLength){
super(label.substring(label.length()-9,label.length()-1));
originalText=label;
}
@Override
public String getText(){
return originalText;
}
}
Run Code Online (Sandbox Code Playgroud)
查看代码:label.substring(label.length()-9,label.length()-1)此代码给出结果但不能申请其他变量字符串.
那么,如何通过一行代码剪切一部分字符串,以便我可以将该代码放在super()中.也许我们必须使用正则表达式或其他东西?