本文整理汇总了Java中org.tigris.subversion.subclipse.ui.SVNUIPlugin.ID属性的典型用法代码示例。如果您正苦于以下问题:Java SVNUIPlugin.ID属性的具体用法?Java SVNUIPlugin.ID怎么用?Java SVNUIPlugin.ID使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.tigris.subversion.subclipse.ui.SVNUIPlugin
的用法示例。
在下文中一共展示了SVNUIPlugin.ID属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: saveKeyFilesHistory
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$
}
}
示例2: handleErrors
protected void handleErrors(IStatus[] errors) throws SVNException {
if (errors.length == 0) return;
if (errors.length == 1 && statusCount == 1) {
throw new SVNException(errors[0]);
}
MultiStatus result = new MultiStatus(SVNUIPlugin.ID, 0, getErrorMessage(errors, statusCount), null);
for (int i = 0; i < errors.length; i++) {
IStatus s = errors[i];
if (s.isMultiStatus()) {
result.add(new SVNStatus(s.getSeverity(), s.getMessage(), s.getException()));
result.addAll(s);
} else {
result.add(s);
}
}
throw new SVNException(result);
}
示例3: saveCommentHistory
/**
* save the comments history
*/
public void saveCommentHistory() throws TeamException {
IPath pluginStateLocation = SVNUIPlugin.getPlugin().getStateLocation();
File tempFile = pluginStateLocation.append(COMMENT_HIST_FILE + ".tmp").toFile(); //$NON-NLS-1$
File histFile = pluginStateLocation.append(COMMENT_HIST_FILE).toFile();
try {
XMLWriter writer = new XMLWriter(new BufferedOutputStream(new FileOutputStream(tempFile)));
try {
writer.startTag(ELEMENT_COMMIT_HISTORY, null, false);
for (int i=0; i<previousComments.length && i<maxComments; i++)
writer.printSimpleTag(ELEMENT_COMMIT_COMMENT, previousComments[i]);
writer.endTag(ELEMENT_COMMIT_HISTORY);
} finally {
writer.close();
}
if (histFile.exists()) {
histFile.delete();
}
boolean renamed = tempFile.renameTo(histFile);
if (!renamed) {
throw new TeamException(new Status(IStatus.ERROR, SVNUIPlugin.ID, TeamException.UNABLE, Policy.bind("RepositoryManager.rename", tempFile.getAbsolutePath()), null)); //$NON-NLS-1$
}
} catch (IOException e) {
throw new TeamException(new Status(IStatus.ERROR, SVNUIPlugin.ID, TeamException.UNABLE, Policy.bind("RepositoryManager.save",histFile.getAbsolutePath()), e)); //$NON-NLS-1$
}
}
示例4: getStatusToDisplay
/**
* Return the status to be displayed in an error dialog for the given list
* of non-OK status.
*
* This method can be overridden by subclasses. Returning an OK status will
* prevent the error dialog from being shown.
*/
protected IStatus getStatusToDisplay(IStatus[] problems) {
if (problems.length == 1) {
return problems[0];
}
MultiStatus combinedStatus = new MultiStatus(SVNUIPlugin.ID, 0, getMultiStatusMessage(), null); //$NON-NLS-1$
for (int i = 0; i < problems.length; i++) {
combinedStatus.merge(problems[i]);
}
return combinedStatus;
}
示例5: saveCommentTemplates
public void saveCommentTemplates() throws TeamException {
IPath pluginStateLocation = SVNUIPlugin.getPlugin().getStateLocation();
File tempFile = pluginStateLocation.append(
COMMENT_TEMPLATES_FILE + ".tmp").toFile(); //$NON-NLS-1$
File histFile = pluginStateLocation.append(COMMENT_TEMPLATES_FILE)
.toFile();
try {
XMLWriter writer = new XMLWriter(new BufferedOutputStream(
new FileOutputStream(tempFile)));
try {
writeCommentTemplates(writer);
} finally {
writer.close();
}
if (histFile.exists()) {
histFile.delete();
}
boolean renamed = tempFile.renameTo(histFile);
if (!renamed) {
throw new TeamException(new Status(IStatus.ERROR,
SVNUIPlugin.ID, TeamException.UNABLE, NLS.bind(
Policy.bind("RepositoryManager.rename"),
new String[] { tempFile.getAbsolutePath() }),
null));
}
} catch (IOException e) {
throw new TeamException(new Status(IStatus.ERROR, SVNUIPlugin.ID,
TeamException.UNABLE, NLS.bind(
Policy.bind("RepositoryManager.save"),
new String[] { histFile.getAbsolutePath() }), e));
}
}
示例6: getCharset
public String getCharset() throws CoreException {
InputStream contents = getContents();
try {
String charSet = SVNUIPlugin.getCharset(getName(), contents);
return charSet;
} catch (IOException e) {
throw new SVNException(new Status(IStatus.ERROR, SVNUIPlugin.ID, IResourceStatus.FAILED_DESCRIBING_CONTENTS, Policy.bind("RemoteAnnotationStorage.1", getFullPath().toString()), e)); //$NON-NLS-1$
} finally {
try {
contents.close();
} catch (IOException e1) {
// Ignore
}
}
}
示例7: handleError
/**
* Shows the given errors to the user.
* @param Exception
* the exception containing the error
* @param title
* the title of the error dialog
* @param message
* the message for the error dialog
* @param shell
* the shell to open the error dialog in
*/
public static void handleError(Shell shell, Exception exception, String title, String message) {
IStatus status = null;
boolean log = false;
boolean dialog = false;
Throwable t = exception;
if (exception instanceof TeamException) {
status = ((TeamException) exception).getStatus();
log = false;
dialog = true;
} else if (exception instanceof InvocationTargetException) {
t = ((InvocationTargetException) exception).getTargetException();
if (t instanceof TeamException) {
status = ((TeamException) t).getStatus();
log = false;
dialog = true;
} else if (t instanceof CoreException) {
status = ((CoreException) t).getStatus();
log = true;
dialog = true;
} else if (t instanceof InterruptedException) {
return;
} else {
status = new Status(IStatus.ERROR, SVNUIPlugin.ID, 1, Policy.bind("TeamAction.internal"), t); //$NON-NLS-1$
log = true;
dialog = true;
}
}
if (status == null)
return;
if (!status.isOK()) {
IStatus toShow = status;
if (status.isMultiStatus()) {
IStatus[] children = status.getChildren();
if (children.length == 1) {
toShow = children[0];
}
}
if (title == null) {
title = status.getMessage();
}
if (message == null) {
message = status.getMessage();
}
if (dialog && shell != null) {
ErrorDialog.openError(shell, title, message, toShow);
}
if (log || shell == null) {
SVNUIPlugin.log(toShow.getSeverity(), message, t);
}
}
}