Skip to content

Commit

Permalink
Implement ITabbedPropertySheetPageContributor in Hints View
Browse files Browse the repository at this point in the history
- This ensures that the Properties View displays "Properties are not available" instead of the default table
  • Loading branch information
Phillipus committed Mar 7, 2024
1 parent 3ef1be6 commit 60c69fd
Showing 1 changed file with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;
import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
import org.osgi.framework.Bundle;

import com.archimatetool.editor.ArchiPlugin;
Expand All @@ -69,7 +72,7 @@
@SuppressWarnings("nls")
public class HintsView
extends ViewPart
implements IContextProvider, IHintsView, ISelectionListener, IComponentSelectionListener {
implements IContextProvider, IHintsView, ISelectionListener, IComponentSelectionListener, ITabbedPropertySheetPageContributor {


// CSS string
Expand Down Expand Up @@ -413,6 +416,23 @@ private void createFileMap() {
}
}

@Override
public <T> T getAdapter(Class<T> adapter) {
/*
* Return the PropertySheet Page (currently empty so we can display "Properties are not available" instead of the default table)
*/
if(adapter == IPropertySheetPage.class) {
return adapter.cast(new TabbedPropertySheetPage(this));
}

return super.getAdapter(adapter);
}

@Override
public String getContributorId() {
return ArchiPlugin.PLUGIN_ID;
}

@Override
public void dispose() {
super.dispose();
Expand Down

0 comments on commit 60c69fd

Please sign in to comment.