当前位置: 首页>>代码示例>>Java>>正文


Java SVNUIPlugin类代码示例

本文整理汇总了Java中org.tigris.subversion.subclipse.ui.SVNUIPlugin的典型用法代码示例。如果您正苦于以下问题:Java SVNUIPlugin类的具体用法?Java SVNUIPlugin怎么用?Java SVNUIPlugin使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SVNUIPlugin类属于org.tigris.subversion.subclipse.ui包,在下文中一共展示了SVNUIPlugin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTreeConflict

import org.tigris.subversion.subclipse.ui.SVNUIPlugin; //导入依赖的package包/类
private SVNTreeConflict getTreeConflict(final IResource resource) {
	treeConflict = null;
	BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
		public void run() {
			ISVNClientAdapter client = null;
			try {
				client = SVNWorkspaceRoot.getSVNResourceFor(resource).getRepository().getSVNClient();
				ISVNStatus[] statuses = client.getStatus(resource.getLocation().toFile(), true, true, true);
				for (int i = 0; i < statuses.length; i++) {
					if (statuses[i].hasTreeConflict()) {
						treeConflict = new SVNTreeConflict(statuses[i]);
						break;
					}
				}
			} catch (Exception e) {
				SVNUIPlugin.log(IStatus.ERROR, e.getMessage(), e);
			}
			finally {
				SVNWorkspaceRoot.getSVNResourceFor(resource).getRepository().returnSVNClient(client);
			}
		}			
	});
	return treeConflict;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:25,代码来源:MergeResultsView.java

示例2: createControls

import org.tigris.subversion.subclipse.ui.SVNUIPlugin; //导入依赖的package包/类
private void createControls() {	
	Composite cloudForgeComposite = new Composite(this, SWT.NULL);
	GridLayout layout = new GridLayout();
	layout.numColumns = 1;
	cloudForgeComposite.setLayout(layout);
	GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
	cloudForgeComposite.setLayoutData(data);
	
	ImageHyperlink cloudForgeLink = new ImageHyperlink(cloudForgeComposite, SWT.NONE);
	cloudForgeLink.setImage(SVNUIPlugin.getPlugin().getImageDescriptor(ISVNUIConstants.IMG_CLOUDFORGE).createImage());
	cloudForgeLink.addHyperlinkListener(new HyperlinkAdapter() {
		@Override
		public void linkActivated(HyperlinkEvent evt) {
			try {
				PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL(SIGNUP_URL));
			} catch (Exception e) {
				MessageDialog.openError(getShell(), "Sign-up for CloudForge", e.getMessage());
			}
		}			
	});
	cloudForgeLink.setToolTipText(SIGNUP_URL);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:23,代码来源:CloudForgeComposite.java

示例3: showConflictEditorOption

