forked from eclipse-platform/eclipse.platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement double click open for zip files
- Loading branch information
1 parent
35c9f4d
commit da18d3b
Showing
4 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
36 changes: 36 additions & 0 deletions
36
...clipse.core.contenttype/src/org/eclipse/core/runtime/content/ZipFileContentDescriber.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Vector Informatik GmbH and others. | ||
* | ||
* This program and the accompanying materials are made available under the terms of the Eclipse | ||
* Public License 2.0 which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: Vector Informatik GmbH - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.core.runtime.content; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import org.eclipse.core.internal.content.TextContentDescriber; | ||
|
||
/** | ||
* @since 3.10 | ||
* | ||
*/ | ||
public class ZipFileContentDescriber extends TextContentDescriber { | ||
|
||
@Override | ||
public int describe(InputStream contents, IContentDescription description) throws IOException { | ||
|
||
IContentType type = description.getContentType(); | ||
if (type == null || description == null) | ||
return VALID; | ||
|
||
if (type.getId().equals("zipfile")) { //$NON-NLS-1$ | ||
return VALID; | ||
} | ||
return INVALID; | ||
} | ||
} |