This file contains 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
/** | |
* Fullscreenr - lightweight full screen background jquery plugin | |
* By Jan Schneiders | |
* www.nanotux.com | |
* | |
* Modifications by Chris Van Patten | |
* http://www.vanpattenmedia.com | |
* Version 1.5 | |
**/ |
This file contains 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
protected boolean renameProject(IProject localProject, String newProjectName) { | |
RenameResourceProcessor renameProcessor = new RenameResourceProcessor(localProject); | |
renameProcessor.setNewResourceName(newProjectName); | |
CheckConditionsOperation condictionOperation = new CheckConditionsOperation(new RenameRefactoring(renameProcessor), | |
CheckConditionsOperation.FINAL_CONDITIONS); | |
CreateChangeOperation operation = new CreateChangeOperation(condictionOperation, | |
RefactoringCore.getConditionCheckingFailedSeverity()); | |
PerformChangeOperation performChangeOperation = new PerformChangeOperation(operation); |
This file contains 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 IProject getCurrentProject(){ | |
ISelectionService selectionService = | |
Workbench.getInstance().getActiveWorkbenchWindow().getSelectionService(); | |
ISelection selection = selectionService.getSelection(); | |
IProject project = null; | |
if(selection instanceof IStructuredSelection) { | |
Object element = ((IStructuredSelection)selection).getFirstElement(); | |
This file contains 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); |
This file contains 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 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 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 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 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 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)") |
OlderNewer