3

私はEclipseでこのコードを書きました

protected void createTables(SQLiteDatabase db) {
        db.execSQL(
                                          "create table " + CUSTOMERS_TABLE +" (" +                     
                        CustomerId + " text primary key," +
                        FirstName + " text," +
                        MiddleName + " text," +
                        LastName + " text," +
                        Portrait + " BLOB," +
                        Gender + " integer," +
                        Age + " integer," +
                        Passed + " integer"+
                ");"

しかし、source->format eclipse を使用してコードをフォーマットすると、このようになります

protected void createTables(SQLiteDatabase db) {
        db.execSQL("create table " + CUSTOMERS_TABLE + " (" + CustomerId
                + " text primary key," + FirstName + " text," + MiddleName
                + " text," + LastName + " text," + Portrait + " BLOB," + Gender
                + " integer," + Age + " integer,"
                + Passed
                + " integer" +");"

私はEclipseフォーマッターが私のコードをそのまま保持したいと思っています。どのような設定を行う必要がありますか?

4

1 に答える 1

4

// @formatter:offと の間でEclipse に再フォーマットさせたくない行を囲みます// @formatter:on

protected void createTables(SQLiteDatabase db) {
    // @formatter:off
    db.execSQL(
                                      "create table " + CUSTOMERS_TABLE +" (" +                     
                    CustomerId + " text primary key," +
                    FirstName + " text," +
                    MiddleName + " text," +
                    LastName + " text," +
                    Portrait + " BLOB," +
                    Gender + " integer," +
                    Age + " integer," +
                    Passed + " integer"+
            ");"
    // @formatter:on
于 2012-12-27T17:54:24.703 に答える