import org.tigris.subversion.subclipse.ui.SVNUIPlugin; //导入依赖的package包/类
private boolean showConflictEditorOption() {
	if (!fileExists(conflictDescriptor.getBasePath())) {
		return false;
	}
	if (conflictDescriptor.isTreeConflict()) {
		return false;
	}
	if (conflictDescriptor.isBinary()) {
		File pathFile = new File(conflictDescriptor.getPath());
		try {
			MergeFileAssociation[] mergeFileAssociations = SVNUIPlugin.getPlugin().getMergeFileAssociations();
			if (mergeFileAssociations != null) {
				for (int i = 0; i < mergeFileAssociations.length; i++) {
					if (mergeFileAssociations[i].matches(pathFile.getName()) || mergeFileAssociations[i].getFileType().equals(pathFile.getName())) {
						return true;
					}
				}
			}
		} catch (Exception e) {}
		return false;
	}
	return true;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:24,代码来源:ConflictHandlingWizardPage.java

示例4: getResolutions

import org.tigris.subversion.subclipse.ui.SVNUIPlugin; //导入依赖的package包/类
public IMarkerResolution[] getResolutions(IMarker marker) {
	List conflictResolutions = new ArrayList();
	try {
 	if (marker.getAttribute("textConflict") != null && marker.getAttribute("textConflict").toString().equals("true")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 		conflictResolutions.add(new EditConflictsResolution());
 		conflictResolutions.add(new AcceptMineResolution());
 		conflictResolutions.add(new AcceptTheirsResolution());
 	}
	} catch (Exception e) {
		 SVNUIPlugin.log(e.getMessage());
	}
	conflictResolutions.add(new MarkAsResolvedResolution());
	IMarkerResolution[] resolutionArray = new IMarkerResolution[conflictResolutions.size()];
	conflictResolutions.toArray(resolutionArray);
    return resolutionArray;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:17,代码来源:ConflictResolutionGenerator.java

示例5: prompt

import org.tigris.subversion.subclipse.ui.SVNUIPlugin; //导入依赖的package包/类
public boolean prompt(String promptRealm, String promptUsername, boolean promptMaySave) {
      rtnCode = false;
      username = promptUsername;
      realm = promptRealm;
      maySave = promptMaySave;
 		SVNUIPlugin.getStandardDisplay().syncExec(new Runnable() {
	public void run() {
        PasswordPromptDialog dialog = new PasswordPromptDialog(SVNUIPlugin.getStandardDisplay().getActiveShell(),
                realm, username, maySave);
        if (dialog.open() == PasswordPromptDialog.OK) {
            username = dialog.getUsername();
            password = dialog.getPassword();
            allowedSave = dialog.isSave();
            rtnCode = true;
        }
	}
});
      return rtnCode;
  }
 
开发者ID:subclipse,项目名称:subclipse,代码行数:20,代码来源:SVNPromptUserPassword.java

示例6: promptUser

import org.tigris.subversion.subclipse.ui.SVNUIPlugin; //导入依赖的package包/类
public boolean promptUser(String promptRealm, String promptUsername, boolean promptMaySave) {
      rtnCode = false;
      username = promptUsername;
      realm = promptRealm;
      maySave = promptMaySave;
 		SVNUIPlugin.getStandardDisplay().syncExec(new Runnable() {
	public void run() {
        UserPromptDialog dialog = new UserPromptDialog(SVNUIPlugin.getStandardDisplay().getActiveShell(),
                realm, username, maySave);
        if (dialog.open() == UserPromptDialog.OK) {
            username = dialog.getUsername();
            allowedSave = dialog.isSave();
            rtnCode = true;
        }
	}
});
      return rtnCode;
  }
 
开发者ID:subclipse,项目名称:subclipse,代码行数:19,代码来源:SVNPromptUserPassword.java

示例7: performOk

import org.tigris.subversion.subclipse.ui.SVNUIPlugin; //导入依赖的package包/类
public boolean performOk() {
	int numTemplates = viewer.getList().getItemCount();
	String[] templates = new String[numTemplates];
	for (int i = 0; i < numTemplates; i++) {
		templates[i] = (String) viewer.getElementAt(i);
	}
	try {
		SVNUIPlugin.getPlugin().getRepositoryManager().getCommentsManager().replaceAndSaveCommentTemplates(templates);
	} catch (TeamException e) {
		SVNUIPlugin.openError(getShell(), null, null, e, SVNUIPlugin.LOG_OTHER_EXCEPTIONS);
	}
	
	SVNUIPlugin.getPlugin().getPreferenceStore().setValue(ISVNUIConstants.PREF_COMMENTS_TO_SAVE, getCommentsToSave());
	
	return super.performOk();
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:17,代码来源:CommentTemplatesPreferencePage.java

示例8: saveKeyFilesHistory

import org.tigris.subversion.subclipse.ui.SVNUIPlugin; //导入依赖的package包/类
public void saveKeyFilesHistory() throws TeamException {
    IPath pluginStateLocation = SVNUIPlugin.getPlugin().getStateLocation();
    File tempFile = pluginStateLocation.append(KEYFILE_HIST_FILE + ".tmp").toFile(); //$NON-NLS-1$
    File histFile = pluginStateLocation.append(KEYFILE_HIST_FILE).toFile();
    try {
             XMLWriter writer = new XMLWriter(new BufferedOutputStream(new FileOutputStream(tempFile)));
             try {
                 writer.startTag(ELEMENT_KEYFILE_HISTORY, null, false);
                 for (int i=0; i<previousKeyFiles.length && i<MAX_FILES; i++)
                     writer.printSimpleTag(ELEMENT_KEYFILE, previousKeyFiles[i]);
                 writer.endTag(ELEMENT_KEYFILE_HISTORY);
             } finally {
                     writer.close();
             }
             if (histFile.exists()) {
                     histFile.delete();
             }
             boolean renamed = tempFile.renameTo(histFile);
             if (!renamed) {
                     throw new TeamException(new Status(Status.ERROR, SVNUIPlugin.ID, TeamException.UNABLE, Policy.bind("RepositoryManager.rename", tempFile.getAbsolutePath()), null)); //$NON-NLS-1$
             }
     } catch (IOException e) {
             throw new TeamException(new Status(Status.ERROR, SVNUIPlugin.ID, TeamException.UNABLE, Policy.bind("RepositoryManager.save",histFile.getAbsolutePath()), e)); //$NON-NLS-1$
     }
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:26,代码来源:KeyFilesManager.java

示例9: canShowHistoryFor

import org.tigris.subversion.subclipse.ui.SVNUIPlugin; //导入依赖的package包/类
public boolean canShowHistoryFor(Object object) {
if (object instanceof IResource) {
	IResource resource = (IResource)object;
	ISVNLocalResource localResource = SVNWorkspaceRoot.getSVNResourceFor(resource);
	if (localResource != null) {
		try {
			if (!localResource.isManaged()) {
				return false;
			}
			if (localResource.isAdded() && !localResource.getStatus().isCopied()) {
				return false;
			}
		} catch (Exception e) {
			SVNUIPlugin.log(Status.ERROR, e.getMessage(), e);
		}
	}
}
   return (object instanceof IResource && ((IResource) object).getType() != IResource.ROOT)
       || (object instanceof ISVNRemoteResource);
 }
 
开发者ID:subclipse,项目名称:subclipse,代码行数:21,代码来源:SVNHistoryPageSource.java

示例10: refreshViewer

import org.tigris.subversion.subclipse.ui.SVNUIPlugin; //导入依赖的package包/类
/**
  * this is called whenever a new repository location is added for example
  * or when user wants to refresh
  */
 protected void refreshViewer(Object object, boolean refreshRepositoriesFolders) {
     if (treeViewer == null) return;
     if (refreshRepositoriesFolders) {
     	IRunnableWithProgress runnable = new IRunnableWithProgress() {
	public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
             	SVNProviderPlugin.getPlugin().getRepositories().refreshRepositoriesFolders(monitor);
	}
     	};
         try {
	new ProgressMonitorDialog(getShell()).run(true, false, runnable);
} catch (Exception e) {
          SVNUIPlugin.openError(getShell(), null, null, e, SVNUIPlugin.LOG_TEAM_EXCEPTIONS);
}
     }
     if (object == null) treeViewer.refresh();
     else {
     	if (object instanceof ISVNRemoteFolder) {
     		ISVNRemoteFolder parent = ((ISVNRemoteFolder)object).getParent();
     		if (parent == null) {
     			treeViewer.refresh();
     			return;
     		}
     	}
     	treeViewer.refresh(object); 
     }
 }
 
开发者ID:subclipse,项目名称:subclipse,代码行数:31,代码来源:RepositoriesView.java

示例11: addPages

import org.tigris.subversion.subclipse.ui.SVNUIPlugin; //导入依赖的package包/类
/**
 * Creates the wizard pages
 */
public void addPages() {
	// add the main page
       mainPage = new NewRemoteFolderWizardMainPage(
           "newRemoteFolderPage1",  //$NON-NLS-1$ 
           Policy.bind("NewRemoteFolderWizard.heading"), //$NON-NLS-1$
           SVNUIPlugin.getPlugin().getImageDescriptor(ISVNUIConstants.IMG_WIZBAN_NEW_FOLDER));
       mainPage.setParentFolder(selection);  
	addPage(mainPage);
       
       // add commit comment page
       String pageTitle = Policy.bind("CommentCommitWizardPage.pageTitle"); //$NON-NLS-1$
       String pageDescription = Policy.bind("CommentCommitWizardPage.pageDescription"); //$NON-NLS-1$
       ImageDescriptor image = SVNUIPlugin.getPlugin().getImageDescriptor(ISVNUIConstants.IMG_WIZBAN_NEW_FOLDER);
       commitCommentPage = new CommentCommitWizardPage(parentDialog, pageTitle, pageTitle, image, pageDescription);
       addPage(commitCommentPage); 
               
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:21,代码来源:NewRemoteFolderWizard.java

示例12: execute

import org.tigris.subversion.subclipse.ui.SVNUIPlugin; //导入依赖的package包/类
protected void execute(IAction action)
	throws InvocationTargetException, InterruptedException {
       RepositoryManager manager = SVNUIPlugin.getPlugin().getRepositoryManager();
       final String message = manager.promptForComment(getShell(), new IResource[]{});
       
       if (message == null)
           return; // cancel
       
       run(new IRunnableWithProgress() {
           public void run(IProgressMonitor monitor) throws InvocationTargetException {
               try {
                   SVNProviderPlugin.getPlugin().getRepositoryResourcesManager().
                       deleteRemoteResources(        
                           getSelectedRemoteResources(),message,monitor);
               } catch (TeamException e) {
                   throw new InvocationTargetException(e);
               }
           }
       }, true /* cancelable */, PROGRESS_BUSYCURSOR); //$NON-NLS-1$        

}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:22,代码来源:DeleteRemoteResourceAction.java

示例13: doesSVNDirectoryExist

import org.tigris.subversion.subclipse.ui.SVNUIPlugin; //导入依赖的package包/类
/**
    * check if there is a valid svn directory
    */
private boolean doesSVNDirectoryExist() {
	// Determine if there is an existing .svn/ directory from which configuration
	// information can be retrieved.
       boolean isSVNFolder = false;
	try {
	  projectStatus = SVNWorkspaceRoot.peekResourceStatusFor(project);;
	  isSVNFolder = (projectStatus != null) && projectStatus.hasRemote();
         
	} catch (final SVNException e) {
		Shell shell = null;
		// If this is called before the pages have been added, getContainer will return null
		if (getContainer() != null) {
			shell = getContainer().getShell();
		}
           SVNUIPlugin.openError(shell, null, null, e);
	}
       return isSVNFolder; 
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:22,代码来源:SharingWizard.java

示例14: getChildren

import org.tigris.subversion.subclipse.ui.SVNUIPlugin; //导入依赖的package包/类
public Object[] getChildren() {
	if (children == null) {
		List<Object> childList = new ArrayList<Object>();
		for (ISVNProperty property : properties) {
			if (property.getFile().getAbsolutePath().equals(resource.getLocation().toOSString())) {
				childList.add(new PropertyComparePropertyNode(property));
			}
		}
		if (recursive && resource instanceof IContainer) {
			try {
				IResource[] childResources = ((IContainer)resource).members();
				for (IResource childResource : childResources) {
					PropertyCompareLocalResourceNode childNode = new PropertyCompareLocalResourceNode(childResource, true, properties);
					childList.add(childNode);
				}
			} catch (CoreException e) {
				SVNUIPlugin.log(e);
			}
		}
		children = new Object[childList.size()];
		childList.toArray(children);
	}
	return children;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:25,代码来源:PropertyCompareLocalResourceNode.java

示例15: getCommentWithPrompt

import org.tigris.subversion.subclipse.ui.SVNUIPlugin; //导入依赖的package包/类
public String getCommentWithPrompt(Shell shell) {
    final String comment= getComment(false);
    if (comment.length() == 0) {
        final IPreferenceStore store= SVNUIPlugin.getPlugin().getPreferenceStore();
        final String value= store.getString(ISVNUIConstants.PREF_ALLOW_EMPTY_COMMIT_COMMENTS);
        
        if (MessageDialogWithToggle.NEVER.equals(value))
            return null;
        
        if (MessageDialogWithToggle.PROMPT.equals(value)) {
            
            final String title= Policy.bind("CommitCommentArea_2"); 
            final String message= Policy.bind("CommitCommentArea_3"); 
            final String toggleMessage= Policy.bind("CommitCommentArea_4"); 
            
            final MessageDialogWithToggle dialog= MessageDialogWithToggle.openYesNoQuestion(shell, title, message, toggleMessage, false, store, ISVNUIConstants.PREF_ALLOW_EMPTY_COMMIT_COMMENTS);
            if (dialog.getReturnCode() != IDialogConstants.YES_ID) {
                fTextBox.setFocus();
                return null;
            }
        }
    }
    return getComment(true);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:25,代码来源:CommitCommentArea.java


注:本文中的org.tigris.subversion.subclipse.ui.SVNUIPlugin类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。