This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-Dosgi.requiredJavaVersion=1.6 -Xms128m -Xmx512m -XX:MaxPermSize=128m -XX:PermSize=80m |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//条目的讨论页面,豆列页面不显示搜索结果 | |
var currentURL = document.URL; | |
if(currentURL.indexOf('discussion') != -1 || currentURL.indexOf('doulist') != -1 ){ | |
return; | |
} else { | |
inject(); | |
} | |
function inject(){ | |
var title = $('html head title').text(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final Workspace workspace = (Workspace) ResourcesPlugin.getWorkspace(); | |
if (workspace.isTreeLocked()) { | |
workspace.setTreeLocked(false); | |
} | |
final IResourceDelta delta2 = delta; | |
final IProject project2 = project; | |
Job saveTarget = new Job(ICommonConstants.EMPTY_STRING) { | |
@Override | |
protected IStatus run(IProgressMonitor monitor) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:executeCommand("org.eclipse.ui.window.preferences(preferencePageId=org.eclipse.jdt.ui.preferences.CodeAssistPreferencePage)") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ProgressMonitorDialog progress = new ProgressMonitorDialog(null); | |
try { | |
progress.run(false, true, new IRunnableWithProgress() { | |
@Override | |
public void run(IProgressMonitor monitor) { | |
monitor.beginTask("WORK NAME", IProgressMonitor.UNKNOWN); | |
try { | |
//do something | |
} catch (Exception e) { | |
e.printStackTrace(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void write(Writer writer) throws Exception { | |
Element rootElement = new Element("ABC"); | |
namespace = Namespace.getNamespace("","http://abc.com/abc_1_0_0"); | |
rootElement.setNamespace(namespace); | |
rootElement.addNamespaceDeclaration(namespace); | |
Namespace ns = Namespace.getNamespace("xsi","http://www.w3.org/2001/XMLSchema-instance"); | |
rootElement.addNamespaceDeclaration(ns); | |
rootElement.setAttribute("schemaLocation", "http://abc.com/abc.xsd", ns); | |
this.writeDomain(rootElement); | |
Document document = new Document(rootElement); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void switchDisableOfControl(Control control,boolean flag){ | |
if (control instanceof Composite) { | |
Composite comp = (Composite) control; | |
for (Control c : comp.getChildren()) | |
switchDisableOfControl(c, flag); | |
} else { | |
control.setEnabled(flag); | |
//text | |
if(control instanceof Text){ | |
((Text) control).setText(""); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String replaceLast(String string, String toReplace, | |
String replacement) { | |
int pos = string.lastIndexOf(toReplace); | |
if (pos > -1) { | |
return string.substring(0, pos) | |
+ replacement | |
+ string.substring(pos + toReplace.length(), | |
string.length()); | |
} else { | |
return string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedOutputStream; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.util.zip.ZipEntry; | |
import java.util.zip.ZipInputStream; | |
public class ZipUtils { | |
private static final int BUFFER_SIZE = 4096; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//File > IFile: | |
IContainer[] findContainersForLocationURI = ResourcesPlugin.getWorkspace().getRoot().findContainersForLocationURI( | |
file.toURI()); | |
IFile[] findFilesForLocationURI = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(filefile.toURI()); | |
//IFile > File: | |
IProject fsProject = ResourceModelUtils.getProject(project); |