本文整理汇总了Java中com.strobel.core.StringUtilities.removeRight方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtilities.removeRight方法的具体用法?Java StringUtilities.removeRight怎么用?Java StringUtilities.removeRight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.strobel.core.StringUtilities
的用法示例。
在下文中一共展示了StringUtilities.removeRight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import com.strobel.core.StringUtilities; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent event) {
tmp_thread = new Thread() {
public void run() {
if (findButton.getText().equals("Stop")) {
if (tmp_thread != null)
tmp_thread.interrupt();
setStatus("Stopped.");
findButton.setText("Find");
} else {
findButton.setText("Stop");
classesList.clear();
ConfigSaver configSaver = ConfigSaver.getLoadedInstance();
DecompilerSettings settings = configSaver.getDecompilerSettings();
File inFile = MainWindow.model.getOpenedFile();
boolean filter = ConfigSaver.getLoadedInstance().getLuytenPreferences()
.isFilterOutInnerClassEntries();
try {
JarFile jfile = new JarFile(inFile);
Enumeration<JarEntry> entLength = jfile.entries();
initProgressBar(Collections.list(entLength).size());
Enumeration<JarEntry> ent = jfile.entries();
while (ent.hasMoreElements() && findButton.getText().equals("Stop")) {
JarEntry entry = ent.nextElement();
String name = entry.getName();
setStatus(name);
if (filter && name.contains("$"))
continue;
if (entry.getName().endsWith(".class")) {
synchronized (settings) {
String internalName = StringUtilities.removeRight(entry.getName(), ".class");
TypeReference type = Model.metadataSystem.lookupType(internalName);
TypeDefinition resolvedType = null;
if (type == null || ((resolvedType = type.resolve()) == null)) {
throw new Exception("Unable to resolve type.");
}
StringWriter stringwriter = new StringWriter();
DecompilationOptions decompilationOptions;
decompilationOptions = new DecompilationOptions();
decompilationOptions.setSettings(settings);
decompilationOptions.setFullDecompilation(true);
PlainTextOutput plainTextOutput = new PlainTextOutput(stringwriter);
plainTextOutput.setUnicodeOutputEnabled(
decompilationOptions.getSettings().isUnicodeOutputEnabled());
settings.getLanguage().decompileType(resolvedType, plainTextOutput,
decompilationOptions);
String decompiledSource = stringwriter.toString().toLowerCase();
if (decompiledSource.contains(textField.getText().toLowerCase())) {
addClassName(entry.getName());
}
}
}
}
setSearching(false);
if (findButton.getText().equals("Stop")) {
setStatus("Done.");
findButton.setText("Find");
}
jfile.close();
} catch (Exception e) {
Luyten.showExceptionDialog("Exception!", e);
}
}
}
};
tmp_thread.start();
}