Skip to content

Instantly share code, notes, and snippets.

public void resourceChanged(final IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.POST_CHANGE) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
IFile file = ((IFileEditorInput) input).getFile();
if (!file.exists()) {
// ファイル名が変更されていたら、EditorをCloseする
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
page.closeEditor(VisualMXMLEditor.this, false);
} else {
public void resourceChanged(final IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.POST_CHANGE) {
IResourceDelta rootDelta = event.getDelta();
final IEditorInput input = getEditorInput();
IFile file = ((IFileEditorInput) input).getFile();
IPath filePath = file.getFullPath();
IResourceDelta targetDelta = rootDelta.findMember(filePath);
if (targetDelta != null) {
Display.getDefault().asyncExec(new Runnable() {
public void resourceChanged(final IResourceChangeEvent event) {
if (event.getType() != IResourceChangeEvent.POST_CHANGE
|| !(getEditorInput() instanceof IFileEditorInput)) {
return;
}
IResourceDelta rootDelta = event.getDelta();
IFile file = ((IFileEditorInput) getEditorInput()).getFile();
IPath filePath = file.getFullPath();
IResourceDelta delta = rootDelta.findMember(filePath);
<extension
id="AIRFlexProjectNature"
point="org.eclipse.core.resources.natures">
<runtime>
<run class="net.sf.amateras.air.natures.AIRFlexProjectNature"/>
</runtime>
<builder id="net.sf.amateras.air.MXMLBuilder"/>
</extension>
<extension
IProjectNatureDescriptor natureDescriptor = project.getWorkspace().getNatureDescriptor(NATURE_ID);
String[] builderIds = ((ProjectNatureDescriptor) natureDescriptor).getBuilderIds();
public function compileErrorTest():void {
var timer:Timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, function onTick(event:Event):void {
var httpService:HTTPService = new HTTPService();
httpService.addEventListener(ResultEvent.RESULT,
function http(event:ResultEvent):void {
httpService.removeEventListener(ResultEvent.RESULT, http);
});
});
}
#
# uncrustify config file for objective-c and objective-c++
#
newlines = auto # auto/lf/crlf/cr
utf8_force = true
output_tab_size = 4 # new tab size
#
# Indenting
@aqubi
aqubi / gist:30e260deca44b9a68f76
Created January 10, 2015 05:33
BakgroundQueue
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
dispatch_async(dispatch_get_main_queue(), ^{
});
});
@aqubi
aqubi / DarwinNotifyCenter
Last active August 29, 2015 14:15
DarwinNotifyCenter
- (void)addObserver {
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),
NULL,
MyCallBack,
CFSTR("MyNotificationName"),
NULL,
CFNotificationSuspensionBehaviorDeliverImmediately);
}
static void MyCallBack(CFNotificationCenterRef center, void *observer, CFStringRef name,const void *object, CFDictionaryRef userInfo) {
@aqubi
aqubi / SCNLookAtConstraint
Last active January 19, 2022 11:53
SceneKit Tips
let targetNode = self.scene!.rootNode.childNodeWithName(FLSNodeName.CameraTargetPoint, recursively: false)
if let target = targetNode {
let lookAtConstraint = SCNLookAtConstraint(target:target)
lookAtConstraint.influenceFactor = 0
self.pointOfView!.constraints = [lookAtConstraint]
}