Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #22 from wso2-dev/developer-studio-3.7.0
Browse files Browse the repository at this point in the history
sucessfully commited the changes
Timestamp : Wed Jul 09 19:34:41 IST 2014
https://wso2.org/jenkins-pr-builder/job/developer-studio/29/
  • Loading branch information
wso2-jenkins-bot committed Jul 9, 2014
2 parents 14de511 + d153272 commit 56bed0e
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 4 deletions.
30 changes: 27 additions & 3 deletions esb/org.wso2.developerstudio.eclipse.esb.project/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,14 @@
point="org.eclipse.ui.navigator.viewer">
<viewerContentBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer">
<includes>
<contentExtension pattern="org.wso2.developerstudio.eclipse.esb.project.filter.graphical*" />
<contentExtension pattern="org.wso2.developerstudio.eclipse.esb.project.filter.graphical*" />
<contentExtension pattern="org.wso2.ui.navigator.linkHelper.EsbExplorer"/>
</includes>
</viewerContentBinding>
<viewerContentBinding viewerId="org.eclipse.ui.navigator.PackageExplorer">
<includes>
<contentExtension pattern="org.wso2.developerstudio.eclipse.esb.project.filter.graphical*" />
<contentExtension pattern="org.wso2.developerstudio.eclipse.esb.project.filter.graphical*" />
<contentExtension pattern="org.wso2.ui.navigator.linkHelper.EsbExplorer"/>
</includes>
</viewerContentBinding>
</extension>
Expand Down Expand Up @@ -161,5 +163,27 @@
</enablement>
</objectContribution>
</extension>


<extension point="org.eclipse.ui.navigator.linkHelper">
<linkHelper
class="org.wso2.developerstudio.eclipse.esb.project.esblinkhelper.ESBExplorerLinkHelper"
id="org.wso2.ui.navigator.linkHelper.EsbExplorer">
<selectionEnablement>
<adapt type="org.eclipse.core.resources.IResource">
<test
property="org.eclipse.core.resources.projectNature"
value="org.wso2.developerstudio.eclipse.esb.project.nature">
</test>
</adapt>
</selectionEnablement>
<editorInputEnablement>
<adapt type="org.eclipse.core.resources.IResource">
<test
property="org.eclipse.core.resources.projectNature"
value="org.wso2.developerstudio.eclipse.esb.project.nature">
</test>
</adapt>
</editorInputEnablement>
</linkHelper>
</extension>
</plugin>
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright (c) 2011, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.wso2.developerstudio.eclipse.esb.project.esblinkhelper;

import java.util.regex.Pattern;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.navigator.ILinkHelper;
import org.eclipse.ui.part.FileEditorInput;

public class ESBExplorerLinkHelper implements ILinkHelper{

@Override
public void activateEditor(IWorkbenchPage arg0, IStructuredSelection arg1) {

}

@Override
public IStructuredSelection findSelection(IEditorInput iEditorInput) {

if(iEditorInput instanceof FileEditorInput){
return getSelection((FileEditorInput) iEditorInput);
}

return StructuredSelection.EMPTY;
}

public IStructuredSelection getSelection(FileEditorInput fei){

String filePath = fei.getFile().getFullPath().toOSString();

filePath = filePath.replaceAll(Pattern.quote("\\"), "/");
filePath = filePath.replaceAll("/graphical-synapse-config/", "/synapse-config/");
filePath = filePath.replaceAll("/(endpoint_|localentry_|proxy_|sequence_|task_|template_|api_)", "/");
filePath = filePath.replaceAll("esb_diagram$", "xml");

IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(filePath));


return new StructuredSelection(file);

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public void update(EsbServer server) throws Exception{//ModelObject object) {
// // Avoid un-necessay refreshing.
// if (!getSource().equals(newSource)) {
// // Change source editor input.
getDocument().setDocumentPartitioner(new StructuredTextPartitioner());
// getDocument().setDocumentPartitioner(new StructuredTextPartitioner());
getDocument().set(newSource);
// }
//
Expand Down

0 comments on commit 56bed0e

Please sign in to comment.