public String getComponentName() {
return "NativeNeighbourhoodPlugin";
}
private void registerFileType() {
FileTypeManager fileTypeManager = FileTypeManager.getInstance();
// already registered?
FileType[] filetypeArray = fileTypeManager.getRegisteredFileTypes();
boolean alreadyRegistered = false;
for (FileType tType : filetypeArray) {
// if (tType.getName().equals(NATIVE_FILE_TYPE_NAME)) {
if (tType instanceof NativeFileType) {
alreadyRegistered = true;
nativeFileType = (NativeFileType) tType;
break;
}
}
if (!alreadyRegistered) {
nativeFileType = new NativeFileType();
nativeFileType.setName(NATIVE_FILE_TYPE_NAME);
nativeFileType.setDescription(NATIVE_FILE_TYPE_DESCRIPTION);
String tExtensions = getNativeExtensions();
List<String> tList = new ArrayList<String>();
StringTokenizer tTokenizer = new StringTokenizer(tExtensions, ",;:/ ");
while (tTokenizer.hasMoreTokens()) {
String tExtension = tTokenizer.nextToken().trim();
tList.add(tExtension);
}
String[] tArray = tList.toArray(new String[tList.size()]);
fileTypeManager.registerFileType(nativeFileType, tArray);
}
nativeFileType.setIcon(Util.loadIconFromDir("nativefiletype.gif", getIconsDir()));
}