You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.2 KiB
54 lines
1.2 KiB
package com.fr.design.file; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
/** |
|
* @author kerry |
|
* @since 11.0 |
|
* created on 2023-04-14 |
|
**/ |
|
public enum CloseOption { |
|
Left(Toolkit.i18nText("Fine-Design_Close_templates_To_The_Left")) { |
|
@Override |
|
public boolean shouldClose(int tplIndex, int i) { |
|
return i < tplIndex; |
|
} |
|
}, |
|
|
|
Right(Toolkit.i18nText("Fine-Design_Close_templates_To_The_Right")) { |
|
@Override |
|
public boolean shouldClose(int tplIndex, int i) { |
|
return i > tplIndex; |
|
} |
|
|
|
}, All(Toolkit.i18nText("Fine-Design_Close_All_templates")), |
|
|
|
Others(Toolkit.i18nText("Fine-Design_Close_Other_templates")) { |
|
@Override |
|
public boolean shouldClose(int tplIndex, int i) { |
|
return i != tplIndex; |
|
} |
|
}; |
|
|
|
|
|
private String optionName; |
|
|
|
public String getOptionName() { |
|
return this.optionName; |
|
} |
|
|
|
CloseOption(String optionName) { |
|
this.optionName = optionName; |
|
} |
|
|
|
/** |
|
* 判断指定索引模板是否应该被关闭 |
|
* @param tplIndex |
|
* @param i |
|
* @return |
|
*/ |
|
public boolean shouldClose(int tplIndex, int i) { |
|
return true; |
|
} |
|
|
|
} |