小编Iva*_*pov的帖子

如何在SWT表中隐藏/删除列

使用哪种方法来隐藏/删除SWT中的列(特别是在Eclipse插件中)?

  1. A无法将此功能传输到行,因为我需要插入和隐藏(或删除)行和列.
  2. 我试图用TableColumn.dispose()删除它们,但是根据布局中的ColumnWeightData没有被删除,并且使用新的TableLayout重置整个表格布局没有从布局中删除有关列的信息.
  3. 我尝试创建所有需要的列,并使用setWidth(0)隐藏应隐藏/删除的列.我写的示例代码在这里.这种方法并不好:3.1.它不会扩展.在我的情况下,列的最大数量可能是几千,用户实际上只需要很少.3.2.处理大小调整真的是一个地狱.即使在setResizable(false)列之后,如果调整父组件的大小,也可以调整AFAIU的大小.为了解决这个问题,我需要为父组件编写大量的监听器.我还没试过.

我也应该这样

  1. 调查进一步处理表格列并使用它?
  2. 使用setWidth(0)堆栈一段时间,因为我还没有遇到扩展问题吗?
  3. 看一下第三方表组件的方向(Nattable ......)? - 如果是,最好是开源的,因为我的Eclipse插件是开源的.

java swt

15
推荐指数
1
解决办法
1万
查看次数

仅在更改作业scm文件夹中的特定子文件夹时触发Jenkins作业

我正在将持续集成系统从Teamcity迁移到Jenkins.我们为我们所有的项目都有一个svn存储库,如下所示:

project/dev_db_build (folder)
project/module1 (folder)
project/module2 (folder)
projets/pom.xml
Run Code Online (Sandbox Code Playgroud)

为了在CI服务器上构建数据库,我使用url project/dev_db_build并且可以在有更改时使用此URL来触发构建.

对于构建应用程序,我使用url项目/所以如果我轮询它并且对dev_db_build进行更改应该忽略并在db_build成功后触发应用程序构建.

在团队中,我使用了"触发模式".但在詹金斯有很多触发插件https://wiki.jenkins-ci.org/display/JENKINS/Plugins#Plugins-Buildtriggers - 我调查了其中一些并且找不到合适的插件.

teamcity jenkins

10
推荐指数
1
解决办法
1万
查看次数

Gradle相当于maven-dependency-plugin

我的根本问题是,当我为控制器和Freemarker视图运行基于"spring-test"的测试时,我需要在WEB-INF/lib文件夹中包含所有taglib - 否则freemarker将无法在测试期间找到它们.我使用以下maven配置解决了这个问题.它实际上在运行测试之前将taglibs jar复制到src/main/webapp/WEB-INF/lib文件夹.我不想清除此文件夹,因为在为IDE运行此测试时问题是相同的.

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.3</version>
<executions>
    <!-- Freemaarker requires that all taglibs should reside in WEB-INF/lib folder -->
    <execution>
        <id>tests</id>
        <phase>test-compile</phase>
        <goals>
            <goal>copy</goal>
        </goals>
        <configuration>
            <outputDirectory>${basedir}/src/main/webapp/WEB-INF/lib/</outputDirectory>
            <artifactItems>
                <artifactItem>
                    <groupId>org.springframework.security</groupId>
                    <artifactId>spring-security-taglibs</artifactId>
                    <version>${spring.security.version}</version>
                </artifactItem>
            </artifactItems>
        </configuration>
    </execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)

现在我正在将我的项目迁移到gradle.如何用gradle实现同样的目标?

gradle maven maven-dependency-plugin

9
推荐指数
1
解决办法
3034
查看次数

spring-boot在测试中不使用application.properties

我有一个spring,hibernate和flyway项目来创建数据库模式.所以我有

spring.jpa.hibernate.ddl-auto: validate
Run Code Online (Sandbox Code Playgroud)

在我的application.properties文件中.此配置在正常运行期间(在打包可执行jar文件并从终端运行它之后):

2014-10-06 10:06:17.863  INFO 7519 --- [           main] o.h.tool.hbm2ddl.SchemaValidator         : HHH000229: Running schema validator
Run Code Online (Sandbox Code Playgroud)

但是在通过maven运行测试时会被忽略.

1804 [main] INFO  o.h.tool.hbm2ddl.SchemaExport - HHH000227: Running hbm2ddl schema export 
1805 [main] DEBUG org.hibernate.SQL - drop table test_entity if exists 
1806 [main] DEBUG org.hibernate.SQL - drop sequence hibernate_sequence 
1807 [main] DEBUG org.hibernate.SQL - create table test_entity (id bigint not null, name    varchar(255), primary key (id)) 
1807 [main] DEBUG org.hibernate.SQL - create sequence hibernate_sequence 
1808 [main] INFO  o.h.tool.hbm2ddl.SchemaExport - HHH000230: Schema export complete …
Run Code Online (Sandbox Code Playgroud)

hibernate flyway spring-boot

6
推荐指数
2
解决办法
5248
查看次数

JPA Criteria选择其组中具有最大值的所有实例

有没有办法用JPA 2编写CriteriaBuilder相当于以下查询?

select * from season s1
where end = (
    select max(end)
    from season s2
    where s1.contest_id=s2.contest_id
);
Run Code Online (Sandbox Code Playgroud)

在JPQL中,此查询是:

Select s1 from Season s1 
where s1.end = (
    select max(s2.end)
    from Season s2
    where s1.contest=s2.contest
)
Run Code Online (Sandbox Code Playgroud)

jpa criteria-api correlated-subquery jpa-2.0

5
推荐指数
1
解决办法
1万
查看次数

Spring MBeanExporter - 为MBean命名

我正在尝试使用jmx-exported方法运行一个简单的应用程序.我喜欢(spring-context和"@Configuration"的cglib在classpath中):

package com.sopovs.moradanen.jmx;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jmx.export.MBeanExporter;
import org.springframework.stereotype.Component;

@Component
@Configuration
public class SpringJmxTest {
public static void main(String[] args) {
    new AnnotationConfigApplicationContext("com.sopovs.moradanen.jmx");
    while (true) {
        Thread.yield();
    }
}

@Bean
public MBeanExporter createJmxExporter() {
    return new MBeanExporter();
}

public interface FooBarMBean {
    public String hello();
}

@Component
public static class FooBar implements FooBarMBean {
    @Override
    public String hello() {
        return "Hello";
    }
}
}
Run Code Online (Sandbox Code Playgroud)

但是,当我运行它时,我得到:javax.management.MalformedObjectNameException:键属性不能为空.我尝试调试并解决它:

@Component
public static class FooBar implements FooBarMBean, SelfNaming {
    @Override
    public …
Run Code Online (Sandbox Code Playgroud)

spring jmx

4
推荐指数
1
解决办法
2万
查看次数