我试图禁用我编码的TextButton如下:
// Setup new game button
final TextButton newGameButton = new TextButton("New Game", style);
newGameButton.addListener(new InputListener() {
@Override
public boolean touchDown(InputEvent event, float x, float y,
int pointer, int button) {
Tyr.getInstance().setScreen(new GameScreen());
AudioHelper.stopMusic();
return true;
}
});
table.add(newGameButton).spaceBottom(BUTTON_SPACE);
table.row();
Run Code Online (Sandbox Code Playgroud)
但是,"setDisabled(true)"函数似乎不起作用.还有其他方法可以完成这项任务吗?
如果我有两个在同一个pom中相同的依赖项,我希望构建失败.目前,我可以使用Maven Dependency Plugin的"analyze-duplicate"检测它.然而,像其他一些人一样没有failOnWarning选项(另外,它在Info级别打印,而不是警告).有没有替代扩展这个?
[Primefaces 5.0]
我有一个包含数据表的tabview.根据选项卡,数据表中填充了不同的数据(即不同数量的列和行).以下设置可以很好地处理数据,但无论我将max-height约束放在面板,选项卡还是数据表上,它似乎都不会将其限制在屏幕的百分比范围内.如果我将约束设置为特定值(例如300px),它可以工作,但我宁愿不行.
基本上:我想要一个适合其内容的数据表,直到它占据屏幕的30%.此时,它应该滚动.
<body style="min-width: 1366px;min-height: 768px;height: 100%;margin-left: 20px;">
<div style="width: 10%;float: left"> ... </div>
<div style="width: 90%;float: right">
<p:panel classStyle="panel" header="Instance Data View" style="width: 100%;max-height: 30%;margin-bottom: 1%">
<p:tabView value="#{pageBean.tables}" var="table" dynamic="true">
<p:tab title="#{table.tableName}" >
<p:dataTable var="row"
value="#{pageBean.tableData[table.tableName].data}"
resizableColumns="true">
<p:columns value="#{pageBean.tableData[table.tableName].columns}" style="white-space: normal;"
var="column" columnIndexVar="columnIndex">
<f:facet name="header">
<p:outputLabel value="#{column}"/>
</f:facet>
<p:outputLabel value="#{row[columnIndex]}"/>
</p:columns>
</p:dataTable>
</p:tab>
</p:tabView>
</p:panel>
...
</div>
</body>
Run Code Online (Sandbox Code Playgroud) 如果我使用 JDBC 创建一条语句并执行查询,我是否需要关闭该语句并在再次执行之前创建一个新语句?Eclipse 不会抱怨第二种情况。
try {
connection = dataSource.getConnection();
try {
statement = connection.createStatement();
statement.execute("set search_path to '...'");
} finally {
Utils.tryClose(statement);
}
try {
statement = connection.createStatement();
statement.execute("SET statement_timeout TO " + (QUERY_TIMEOUT_SECONDS * 1000));
} finally {
Utils.tryClose(statement);
}
try {
statement = connection.createStatement();
statement.execute(query);
} finally {
Utils.tryClose(statement);
}
} finally {
Utils.tryClose(connection);
}
Run Code Online (Sandbox Code Playgroud)
相对于:
try {
connection = dataSource.getConnection();
statement = connection.createStatement();
statement.execute("set search_path to '...'");
statement.execute("SET statement_timeout TO " + (QUERY_TIMEOUT_SECONDS * 1000));
statement.execute(query);
} …
Run Code Online (Sandbox Code Playgroud) 我需要帮助了解以下查询以及它们有效/无效的原因:
SELECT first_name last_name, salary FROM employee VALID
SELECT first_name, last_name salary FROM employee VALID
SELECT first_name last_name salary FROM employee INVALID
Run Code Online (Sandbox Code Playgroud)
作为参考,第一个检索last_name和salary,第二个检索first_name和salary.
另外,要注意,有效行上的"额外"未打印列必须是实际行.输入类似"asfsfasfs last_name,salary"的内容将是INVALID.