Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion plugins/org.eclipse.wst.common.snippets/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %Snippets_View.name
Bundle-SymbolicName: org.eclipse.wst.common.snippets; singleton:=true
Automatic-Module-Name: org.eclipse.wst.common.snippets
Bundle-Version: 1.3.200.qualifier
Bundle-Version: 1.3.300.qualifier
Bundle-Activator: org.eclipse.wst.common.snippets.internal.SnippetsPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Expand All @@ -19,6 +19,7 @@ Export-Package: org.eclipse.wst.common.snippets.core,
org.eclipse.wst.common.snippets.internal.util;x-internal:=true,
org.eclipse.wst.common.snippets.ui
Require-Bundle: org.eclipse.gef;bundle-version="[3.10.0,6.0.0)",
org.eclipse.jface;bundle-version="[3.33.0,4.0.0)",
org.eclipse.ui.ide;bundle-version="[3.12.0,4.0.0)",
org.eclipse.ui.workbench.texteditor;bundle-version="[3.10.0,4.0.0)",
org.eclipse.ui;bundle-version="[3.107.0,4.0.0)",
Expand Down
4 changes: 2 additions & 2 deletions plugins/org.eclipse.wst.common.snippets/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012, 2018 Eclipse Foundation and others.
Copyright (c) 2012, 2026 Eclipse Foundation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
Expand All @@ -21,7 +21,7 @@

<groupId>org.eclipse.webtools.common</groupId>
<artifactId>org.eclipse.wst.common.snippets</artifactId>
<version>1.3.200-SNAPSHOT</version>
<version>1.3.300-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2004, 2024 IBM Corporation and others.
* Copyright (c) 2004, 2026 IBM Corporation and others.
* All rights reserved. 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
Expand All @@ -14,6 +14,7 @@

import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.wst.common.snippets.internal.model.SnippetManager;
import org.osgi.framework.BundleContext;


/**
Expand Down Expand Up @@ -73,4 +74,17 @@ public SnippetsPlugin() {
super();
fInstance = this;
}

@Override
public void stop(BundleContext context) throws Exception {
try {
SnippetManager.getInstance().saveDefinitions();
}
catch (Exception e) {
Logger.logException("could not save snippet definitions on shutdown", e); //$NON-NLS-1$
}
finally {
super.stop(context);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2004, 2024 IBM Corporation and others.
* Copyright (c) 2004, 2026 IBM Corporation and others.
* All rights reserved. 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
Expand Down Expand Up @@ -210,6 +210,7 @@ public IEntryChangeListener[] getListeners() {
public SnippetPaletteRoot getPaletteRoot() {
if (fRoot == null) {
fRoot = new SnippetPaletteRoot(getDefinitions());
fRoot.connect();
}
return fRoot;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2004, 2022 IBM Corporation and others.
* Copyright (c) 2004, 2026 IBM Corporation and others.
* All rights reserved. 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
Expand Down Expand Up @@ -246,7 +246,7 @@ public void update() {

private class ImportAction extends PaletteCustomizationAction {
public ImportAction() {
setEnabled(false);
setEnabled(true);
setText(SnippetsMessages.SnippetCustomizerDialog_0);
SnippetsPluginImageHelper pluginImageHelper = SnippetsPluginImageHelper.getInstance();
setImageDescriptor(pluginImageHelper.getImageDescriptor(SnippetsPluginImages.IMG_ELCL_IMPORT));
Expand Down Expand Up @@ -325,14 +325,7 @@ public void run() {
}

public void update() {
boolean enabled = false;
PaletteEntry entry = getSelectedPaletteEntry();
if (entry != null) {
if (getCustomizer() instanceof SnippetsCustomizer) {
enabled = ((SnippetsCustomizer) getCustomizer()).canImport(entry);
}
}
setEnabled(enabled);
setEnabled(getCustomizer() instanceof SnippetsCustomizer);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2004, 2022 IBM Corporation and others.
* Copyright (c) 2004, 2026 IBM Corporation and others.
* All rights reserved. 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
Expand Down Expand Up @@ -264,8 +264,7 @@ public String toXML(ISnippetsEntry entry) {
}

public void write(SnippetDefinitions definitions) {
try {
FileOutputStream ostream = new FileOutputStream(getFilename());
try (FileOutputStream ostream = new FileOutputStream(getFilename())) {
write(definitions, ostream);
}
catch (IOException e) {
Expand All @@ -283,7 +282,6 @@ public void write(SnippetDefinitions definitions, OutputStream stream) {
Logger.log(Logger.ERROR, "could not save " + stream, e); //$NON-NLS-1$
}
finally {
// stream.close();
document = null;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2004, 2024 IBM Corporation and others.
* Copyright (c) 2004, 2026 IBM Corporation and others.
* All rights reserved. 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
Expand Down Expand Up @@ -609,8 +609,7 @@ protected PaletteRoot createRoot(SnippetDefinitions defs) {
*/
public void dispose() {
super.dispose();
if (fRoot != null)
fRoot.disconnect();
SnippetManager.getInstance().getPaletteRoot().disconnect();
if (clipboard != null)
clipboard.dispose();
if (fPartActionUpdateListener != null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2004, 2024 IBM Corporation and others.
* Copyright (c) 2004, 2026 IBM Corporation and others.
* All rights reserved. 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
Expand Down Expand Up @@ -229,10 +229,13 @@ protected void doUpdateItem(Widget widget, Object element, boolean fullMap) {

IBaseLabelProvider prov = getLabelProvider();
ITableLabelProvider tprov = null;
ILabelProvider lprov = (ILabelProvider) prov;
ILabelProvider lprov = null;
if (prov instanceof ITableLabelProvider) {
tprov = (ITableLabelProvider) prov;
}
else if (prov instanceof ILabelProvider) {
lprov = (ILabelProvider) prov;
}
int columnCount = fTable.getColumnCount();
// Also enter loop if no columns added. See 1G9WWGZ: JFUIF:WINNT -
// TableViewer with 0 columns does not work
Expand Down