Completely changed the structure and switched to Eclipse Plugin.
[Mograsim.git] / net.mograsim.rcp / src / net / mograsim / rcp / parts / SamplePart.java
diff --git a/net.mograsim.rcp/src/net/mograsim/rcp/parts/SamplePart.java b/net.mograsim.rcp/src/net/mograsim/rcp/parts/SamplePart.java
deleted file mode 100644 (file)
index fde7162..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-package net.mograsim.rcp.parts;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.annotation.PostConstruct;
-import javax.inject.Inject;
-
-import org.eclipse.e4.core.services.nls.Translation;
-import org.eclipse.e4.ui.di.Focus;
-import org.eclipse.e4.ui.di.Persist;
-import org.eclipse.e4.ui.model.application.ui.basic.MPart;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-
-import net.mograsim.rcp.i18n.Messages;
-
-public class SamplePart
-{
-
-       private TableViewer tableViewer;
-       private Text txtInput;
-
-       @Inject
-       private MPart part;
-
-       @PostConstruct
-       public void createComposite(Composite parent)
-       {
-               parent.setLayout(new GridLayout(1, false));
-
-               txtInput = new Text(parent, SWT.BORDER);
-               txtInput.setMessage("Enter text to mark part as dirty");
-               txtInput.addModifyListener(e -> part.setDirty(true));
-               txtInput.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-               tableViewer = new TableViewer(parent);
-
-               tableViewer.setContentProvider(ArrayContentProvider.getInstance());
-               tableViewer.setInput(createInitialDataModel());
-               tableViewer.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));
-       }
-
-       @Focus
-       public void setFocus()
-       {
-               tableViewer.getTable().setFocus();
-       }
-
-       @Persist
-       public void save()
-       {
-               part.setDirty(false);
-       }
-
-       private static List<String> createInitialDataModel()
-       {
-               return Arrays.asList("Sample item 1", "Sample item 2", "Sample item 3", "Sample item 4", "Sample item 5");
-       }
-
-       @Inject
-       public void translate(@Translation Messages m)
-       {
-               if (txtInput != null && !txtInput.isDisposed())
-                       txtInput.setMessage(m.sample_part_input_hint);
-       }
-}
\ No newline at end of file